You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Chuck Murcko <ch...@telebase.com> on 1996/05/27 01:33:45 UTC
SO_LINGER patch
This is the patch offered by Kimmo Suominen <ki...@tac.nyc.ny.us> to do the
SO_LINGER fixups for some SVR4s. I will fold prooxy changes into that
module over the next 48 hours or so as I work on it.
It's safer to install this before the rprintf() patch. Sorry.
*** ../src.bak/Configuration.tmpl Thu May 23 22:20:09 1996
--- Configuration.tmpl Sun May 26 19:16:11 1996
***************
*** 102,115 ****
#AUX_CFLAGS= -DSCO
#AUX_LIBS= -lPW -lsocket -lmalloc -lcrypt_i
# For SCO OpenServer Release 5
#AUX_CFLAGS= -DSCO5
#AUX_LIBS=-lsocket -lmalloc -lprot
# For SVR4
#AUX_CFLAGS= -DSVR4
#AUX_LIBS= -lsocket -lnsl -lc
# For UnixWare 2.x, no longer just SVR4 (sigh) - use cc, not gcc
! # AUX_CFLAGS= -DSVR4 -DUW2
! # AUX_LIBS= -lsocket -lnsl -lcrypt
# For Amdahl UTS 2.1
# -Xa enables ANSI mode, -eft is expanded types
#AUX_CFLAGS= -Xa -eft -DUTS21
--- 102,119 ----
#AUX_CFLAGS= -DSCO
#AUX_LIBS= -lPW -lsocket -lmalloc -lcrypt_i
# For SCO OpenServer Release 5
#AUX_CFLAGS= -DSCO5
#AUX_LIBS=-lsocket -lmalloc -lprot
# For SVR4
+ # Some SVR4 implementations will require SO_LINGER option to be set in order
+ # to guarantee buffer flushes. Dell, Esix, and UnixWare are a few of these.
+ # Use -DNEED_LINGER in addition to other AUX_CFLAGS for these.
#AUX_CFLAGS= -DSVR4
#AUX_LIBS= -lsocket -lnsl -lc
# For UnixWare 2.x, no longer just SVR4 (sigh) - use cc, not gcc
! #AUX_LIBS= -lsocket -lnsl -lcrypt
# For Amdahl UTS 2.1
# -Xa enables ANSI mode, -eft is expanded types
#AUX_CFLAGS= -Xa -eft -DUTS21
*** ../src.bak/http_main.c Wed May 22 15:00:14 1996
--- http_main.c Sun May 26 19:12:10 1996
***************
*** 1284,1299 ****
if((setsockopt(s, SOL_SOCKET,SO_REUSEADDR,(char *)&one,sizeof(one)))
== -1) {
! perror("setsockopt");
! fprintf(stderr,"httpd: could not set socket option\n");
exit(1);
}
if((setsockopt(s, SOL_SOCKET,SO_KEEPALIVE,(char *)&keepalive_value,
sizeof(keepalive_value))) == -1) {
! perror("setsockopt");
fprintf(stderr,"httpd: could not set socket option SO_KEEPALIVE\n");
exit(1);
}
if(bind(s, (struct sockaddr *)server,sizeof(struct sockaddr_in)) == -1)
{
--- 1284,1314 ----
if((setsockopt(s, SOL_SOCKET,SO_REUSEADDR,(char *)&one,sizeof(one)))
== -1) {
! perror("setsockopt(SO_REUSEADDR)");
! fprintf(stderr,"httpd: could not set socket option SO_REUSEADDR\n");
exit(1);
}
if((setsockopt(s, SOL_SOCKET,SO_KEEPALIVE,(char *)&keepalive_value,
sizeof(keepalive_value))) == -1) {
! perror("setsockopt(SO_KEEPALIVE)");
fprintf(stderr,"httpd: could not set socket option SO_KEEPALIVE\n");
exit(1);
}
+
+ #ifdef NEED_LINGER /* If puts don't complete, you could try this. */
+ {
+ struct linger li;
+ li.l_onoff = 1;
+ li.l_linger = 900;
+
+ if (setsockopt(s, SOL_SOCKET, SO_LINGER,
+ (char *)&li, sizeof(struct linger)) < 0) {
+ perror("setsockopt(SO_LINGER)");
+ fprintf(stderr,"httpd: could not set socket option SO_LINGER\n");
+ exit(1);
+ }
+ }
+ #endif /* NEED_LINGER */
if(bind(s, (struct sockaddr *)server,sizeof(struct sockaddr_in)) == -1)
{
chuck
Chuck Murcko N2K Inc. Wayne PA chuck@telebase.com
And now, on a lighter note:
A language that doesn't have everything is actually easier to program
in than some that do.
-- Dennis M. Ritchie