Received: by taz.hyperreal.com (8.6.12/8.6.5) id PAA21931; Tue, 7 May 1996 15:41:02 -0700 Received: from arachnet.algroup.co.uk by taz.hyperreal.com (8.6.12/8.6.5) with SMTP id PAA21915; Tue, 7 May 1996 15:40:52 -0700 Received: from heap.ben.algroup.co.uk by arachnet.algroup.co.uk id aa09491; 7 May 96 23:40 BST Received: from gonzo.ben.algroup.co.uk by heap.ben.algroup.co.uk id aa14705; 7 May 96 23:07 BST Subject: Re: UnixWare sockets patch - example To: new-httpd@hyperreal.com Date: Tue, 7 May 1996 23:02:33 +0100 (BST) From: Ben Laurie In-Reply-To: <199605072220.SAA11045@telebase.com.> from "Chuck Murcko" at May 7, 96 06:20:19 pm X-Mailer: ELM [version 2.4 PL24 PGP2] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 4891 Message-ID: <9605072302.aa20421@gonzo.ben.algroup.co.uk> Sender: owner-new-httpd@apache.org Precedence: bulk Reply-To: new-httpd@hyperreal.com Chuck Murcko wrote: > > Ben Laurie liltingly intones: > > > > Chuck Murcko wrote: > > > > > > 2) Imagemap files must contain absolute URLs, with FQDN, etc. for virtual > > > hosts accessed my MSIE and Spry Mosaic. Netscape works OK. > > > > I have MSIE to take home tonight and see if I can track this down on one > of our inside servers. > > > ... > > > > > > 4) Apache signal handling is still weird on some OS (IRIX, UnixWare). > > > SIGTERM doesn't, occasionally. SIGHUP sometimes ends up in server > > > terminating at log rollover time here, under BSDI. Partial work- > > > around is the log rotation util in /support, but that doesn't help > > > when reconfiguring servers. > > > > As I've said before, I suspect that switching to sigaction instead of signal > > may cure this ... shall I work up a patch? > > > By all means! > > > > > > > 5) UnixWare has broken socket library, which requires different options > > > to get working. > > > > Patches? > > > Here's what's come in before (connection abstractions, anyone?): > > Rob forwarded: > > I know this has been discussed. Can someone who knows what > was decided, respond to this user please. I have a horrible suspicion that SCO 5 may need this patch, too. I may try it. Cheers, Ben. > > To: apache-bugs@apache.org > cc: Joseph Urban > Subject: Patch to Apache 1.1b2 > Date: Sat, 27 Apr 1996 20:43:41 -0400 > From: Kimmo Suominen > > ------- =_aaaaaaaaaa0 > Content-Type: text/plain; charset="us-ascii" > Content-ID: <15351.830652000.1@grendel.gw.com> > > Dear Sirs, > > On most SVR4/386 systems based on USL SVR4.0 there is a bug in the STREAMS > implementation of sockets. When a socket is closed, any pending data will > be lost because the STREAMS structures holding the data are destroyed. If > the SO_LINGER option is set on the socket with a long enough time, one can > usually avoid the problem. > > I've attached the necessary patch below. I use it on Dell SVR4 Issue 2.2, > but it is necessary for any issue of Dell SVR4, Esix, early UnixWare and > other USL SVR4.0/386 based systems. > > I'm hoping you would include this patch in the release version of Apache. > I've submitted the same fix for 1.0.3 earlier. I am not using the proxy > module, but if it has outbound sockets created, the same fix is needed in > all those places. I would recommend writing a small function that returns > a socket with all the proper options set, and using that in all modules. > > The Makefile flags I use are: > > AUX_CFLAGS= -DSVR4 -DLINGER > AUX_LIBS= -lsocket -lnsl > > Sincerely, > Kimmo Suominen > > ------- =_aaaaaaaaaa0 > Content-Type: text/plain; charset="us-ascii" > Content-ID: <15351.830652000.2@grendel.gw.com> > Content-Description: Patch to src/http_main.c > > Index: src/http_main.c > =================================================================== > RCS file: /home/grendel/cvs/apache/src/http_main.c,v > retrieving revision 1.1.1.2 > retrieving revision 1.3 > diff -u -r1.1.1.2 -r1.3 > --- http_main.c 1996/04/25 21:45:48 1.1.1.2 > +++ http_main.c 1996/04/25 22:14:03 1.3 > @@ -1240,16 +1240,31 @@ > > if((setsockopt(s, SOL_SOCKET,SO_REUSEADDR,(char *)&one,sizeof(one))) > == -1) { > - perror("setsockopt"); > - fprintf(stderr,"httpd: could not set socket option\n"); > + 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"); > + perror("setsockopt(SO_KEEPALIVE)"); > fprintf(stderr,"httpd: could not set socket option SO_KEEPALIVE\n"); > exit(1); > } > + > +#ifdef 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 /* LINGER */ > > if(bind(s, (struct sockaddr *)server,sizeof(struct sockaddr_in)) == -1) > { > > ------- =_aaaaaaaaaa0-- > > > > chuck > Chuck Murcko N2K Inc. Wayne PA chuck@telebase.com > And now, on a lighter note: > Aleph-null bottles of beer on the wall, > Aleph-null bottles of beer, > You take one down, and pass it around, > Aleph-null bottles of beer on the wall. -- Ben Laurie Phone: +44 (181) 994 6435 Freelance Consultant and Fax: +44 (181) 994 6472 Technical Director Email: ben@algroup.co.uk A.L. Digital Ltd, URL: http://www.algroup.co.uk London, England.