diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2017-06-05 23:06:00 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2017-06-05 23:48:06 +0300 |
commit | 460745c1ebb242e5f38bcafa1d598628c7b859c0 (patch) | |
tree | 4b7c12bfab6762a21b7983616db41e83ff9267d9 /src/microhttpd/connection.c | |
parent | 237330045b9085a75aeaee94d8d274ec9cecb9fd (diff) | |
download | libmicrohttpd-460745c1ebb242e5f38bcafa1d598628c7b859c0.tar.gz libmicrohttpd-460745c1ebb242e5f38bcafa1d598628c7b859c0.zip |
MHD_connection_handle_read(): changed return type to void as return value is not used
Functionality is unchanged.
Diffstat (limited to 'src/microhttpd/connection.c')
-rw-r--r-- | src/microhttpd/connection.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c index 1833b060..19e6f24c 100644 --- a/src/microhttpd/connection.c +++ b/src/microhttpd/connection.c | |||
@@ -2656,24 +2656,22 @@ MHD_update_last_activity_ (struct MHD_Connection *connection) | |||
2656 | * determined that there is data to be read off a socket. | 2656 | * determined that there is data to be read off a socket. |
2657 | * | 2657 | * |
2658 | * @param connection connection to handle | 2658 | * @param connection connection to handle |
2659 | * @return always #MHD_YES (we should continue to process the | ||
2660 | * connection) | ||
2661 | */ | 2659 | */ |
2662 | int | 2660 | void |
2663 | MHD_connection_handle_read (struct MHD_Connection *connection) | 2661 | MHD_connection_handle_read (struct MHD_Connection *connection) |
2664 | { | 2662 | { |
2665 | ssize_t bytes_read; | 2663 | ssize_t bytes_read; |
2666 | 2664 | ||
2667 | if ( (MHD_CONNECTION_CLOSED == connection->state) || | 2665 | if ( (MHD_CONNECTION_CLOSED == connection->state) || |
2668 | (connection->suspended) ) | 2666 | (connection->suspended) ) |
2669 | return MHD_YES; | 2667 | return; |
2670 | #ifdef HTTPS_SUPPORT | 2668 | #ifdef HTTPS_SUPPORT |
2671 | if (MHD_TLS_CONN_NO_TLS != connection->tls_state) | 2669 | if (MHD_TLS_CONN_NO_TLS != connection->tls_state) |
2672 | { /* HTTPS connection. */ | 2670 | { /* HTTPS connection. */ |
2673 | if (MHD_TLS_CONN_CONNECTED > connection->tls_state) | 2671 | if (MHD_TLS_CONN_CONNECTED > connection->tls_state) |
2674 | { | 2672 | { |
2675 | if (!MHD_run_tls_handshake_ (connection)) | 2673 | if (!MHD_run_tls_handshake_ (connection)) |
2676 | return MHD_YES; | 2674 | return; |
2677 | } | 2675 | } |
2678 | } | 2676 | } |
2679 | #endif /* HTTPS_SUPPORT */ | 2677 | #endif /* HTTPS_SUPPORT */ |
@@ -2685,7 +2683,7 @@ MHD_connection_handle_read (struct MHD_Connection *connection) | |||
2685 | try_grow_read_buffer (connection); | 2683 | try_grow_read_buffer (connection); |
2686 | 2684 | ||
2687 | if (connection->read_buffer_size == connection->read_buffer_offset) | 2685 | if (connection->read_buffer_size == connection->read_buffer_offset) |
2688 | return MHD_YES; /* No space for receiving data. */ | 2686 | return; /* No space for receiving data. */ |
2689 | bytes_read = connection->recv_cls (connection, | 2687 | bytes_read = connection->recv_cls (connection, |
2690 | &connection->read_buffer | 2688 | &connection->read_buffer |
2691 | [connection->read_buffer_offset], | 2689 | [connection->read_buffer_offset], |
@@ -2694,20 +2692,20 @@ MHD_connection_handle_read (struct MHD_Connection *connection) | |||
2694 | if (bytes_read < 0) | 2692 | if (bytes_read < 0) |
2695 | { | 2693 | { |
2696 | if (MHD_ERR_AGAIN_ == bytes_read) | 2694 | if (MHD_ERR_AGAIN_ == bytes_read) |
2697 | return MHD_YES; /* No new data to process. */ | 2695 | return; /* No new data to process. */ |
2698 | if (MHD_ERR_CONNRESET_ == bytes_read) | 2696 | if (MHD_ERR_CONNRESET_ == bytes_read) |
2699 | { | 2697 | { |
2700 | CONNECTION_CLOSE_ERROR (connection, | 2698 | CONNECTION_CLOSE_ERROR (connection, |
2701 | (MHD_CONNECTION_INIT == connection->state) ? | 2699 | (MHD_CONNECTION_INIT == connection->state) ? |
2702 | NULL : | 2700 | NULL : |
2703 | _("Socket is unexpectedly disconnected when reading request.\n")); | 2701 | _("Socket is unexpectedly disconnected when reading request.\n")); |
2704 | return MHD_NO; | 2702 | return; |
2705 | } | 2703 | } |
2706 | CONNECTION_CLOSE_ERROR (connection, | 2704 | CONNECTION_CLOSE_ERROR (connection, |
2707 | (MHD_CONNECTION_INIT == connection->state) ? | 2705 | (MHD_CONNECTION_INIT == connection->state) ? |
2708 | NULL : | 2706 | NULL : |
2709 | _("Connection socket is closed due to unexpected error when reading request.\n")); | 2707 | _("Connection socket is closed due to unexpected error when reading request.\n")); |
2710 | return MHD_YES; | 2708 | return; |
2711 | } | 2709 | } |
2712 | 2710 | ||
2713 | if (0 == bytes_read) | 2711 | if (0 == bytes_read) |
@@ -2715,7 +2713,7 @@ MHD_connection_handle_read (struct MHD_Connection *connection) | |||
2715 | connection->read_closed = true; | 2713 | connection->read_closed = true; |
2716 | MHD_connection_close_ (connection, | 2714 | MHD_connection_close_ (connection, |
2717 | MHD_REQUEST_TERMINATED_CLIENT_ABORT); | 2715 | MHD_REQUEST_TERMINATED_CLIENT_ABORT); |
2718 | return MHD_YES; | 2716 | return; |
2719 | } | 2717 | } |
2720 | connection->read_buffer_offset += bytes_read; | 2718 | connection->read_buffer_offset += bytes_read; |
2721 | MHD_update_last_activity_ (connection); | 2719 | MHD_update_last_activity_ (connection); |
@@ -2747,7 +2745,7 @@ MHD_connection_handle_read (struct MHD_Connection *connection) | |||
2747 | } | 2745 | } |
2748 | break; | 2746 | break; |
2749 | case MHD_CONNECTION_CLOSED: | 2747 | case MHD_CONNECTION_CLOSED: |
2750 | return MHD_YES; | 2748 | return; |
2751 | #ifdef UPGRADE_SUPPORT | 2749 | #ifdef UPGRADE_SUPPORT |
2752 | case MHD_CONNECTION_UPGRADE: | 2750 | case MHD_CONNECTION_UPGRADE: |
2753 | EXTRA_CHECK (0); | 2751 | EXTRA_CHECK (0); |
@@ -2763,7 +2761,7 @@ MHD_connection_handle_read (struct MHD_Connection *connection) | |||
2763 | } | 2761 | } |
2764 | break; | 2762 | break; |
2765 | } | 2763 | } |
2766 | return MHD_YES; | 2764 | return; |
2767 | } | 2765 | } |
2768 | 2766 | ||
2769 | 2767 | ||