chuck 96/05/27 20:02:32
Modified: src Configuration.tmpl http_main.c
Log:
Obtained from: Kimmo Suominen <[EMAIL PROTECTED]>
This change allows setting SO_LINGER socket option for SVR4s with
broken socket libs using -DNEED_LINGER
Revision Changes Path
1.16 +3 -1 apache/src/Configuration.tmpl
Index: Configuration.tmpl
===================================================================
RCS file: /export/home/cvs/apache/src/Configuration.tmpl,v
retrieving revision 1.15
retrieving revision 1.16
diff -C3 -r1.15 -r1.16
*** Configuration.tmpl 1996/05/27 22:34:05 1.15
--- Configuration.tmpl 1996/05/28 03:02:29 1.16
***************
*** 108,117 ****
#AUX_LIBS=-lsocket -lmalloc -lprot
#BROKEN_BPRINTF_FLAGS=-K noinline
# 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
--- 108,119 ----
#AUX_LIBS=-lsocket -lmalloc -lprot
#BROKEN_BPRINTF_FLAGS=-K noinline
# 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
1.29 +18 -3 apache/src/http_main.c
Index: http_main.c
===================================================================
RCS file: /export/home/cvs/apache/src/http_main.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -C3 -r1.28 -r1.29
*** http_main.c 1996/05/22 17:35:36 1.28
--- http_main.c 1996/05/28 03:02:30 1.29
***************
*** 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)
{