Fossil

Check-in [f6a071cef1]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Omit the Content-Length header line from the CGI response under windows because subsequent \n to \r\n translations by Apache will change the content length. But keep the Content-Length header line for the built-in servers and under unix. Ticket [c62fac40af0].
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: f6a071cef15eef95fb2d8a896989a39ec46d8024
User & Date: drh 2008-11-18 02:21:00.000
References
2008-11-20
00:36 Fixed ticket [c62fac40af]: Edit CSS/HTML in Setup adds extra CR/LF, wrong http Content-length plus 1 other change artifact: e3d3a3ce3f user: drh
2008-11-18
23:09 New ticket [1dd22c3a2b] Setup : CSS : Edit CSS misses 'Revert To Default' button. artifact: 2733592b04 user: anonymous
02:28 Fixed ticket [c62fac40af]: Edit CSS/HTML in Setup adds extra CR/LF, wrong http Content-length plus 2 other changes artifact: f28d6d6bb9 user: drh
Context
2008-11-18
12:19
Show the "Files" menu option on the "home" page when the "h" privilege is enabled. check-in: bdde7ddcc8 user: drh tags: trunk
02:21
Omit the Content-Length header line from the CGI response under windows because subsequent \n to \r\n translations by Apache will change the content length. But keep the Content-Length header line for the built-in servers and under unix. Ticket [c62fac40af0]. check-in: f6a071cef1 user: drh tags: trunk
2008-11-17
19:21
Setting the "pgp-clearsign" command to "off" disables clearsigning. check-in: 86cee3d082 user: drh tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/cgi.c.
334
335
336
337
338
339
340








341








342
343
344
345
346
347
348
  if( strcmp(zContentType,"application/x-fossil")==0 ){
    cgi_combine_header_and_body();
    blob_compress(&cgiContent[0], &cgiContent[0]);
  }

  if( iReplyStatus != 304 ) {
    total_size = blob_size(&cgiContent[0]) + blob_size(&cgiContent[1]);








    fprintf(g.httpOut, "Content-Length: %d\r\n", total_size);








  }
  fprintf(g.httpOut, "\r\n");
  if( total_size>0 && iReplyStatus != 304 ){
    int i, size;
    for(i=0; i<2; i++){
      size = blob_size(&cgiContent[i]);
      if( size>0 ){







>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>







334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
  if( strcmp(zContentType,"application/x-fossil")==0 ){
    cgi_combine_header_and_body();
    blob_compress(&cgiContent[0], &cgiContent[0]);
  }

  if( iReplyStatus != 304 ) {
    total_size = blob_size(&cgiContent[0]) + blob_size(&cgiContent[1]);
#ifdef __MINGW32__
    /* In windows versions of Apache, extra \r characters get added to the
    ** response, which mess up the Content-Length.  So let apache figure
    ** out the content length for itself if we are using CGI.  If this
    ** is a complete stand-alone webserver, on the other hand, we still
    ** need the Content-Length.
    */
    if( g.fullHttpReply ){
      fprintf(g.httpOut, "Content-Length: %d\r\n", total_size);
    }
#else
    /* On unix, \n to \r\n translation is never a problem.  We know the
    ** content length, so we might as well go ahead and tell the webserver
    ** what it is in all cases.
    */
    fprintf(g.httpOut, "Content-Length: %d\r\n", total_size);
#endif
  }
  fprintf(g.httpOut, "\r\n");
  if( total_size>0 && iReplyStatus != 304 ){
    int i, size;
    for(i=0; i<2; i++){
      size = blob_size(&cgiContent[i]);
      if( size>0 ){