From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96076330121334.tru64-unix-managers.marc@archive.invalid> From: Erik Sundermann Date: Wed, 13 Mar 1996 19:00:49 +0000 To: tru64-unix-managers Subject: SUMMARY: Weird behaviour of our HTTP-daemon X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96076330121334 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 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 Gyula Szemenyei Michael Matthews Randy M. Hayman Harald Mayer 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