Return-Path: Delivered-To: apache-bugdb-archive@hyperreal.org Received: (qmail 26300 invoked by uid 6000); 16 Jan 1999 12:20:13 -0000 Received: (qmail 25914 invoked by uid 2001); 16 Jan 1999 12:20:02 -0000 Received: (qmail 25793 invoked by uid 2012); 16 Jan 1999 12:19:01 -0000 Message-Id: <19990116121901.25792.qmail@hyperreal.org> Date: 16 Jan 1999 12:19:01 -0000 From: John Volanthen Reply-To: john@jft.co.uk To: apbugs@hyperreal.org X-Send-Pr-Version: 3.2 Subject: mod_cgi/3689: Multipart mime messages cannot be read properly on NT / Win32 Sender: apache-bugdb-owner@apache.org Precedence: bulk >Number: 3689 >Category: mod_cgi >Synopsis: Multipart mime messages cannot be read properly on NT / Win32 >Confidential: no >Severity: non-critical >Priority: medium >Responsible: apache >State: open >Class: sw-bug >Submitter-Id: apache >Arrival-Date: Sat Jan 16 04:20:01 PST 1999 >Last-Modified: >Originator: john@jft.co.uk >Organization: apache >Release: 1.3.4 >Environment: NT4 SP3, pre-compiled binary >Description: I am porting a ".c" CGI program from Linux to Win32, things work OK on Linux, but on Win32 (using standard CGI). I am using multipart mime to send 2 files to the CGI program. when I send more than about 64Kb of data The "connection reset by peer "message is displayed on the browser. When sending to the same program on Linux all works OK. If I send about 20Kb of data, the number of bytes I am able to read is always less than the CONTENT_LENGTH variable indicates. This happens for all browsers I have tried Tried >How-To-Repeat: CODE FRAGMENT : /******************************** ReadInData *********************************/ void ReadInData() { char Buffer[1024]; /* input buffer */ char delimeter[255]; /* the delimeter */ int delLength; /* length of delimeter */ char contentInfo[255]; /* the content info string */ char name[255]; /* Name of the current item */ int i,j; char *ptmp; int dataSize; /* size of data in 1k blocks */ int ContentLength; int ActuallyRead; ptmp = getenv("CONTENT_TYPE"); /* get and verify the content type */ if (!ptmp){ SEND_HTTP_HEADERS; printf("%s",INITIAL); fatal(54,0,TRUE); } if(!strstr(ptmp,"multipart")){ SEND_HTTP_HEADERS; printf("%s",INITIAL); fatal(54,0,TRUE); } ptmp = getenv("CONTENT_LENGTH"); /* get and verify the content length */ if (!ptmp){ SEND_HTTP_HEADERS; printf("%s",INITIAL); fatal(54,0,TRUE); } ContentLength = atoi(ptmp); if (ContentLength ==0){ SEND_HTTP_HEADERS; printf("%s",INITIAL); fatal(54,0,TRUE); } printf("Expecting %d
\n",ContentLength); ptmp = (char *)malloc (1 + (ContentLength)); if (!ptmp){ SEND_HTTP_HEADERS; printf("%s",INITIAL); /* USE xmalloc here TODO */ fatal(100,0,TRUE); } ActuallyRead = read (fileno (stdin), ptmp, ContentLength); ptmp[ActuallyRead] = '\0'; printf("Actually Read %d
\n",ActuallyRead); printf("%s",ptmp); return; } >Fix: No Idea, sorry .... >Audit-Trail: >Unformatted: [In order for any reply to be added to the PR database, ] [you need to include in the Cc line ] [and leave the subject line UNCHANGED. This is not done] [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! ]