diff options
author | ng0 <ng0@n0.is> | 2019-07-24 15:05:51 +0000 |
---|---|---|
committer | ng0 <ng0@n0.is> | 2019-07-24 15:05:51 +0000 |
commit | 51cfb23f17b55708fb569b46df90914e70b5a077 (patch) | |
tree | f330b2edcfa167069ebdf38c1e5bc91202446266 | |
parent | 3d6e8187a816d1e5f1617604b090c220d5cd4ea5 (diff) | |
download | libmicrohttpd-51cfb23f17b55708fb569b46df90914e70b5a077.tar.gz libmicrohttpd-51cfb23f17b55708fb569b46df90914e70b5a077.zip |
first attempt to add MHD_send_on_connection2_
-rw-r--r-- | src/microhttpd/connection.c | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c index 3275a3d5..b09425b4 100644 --- a/src/microhttpd/connection.c +++ b/src/microhttpd/connection.c | |||
@@ -3408,20 +3408,26 @@ MHD_connection_handle_write (struct MHD_Connection *connection) | |||
3408 | mhd_assert (0); | 3408 | mhd_assert (0); |
3409 | return; | 3409 | return; |
3410 | case MHD_CONNECTION_HEADERS_SENDING: | 3410 | case MHD_CONNECTION_HEADERS_SENDING: |
3411 | /* TODO: Maybe use MHD_send_on_connection2_()? */ | 3411 | /* if the response body is not available, we use MHD_send_on_connection_() */ |
3412 | /* | 3412 | if (sizeof(connection->response->data) <= 1024) /* bad magic number */ |
3413 | ret = MHD_send_on_connection2_ (struct MHD_Connection *connection, | 3413 | { |
3414 | const char *header, | 3414 | ret = MHD_send_on_connection_ (connection, |
3415 | size_t header_size, | 3415 | &connection->write_buffer |
3416 | const char *buffer, | 3416 | [connection->write_buffer_send_offset], |
3417 | size_t buffer_size); | 3417 | connection->write_buffer_append_offset - |
3418 | */ | 3418 | connection->write_buffer_send_offset, |
3419 | ret = MHD_send_on_connection_ (connection, | 3419 | MHD_SSO_MAY_CORK); |
3420 | &connection->write_buffer | 3420 | } |
3421 | [connection->write_buffer_send_offset], | 3421 | else |
3422 | connection->write_buffer_append_offset - | 3422 | { |
3423 | connection->write_buffer_send_offset, | 3423 | ret = MHD_send_on_connection2_ (connection, |
3424 | MHD_SSO_MAY_CORK); | 3424 | &connection->write_buffer |
3425 | [connection->write_buffer_send_offset], | ||
3426 | connection->write_buffer_append_offset - | ||
3427 | connection->write_buffer_send_offset, | ||
3428 | response_body, | ||
3429 | response_size); | ||
3430 | } | ||
3425 | 3431 | ||
3426 | if (ret < 0) | 3432 | if (ret < 0) |
3427 | { | 3433 | { |