Changeset 1537

Show
Ignore:
Timestamp:
01/28/2007 12:13:31 AM (21 months ago)
Author:
jan
Message:

moved the reset of the content-queue right before we write the content
to the network as all filters might want to know if there was content
and set the Content-Length accordingly.

Location:
trunk/src
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/connections.c

    r1536 r1537  
    333333        } 
    334334 
    335         if (con->request.http_method == HTTP_METHOD_HEAD) { 
    336                 no_response_body = 1; 
    337         } 
    338  
    339335        if (no_response_body) { 
    340336                /* disable chunked encoding again as we have no body */ 
     
    12341230                        } 
    12351231 
     1232                        /* all the response-headers are set, check if we have a */ 
     1233 
    12361234                        connection_set_state(srv, con, CON_STATE_WRITE_RESPONSE_HEADER); 
    12371235 
     
    12421240 
    12431241                        connection_set_state(srv, con, CON_STATE_WRITE_RESPONSE_CONTENT); 
     1242 
     1243                        if (con->request.http_method == HTTP_METHOD_HEAD) { 
     1244                                /* remove the content now */ 
     1245                                chunkqueue_reset(con->send); 
     1246 
     1247                                con->send->is_closed = 1; 
     1248                        } 
    12441249 
    12451250                        break; 
  • trunk/src/mod_chunked.c

    r1503 r1537  
    203203                con->response.content_length = chunkqueue_length(in); 
    204204                use_chunked = 0; 
    205         } else { 
     205        } else if (con->request.http_method != HTTP_METHOD_HEAD) { 
     206                /* a HEAD request never gets a chunk-encoding, but might stay with keep-alive 
     207                 * in case the queue was closed already (above) we still have the content-length */ 
     208                 
    206209                /* we don't know the size of the content yet 
    207210                 * - either enable chunking