Received: (qmail 16863 invoked by uid 65534); 1 Mar 2000 17:45:04 -0000 Message-Id: <20000301174504.16862.qmail@locus.apache.org> Date: 1 Mar 2000 17:45:04 -0000 From: Mark Allman Reply-To: ssppaarrkyy@hotmail.com To: submit@bugz.apache.org Subject: Premature end of script headers - for all gcc compiled programs X-Send-Pr-Version: 3.110 >Number: 5827 >Category: os-windows >Synopsis: 'Unix'ish processes sending raw lf's for headers fail. >Confidential: no >Severity: non-critical >Priority: medium >Responsible: apache >State: suspended >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: apache >Arrival-Date: Wed Mar 01 09:50:00 PST 2000 >Closed-Date: >Last-Modified: Wed May 30 11:38:06 PDT 2001 >Originator: ssppaarrkyy@hotmail.com >Release: Apache 1.3.12 >Organization: >Environment: Win 98, VC 6.0, gcc 2.952 >Description: I have a *very* basic CGI script written in C: ---- #include int main(void) { printf("Content-Type: text/plain\n\n"); printf("Wibble!"); return 0; } ---- The problem is very simple - if I compile this with VC 6.0, and then attempt to execute the script via a web browser/apache, it works, and gives the expected output (Wibble! :o). However, if I compile it using gcc, it gives an internal server error, and the logfiles report "Premature end of script headers". I would think that the executable produced by gcc was faulty, but executing both programs from the command-line gives correct results (the http header, wibble), and it is only when attempting to use the gcc compiled program through apache that it fails. >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: State-Changed-From-To: open-suspended State-Changed-By: wrowe State-Changed-When: Wed May 30 11:38:05 PDT 2001 State-Changed-Why: Suppose this merits a patch. Simply, gcc is printing your header LF LF body, while win32 based apache is looking for CRs as well. Would think the CR's can be made optional. Synopsis-Changed-From: Premature end of script headers - for all gcc compiled programs Synopsis-Changed-To: 'Unix'ish processes sending raw lf's for headers fail. Synopsis-Changed-By: wrowe Synopsis-Changed-When: Wed May 30 11:38:05 PDT 2001 >Unformatted: [In order for any reply to be added to the PR database, you need] [to include in the Cc line and make sure the] [subject line starts with the report component and number, with ] [or without any 'Re:' prefixes (such as "general/1098:" or ] ["Re: general/1098:"). If the subject doesn't match this ] [pattern, your message will be misfiled and ignored. The ] ["apbugs" address is not added to the Cc line of messages from ] [the database automatically because of the potential for mail ] [loops. If you do not include this Cc, your reply may be ig- ] [nored unless you are responding to an explicit request from a ] [developer. Reply only with text; DO NOT SEND ATTACHMENTS! ]