tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
* SUMMARY: Weird behaviour of our HTTP-daemon
@ 1996-03-13 19:00 Erik Sundermann
  0 siblings, 0 replies; only message in thread
From: Erik Sundermann @ 1996-03-13 19:00 UTC (permalink / raw)
  To: tru64-unix-managers


My original question:

> We are using the CERN HTTP-daemon (version 3.0). Everything works fine
> for normal HTML-files, images, etc ... However, if somebody tries to
> execute a cgi-bin script on our machine, 2 times out of 3 you get a
> correct result, and sometimes you get a "Document contains no data"
> error message.
>
> ...
>
> Can anyone shed some light on this, or even point me to the
> people/mailing-list/newsgroup that might be able to help me ...

As it turned out, this list wasn't the wrong place to ask after all,
since the promblem seems to be a specific bug under OSF/1 3.0.

The problem seems to arise when the script exits. The problem is know
to CERN and a patch is available under ..
   http://www.w3.org/hypertext/WWW/Daemon/User/Patch/
The patch just adds a 'sleep (1);' statement. However, this still
seems to cause problems, so I applied the following piece of code,
provided by Chris Dalton <cid@hplb.hpl.hp.com> and recompiled.

 > Here's a "diff HTScript.c HTScript.c.orig":
 > 
 > 202,229c202
 > < #ifndef Original
 > <       int status;
 > <       /*
 > <               Modified by C.I.Dalton (cid@bangor.ac.uk) - Feb 96
 > <
 > <               Surround the call to fread with sighold/sigrelse. If we
 > <               get a signal when executing the fread system call and we
 > <               haven't yet read any data, the fread will return straight
 > <               away (man read).
 > <               Since we forked a child to execute the cgi script,
 > <               we will get notified when that child exits (via a SIGCHLD
 > <               signal).  If we get this child termination signal
 > <               before the parent process (below) has chance to read
 > <               any data from its output (but has started the fread call),
 > <               the fread call will return without bringing us any data.
 > <               Hence we get a "Document contains no data" message in
 > <               Netscape, for example.
 > <       */
 > <
 > <       sighold(SIGCHLD);
 > <       status = fread(input_buffer, 1, INPUT_BUFFER_SIZE, fp);
 > <       sigrelse(SIGCHLD);
 > <
 > < #else /* Original */
 > <
 > <       int status = fread(input_buffer, 1, INPUT_BUFFER_SIZE,fp);
 > <
 > < #endif        /* Original */
 > - ---
 > >       int status = fread(input_buffer, 1, INPUT_BUFFER_SIZE, fp);
 > 
 > After applying this fix I haven't had any problems with cgi scripts on
 > the OSF1 box.

Neither have I (so far). Some other solutions and workarounds were
suggested, but I didn't try them.

Thanks to:
   Chris Dalton     <cid@hplb.hpl.hp.com>
   Gyula Szemenyei  <szemgy@rkk.hu>
   <igb@axnd22.cern.ch>
   Michael Matthews <matthewm@sgate.com>
   Randy M. Hayman  <haymanr@icefog.sois.alaska.edu>
   Harald Mayer     <mayer@piis05.joanneum.ac.at>

Erik

                                                      ,,,              
Erik Sundermann                                      (0 0)             
MEDISIP Group - University of Ghent      +-----oOO----(_)------------+ 
Sint-Pietersnieuwstraat 41	         | You know how Einstein got | 
B-9000 Ghent - Belgium		         | bad grades as a kid ?     | 
				         | Well, mine are even worse |  
tel  : +32-9-264.66.19		         |                  (Calvin) |  
fax  : +32-9-264.35.94		         +-------------------oOO-----+  
				                    |__|__|             
email: Erik.Sundermann@rug.ac.be                     || ||             
WWW  : http://petaxp.rug.ac.be/~erik                ooO Ooo            

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1996-03-13 19:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-03-13 19:00 SUMMARY: Weird behaviour of our HTTP-daemon Erik Sundermann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox