libmicrohttpd
[Top][All Lists]
Advanced

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

[libmicrohttpd] Missing Connection close header


From: louisbenoit
Subject: [libmicrohttpd] Missing Connection close header
Date: Fri, 10 Apr 2015 11:21:49 -0400

Hi,

There is a change of behavior between 0.9.37 and 0.9.38.
When a client adds a "Connection: close" header in 0.9.37, MHD adds a "Connection: close" header to its response and then
close the connection (as suggested in rfc2616, section 8.1.2.1).
The "Connection: close" header is not added in 0.9.38.
I looked into the 0.9.38 code and the code that prevents the inclusion of the "Connection: close" header is at line 773 of connection.c.
      if ( ( (NULL != client_requested_close) ||
             (MHD_YES == connection->read_closed) ) &&
           (NULL == response_has_close) &&
           (0 != (connection->response->flags & MHD_RF_HTTP_VERSION_1_0_ONLY) ) )
        must_add_close = MHD_YES;

Shouldn't it read
      if ( ( (NULL != client_requested_close) ||
             (MHD_YES == connection->read_closed) ||
              (0 != (connection->response->flags & MHD_RF_HTTP_VERSION_1_0_ONLY) ) ) &&
           (NULL == response_has_close) )
        must_add_close = MHD_YES;

Thanks,

Louis Benoit
reply via email to

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