sks-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re: [Sks-devel] SKS, Content-Length and HEAD requests


From: Johan van Selst
Subject: Re: Re: [Sks-devel] SKS, Content-Length and HEAD requests
Date: Tue, 2 Nov 2010 22:57:08 +0100
User-agent: Mutt/1.5.19 (2009-01-14)

Marian Kechlibar wrote:
> the modification with limit is good. This could be easy and
> straightforward.
> I would still very much like Content-Length to be present in the header.
> This makes things so much easier on a slow network.

This should be simple enough to add. Something like the patch below
might do the trick.


Johan

--- a/wserver.ml        2010-11-02 22:52:40.766457000 +0100
+++ b/wserver.ml        2010-11-02 22:54:47.593314000 +0100
@@ -239,6 +239,7 @@
 let send_result cout ?(error_code = 200) ?(content_type = "text/html; 
charset=UTF-8") body =
   fprintf cout "HTTP/1.0 %03d OK\r\n" error_code;
   fprintf cout "Server: sks_www/%s\r\n" version;
+  fprintf cout "Content-length: %u\r\n" (String.length body + 2);
   fprintf cout "Content-type: %s\r\n\r\n" content_type;
   fprintf cout "%s\r\n" body;
   flush cout

Attachment: pgp9qpK50s3E3.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]