* Nagle's algorithm that have severe performance penalties.
* @param s The socket to disable nagle for.
*/
-void ap_sock_disable_nagle(int s);
+void ap_sock_disable_nagle(apr_socket_t *s);
#else
#define ap_sock_disable_nagle(s) /* NOOP */
#endif
return;
}
- ap_sock_disable_nagle(csd);
+ ap_sock_disable_nagle(sock);
iol = ap_iol_attach_socket(p, sock);
conn_io = ap_bcreate(p, B_RDWR);
ap_bpush_iol(conn_io, iol);
}
if (thread_socket_table[thread_num] < 0) {
- ap_sock_disable_nagle(csd);
+ ap_sock_disable_nagle(sock);
}
iol = ap_iol_attach_socket(p, sock);
conn_io = ap_bcreate(p, B_RDWR);
return;
}
- ap_sock_disable_nagle(csd);
+ ap_sock_disable_nagle(sock);
iol = ap_iol_attach_socket(p, sock);
}
if (thread_socket_table[thread_num] < 0) {
- ap_sock_disable_nagle(csd);
+ ap_sock_disable_nagle(sock);
}
iol = ap_iol_attach_socket(p, sock);
conn_io = ap_bcreate(p, B_RDWR);
continue;
#endif
- ap_sock_disable_nagle(sockdes);
+ ap_sock_disable_nagle(csd);
iol = ap_iol_attach_socket(ptrans, csd);
(void) ap_update_child_status(my_child_num, SERVER_BUSY_READ,
}
#if defined(TCP_NODELAY) && !defined(MPE) && !defined(TPF)
-void ap_sock_disable_nagle(int s)
+void ap_sock_disable_nagle(apr_socket_t *s)
{
/* The Nagle algorithm says that we should delay sending partial
* packets in hopes of getting more data. We don't want to do
*
* In spite of these problems, failure here is not a shooting offense.
*/
- int just_say_no = 1;
+ apr_status_t status = apr_setsocketopt(s, APR_TCP_NODELAY, 1);
- if (setsockopt(s, IPPROTO_TCP, TCP_NODELAY, (char *) &just_say_no,
- sizeof(int)) != APR_SUCCESS) {
- ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf,
+ if (status != APR_SUCCESS) {
+ ap_log_error(APLOG_MARK, APLOG_WARNING, status, ap_server_conf,
"setsockopt: (TCP_NODELAY)");
}
}