diff options
Diffstat (limited to 'src/lib/connection_call_handlers.c')
-rw-r--r-- | src/lib/connection_call_handlers.c | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/src/lib/connection_call_handlers.c b/src/lib/connection_call_handlers.c index c4fb448e..148e6345 100644 --- a/src/lib/connection_call_handlers.c +++ b/src/lib/connection_call_handlers.c | |||
@@ -146,9 +146,10 @@ MHD_conn_init_static_ (void) | |||
146 | } | 146 | } |
147 | #endif /* SF_FLAGS */ | 147 | #endif /* SF_FLAGS */ |
148 | } | 148 | } |
149 | #endif /* HAVE_FREEBSD_SENDFILE */ | ||
150 | 149 | ||
151 | 150 | ||
151 | #endif /* HAVE_FREEBSD_SENDFILE */ | ||
152 | |||
152 | 153 | ||
153 | /** | 154 | /** |
154 | * Message to transmit when http 1.1 request is received | 155 | * Message to transmit when http 1.1 request is received |
@@ -439,8 +440,7 @@ sendfile_adapter (struct MHD_Connection *connection) | |||
439 | supported for FD or other 'unusual' errors occurred, so we should try | 440 | supported for FD or other 'unusual' errors occurred, so we should try |
440 | to fall back to 'SEND'; see also this thread for info on | 441 | to fall back to 'SEND'; see also this thread for info on |
441 | odd libc/Linux behavior with sendfile: | 442 | odd libc/Linux behavior with sendfile: |
442 | http://lists.gnu.org/archive/html/libmicrohttpd/2011-02/msg00015.html */ | 443 | http://lists.gnu.org/archive/html/libmicrohttpd/2011-02/msg00015.html */request->resp_sender = MHD_resp_sender_std; |
443 | request->resp_sender = MHD_resp_sender_std; | ||
444 | return MHD_ERR_AGAIN_; | 444 | return MHD_ERR_AGAIN_; |
445 | #else /* HAVE_SOLARIS_SENDFILE */ | 445 | #else /* HAVE_SOLARIS_SENDFILE */ |
446 | if ( (EAFNOSUPPORT == err) || | 446 | if ( (EAFNOSUPPORT == err) || |
@@ -534,6 +534,8 @@ sendfile_adapter (struct MHD_Connection *connection) | |||
534 | #endif /* HAVE_FREEBSD_SENDFILE */ | 534 | #endif /* HAVE_FREEBSD_SENDFILE */ |
535 | return ret; | 535 | return ret; |
536 | } | 536 | } |
537 | |||
538 | |||
537 | #endif /* _MHD_HAVE_SENDFILE */ | 539 | #endif /* _MHD_HAVE_SENDFILE */ |
538 | 540 | ||
539 | 541 | ||
@@ -694,7 +696,7 @@ try_ready_chunked_body (struct MHD_Request *request) | |||
694 | = (size_t) (request->response_write_position - response->data_start); | 696 | = (size_t) (request->response_write_position - response->data_start); |
695 | /* buffer already ready, use what is there for the chunk */ | 697 | /* buffer already ready, use what is there for the chunk */ |
696 | ret = response->data_size - data_write_offset; | 698 | ret = response->data_size - data_write_offset; |
697 | if ( ((size_t) ret) > request->write_buffer_size - sizeof (cbuf) - 2 ) | 699 | if ( ((size_t) ret) > request->write_buffer_size - sizeof (cbuf) - 2) |
698 | ret = request->write_buffer_size - sizeof (cbuf) - 2; | 700 | ret = request->write_buffer_size - sizeof (cbuf) - 2; |
699 | memcpy (&request->write_buffer[sizeof (cbuf)], | 701 | memcpy (&request->write_buffer[sizeof (cbuf)], |
700 | &response->data[data_write_offset], | 702 | &response->data[data_write_offset], |
@@ -1434,8 +1436,7 @@ build_header_response (struct MHD_Request *request) | |||
1434 | 1436 | ||
1435 | Note that the change from 'SHOULD NOT' to 'MUST NOT' is | 1437 | Note that the change from 'SHOULD NOT' to 'MUST NOT' is |
1436 | a recent development of the HTTP 1.1 specification. | 1438 | a recent development of the HTTP 1.1 specification. |
1437 | */ | 1439 | */content_length_len |
1438 | content_length_len | ||
1439 | = MHD_snprintf_ (content_length_buf, | 1440 | = MHD_snprintf_ (content_length_buf, |
1440 | sizeof (content_length_buf), | 1441 | sizeof (content_length_buf), |
1441 | MHD_HTTP_HEADER_CONTENT_LENGTH ": " | 1442 | MHD_HTTP_HEADER_CONTENT_LENGTH ": " |
@@ -1926,8 +1927,7 @@ process_header_line (struct MHD_Request *request, | |||
1926 | header at the beginning of the while | 1927 | header at the beginning of the while |
1927 | loop since we need to be able to inspect | 1928 | loop since we need to be able to inspect |
1928 | the *next* header line (in case it starts | 1929 | the *next* header line (in case it starts |
1929 | with a space...) */ | 1930 | with a space...) */request->last = line; |
1930 | request->last = line; | ||
1931 | request->colon = colon; | 1931 | request->colon = colon; |
1932 | return true; | 1932 | return true; |
1933 | } | 1933 | } |
@@ -1975,8 +1975,7 @@ process_broken_line (struct MHD_Request *request, | |||
1975 | adjacency); also, in the case where these are not adjacent | 1975 | adjacency); also, in the case where these are not adjacent |
1976 | (not sure how it can happen!), we would want to allocate from | 1976 | (not sure how it can happen!), we would want to allocate from |
1977 | the end of the pool, so as to not destroy the read-buffer's | 1977 | the end of the pool, so as to not destroy the read-buffer's |
1978 | ability to grow nicely. */ | 1978 | ability to grow nicely. */last = MHD_pool_reallocate (connection->pool, |
1979 | last = MHD_pool_reallocate (connection->pool, | ||
1980 | last, | 1979 | last, |
1981 | last_len + 1, | 1980 | last_len + 1, |
1982 | last_len + tmp_len + 1); | 1981 | last_len + tmp_len + 1); |
@@ -2926,6 +2925,8 @@ connection_epoll_update_ (struct MHD_Connection *connection) | |||
2926 | } | 2925 | } |
2927 | return true; | 2926 | return true; |
2928 | } | 2927 | } |
2928 | |||
2929 | |||
2929 | #endif | 2930 | #endif |
2930 | 2931 | ||
2931 | 2932 | ||
@@ -3014,8 +3015,7 @@ connection_update_event_loop_info (struct MHD_Connection *connection) | |||
3014 | or if we do nothing, we would just timeout | 3015 | or if we do nothing, we would just timeout |
3015 | on the connection (if a timeout is even set!). | 3016 | on the connection (if a timeout is even set!). |
3016 | 3017 | ||
3017 | Solution: we kill the connection with an error */ | 3018 | Solution: we kill the connection with an error */transmit_error_response (request, |
3018 | transmit_error_response (request, | ||
3019 | MHD_SC_APPLICATION_HUNG_CONNECTION_CLOSED, | 3019 | MHD_SC_APPLICATION_HUNG_CONNECTION_CLOSED, |
3020 | MHD_HTTP_INTERNAL_SERVER_ERROR, | 3020 | MHD_HTTP_INTERNAL_SERVER_ERROR, |
3021 | INTERNAL_ERROR); | 3021 | INTERNAL_ERROR); |
@@ -3675,10 +3675,8 @@ MHD_connection_call_handlers_ (struct MHD_Connection *con, | |||
3675 | immediately. | 3675 | immediately. |
3676 | As writeability of socket was not checked and it may have | 3676 | As writeability of socket was not checked and it may have |
3677 | some data pending in system buffers, use this optimization | 3677 | some data pending in system buffers, use this optimization |
3678 | only for non-blocking sockets. */ | 3678 | only for non-blocking sockets. *//* No need to check 'ret' as connection is always in |
3679 | /* No need to check 'ret' as connection is always in | 3679 | * MHD_CONNECTION_CLOSED state if 'ret' is equal 'MHD_NO'. */else if (on_fasttrack && |
3680 | * MHD_CONNECTION_CLOSED state if 'ret' is equal 'MHD_NO'. */ | ||
3681 | else if (on_fasttrack && | ||
3682 | con->sk_nonblck) | 3680 | con->sk_nonblck) |
3683 | { | 3681 | { |
3684 | if (MHD_REQUEST_HEADERS_SENDING == con->request.state) | 3682 | if (MHD_REQUEST_HEADERS_SENDING == con->request.state) |
@@ -3722,4 +3720,5 @@ MHD_connection_call_handlers_ (struct MHD_Connection *con, | |||
3722 | return ret; | 3720 | return ret; |
3723 | } | 3721 | } |
3724 | 3722 | ||
3723 | |||
3725 | /* end of connection_call_handlers.c */ | 3724 | /* end of connection_call_handlers.c */ |