aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/connection.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/microhttpd/connection.c')
-rw-r--r--src/microhttpd/connection.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index 2c799d16..7c0ce674 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -1855,10 +1855,10 @@ do_read (struct MHD_Connection *connection)
1855 connection->read_buffer_offset); 1855 connection->read_buffer_offset);
1856 if (bytes_read < 0) 1856 if (bytes_read < 0)
1857 { 1857 {
1858 const int err = MHD_socket_errno_; 1858 const int err = MHD_socket_get_error_ ();
1859 if ((EINTR == err) || (EAGAIN == err) || (EWOULDBLOCK == err)) 1859 if (MHD_SCKT_ERR_IS_EINTR_ (err) || MHD_SCKT_ERR_IS_EAGAIN_ (err))
1860 return MHD_NO; 1860 return MHD_NO;
1861 if (ECONNRESET == err) 1861 if (MHD_SCKT_ERR_IS_REMOTE_DISCNN_ (err))
1862 { 1862 {
1863 CONNECTION_CLOSE_ERROR (connection, NULL); 1863 CONNECTION_CLOSE_ERROR (connection, NULL);
1864 return MHD_NO; 1864 return MHD_NO;
@@ -1902,8 +1902,8 @@ do_write (struct MHD_Connection *connection)
1902 1902
1903 if (ret < 0) 1903 if (ret < 0)
1904 { 1904 {
1905 const int err = MHD_socket_errno_; 1905 const int err = MHD_socket_get_error_ ();
1906 if ((EINTR == err) || (EAGAIN == err) || (EWOULDBLOCK == err)) 1906 if (MHD_SCKT_ERR_IS_EINTR_ (err) || MHD_SCKT_ERR_IS_EAGAIN_ (err))
1907 return MHD_NO; 1907 return MHD_NO;
1908 CONNECTION_CLOSE_ERROR (connection, NULL); 1908 CONNECTION_CLOSE_ERROR (connection, NULL);
1909 return MHD_YES; 1909 return MHD_YES;
@@ -2276,13 +2276,13 @@ MHD_connection_handle_write (struct MHD_Connection *connection)
2276 connection->continue_message_write_offset); 2276 connection->continue_message_write_offset);
2277 if (ret < 0) 2277 if (ret < 0)
2278 { 2278 {
2279 const int err = MHD_socket_errno_; 2279 const int err = MHD_socket_get_error_ ();
2280 if ((err == EINTR) || (err == EAGAIN) || (EWOULDBLOCK == err)) 2280 if (MHD_SCKT_ERR_IS_EINTR_ (err) || MHD_SCKT_ERR_IS_EAGAIN_ (err))
2281 break; 2281 break;
2282#ifdef HAVE_MESSAGES 2282#ifdef HAVE_MESSAGES
2283 MHD_DLOG (connection->daemon, 2283 MHD_DLOG (connection->daemon,
2284 "Failed to send data: %s\n", 2284 "Failed to send data: %s\n",
2285 MHD_socket_last_strerr_ ()); 2285 MHD_socket_strerr_ (err));
2286#endif 2286#endif
2287 CONNECTION_CLOSE_ERROR (connection, NULL); 2287 CONNECTION_CLOSE_ERROR (connection, NULL);
2288 return MHD_YES; 2288 return MHD_YES;
@@ -2330,7 +2330,7 @@ MHD_connection_handle_write (struct MHD_Connection *connection)
2330 [(size_t)data_write_offset], 2330 [(size_t)data_write_offset],
2331 response->data_size - 2331 response->data_size -
2332 (size_t)data_write_offset); 2332 (size_t)data_write_offset);
2333 err = MHD_socket_errno_; 2333 err = MHD_socket_get_error_ ();
2334#if DEBUG_SEND_DATA 2334#if DEBUG_SEND_DATA
2335 if (ret > 0) 2335 if (ret > 0)
2336 fprintf (stderr, 2336 fprintf (stderr,
@@ -2344,12 +2344,12 @@ MHD_connection_handle_write (struct MHD_Connection *connection)
2344 (void) MHD_mutex_unlock_ (&response->mutex); 2344 (void) MHD_mutex_unlock_ (&response->mutex);
2345 if (ret < 0) 2345 if (ret < 0)
2346 { 2346 {
2347 if ((err == EINTR) || (err == EAGAIN) || (EWOULDBLOCK == err)) 2347 if (MHD_SCKT_ERR_IS_EINTR_ (err) || MHD_SCKT_ERR_IS_EAGAIN_ (err))
2348 return MHD_YES; 2348 return MHD_YES;
2349#ifdef HAVE_MESSAGES 2349#ifdef HAVE_MESSAGES
2350 MHD_DLOG (connection->daemon, 2350 MHD_DLOG (connection->daemon,
2351 "Failed to send data: %s\n", 2351 "Failed to send data: %s\n",
2352 MHD_socket_last_strerr_ ()); 2352 MHD_socket_strerr_ (err));
2353#endif 2353#endif
2354 CONNECTION_CLOSE_ERROR (connection, NULL); 2354 CONNECTION_CLOSE_ERROR (connection, NULL);
2355 return MHD_YES; 2355 return MHD_YES;