Changeset 5897

Show
Ignore:
Timestamp:
03/21/10 04:46:03 (3 years ago)
Author:
jow
Message:

uhttpd: add "Connection: close" headers, mandatory according to HTTP/1.1 spec

Location:
luci/trunk/contrib/package/uhttpd/src
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • luci/trunk/contrib/package/uhttpd/src/uhttpd-cgi.c

    r5895 r5897  
    431431                                    /* write status */ 
    432432                                    ensure(uh_http_sendf(cl, NULL, 
    433                                         "HTTP/%.1f %03d %s\r\n", 
     433                                        "HTTP/%.1f %03d %s\r\n" 
     434                                        "Connection: close\r\n", 
    434435                                        req->version, res->statuscode, 
    435436                                        res->statusmsg)); 
  • luci/trunk/contrib/package/uhttpd/src/uhttpd-file.c

    r5895 r5897  
    102102static void uh_file_response_ok_hdrs(struct client *cl, struct http_request *req, struct stat *s) 
    103103{ 
     104    uh_http_sendf(cl, NULL, "Connection: close\r\n"); 
     105 
    104106    if( s ) 
    105107    { 
     
    125127static void uh_file_response_412(struct client *cl, struct http_request *req) 
    126128{ 
    127     uh_http_sendf(cl, NULL, "HTTP/%.1f 412 Precondition Failed\r\n", 
    128         req->version); 
     129    uh_http_sendf(cl, NULL, 
     130        "HTTP/%.1f 412 Precondition Failed\r\n" 
     131        "Connection: close\r\n", req->version); 
    129132} 
    130133 
  • luci/trunk/contrib/package/uhttpd/src/uhttpd-utils.c

    r5893 r5897  
    172172    len = snprintf(buffer, sizeof(buffer), 
    173173        "HTTP/1.1 %03i %s\r\n" 
     174        "Connection: close\r\n" 
    174175        "Content-Type: text/plain\r\n" 
    175176        "Transfer-Encoding: chunked\r\n\r\n",