diff options
Diffstat (limited to 'src/lib/upgrade_process.c')
-rw-r--r-- | src/lib/upgrade_process.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/lib/upgrade_process.c b/src/lib/upgrade_process.c index 353f2753..6b0ccf45 100644 --- a/src/lib/upgrade_process.c +++ b/src/lib/upgrade_process.c | |||
@@ -85,8 +85,7 @@ MHD_upgrade_response_handle_process_ (struct MHD_UpgradeResponseHandle *urh) | |||
85 | * check for any pending data even if socket is not marked | 85 | * check for any pending data even if socket is not marked |
86 | * as 'ready' (signal may arrive after poll()/select()). | 86 | * as 'ready' (signal may arrive after poll()/select()). |
87 | * Socketpair for forwarding is always in non-blocking mode | 87 | * Socketpair for forwarding is always in non-blocking mode |
88 | * so no risk that recv() will block the thread. */ | 88 | * so no risk that recv() will block the thread. */if (0 != urh->out_buffer_size) |
89 | if (0 != urh->out_buffer_size) | ||
90 | urh->mhd.celi |= MHD_EPOLL_STATE_READ_READY; | 89 | urh->mhd.celi |= MHD_EPOLL_STATE_READ_READY; |
91 | /* Discard any data received form remote. */ | 90 | /* Discard any data received form remote. */ |
92 | urh->in_buffer_used = 0; | 91 | urh->in_buffer_used = 0; |
@@ -102,11 +101,8 @@ MHD_upgrade_response_handle_process_ (struct MHD_UpgradeResponseHandle *urh) | |||
102 | * fail after remote disconnect was detected) may discard data in system | 101 | * fail after remote disconnect was detected) may discard data in system |
103 | * buffers received by system but not yet read by recv(). | 102 | * buffers received by system but not yet read by recv(). |
104 | * So, before trying send() on any socket, recv() must be performed at first | 103 | * So, before trying send() on any socket, recv() must be performed at first |
105 | * otherwise last part of incoming data may be lost. */ | 104 | * otherwise last part of incoming data may be lost. *//* If disconnect or error was detected - try to read from socket |
106 | 105 | * to dry data possibly pending is system buffers. */if (0 != (MHD_EPOLL_STATE_ERROR & urh->app.celi)) | |
107 | /* If disconnect or error was detected - try to read from socket | ||
108 | * to dry data possibly pending is system buffers. */ | ||
109 | if (0 != (MHD_EPOLL_STATE_ERROR & urh->app.celi)) | ||
110 | urh->app.celi |= MHD_EPOLL_STATE_READ_READY; | 106 | urh->app.celi |= MHD_EPOLL_STATE_READ_READY; |
111 | if (0 != (MHD_EPOLL_STATE_ERROR & urh->mhd.celi)) | 107 | if (0 != (MHD_EPOLL_STATE_ERROR & urh->mhd.celi)) |
112 | urh->mhd.celi |= MHD_EPOLL_STATE_READ_READY; | 108 | urh->mhd.celi |= MHD_EPOLL_STATE_READ_READY; |
@@ -392,6 +388,8 @@ MHD_upgrade_response_handle_process_ (struct MHD_UpgradeResponseHandle *urh) | |||
392 | urh->mhd.celi &= ~MHD_EPOLL_STATE_READ_READY; | 388 | urh->mhd.celi &= ~MHD_EPOLL_STATE_READ_READY; |
393 | } | 389 | } |
394 | } | 390 | } |
391 | |||
392 | |||
395 | #endif /* HTTPS_SUPPORT && UPGRADE_SUPPORT */ | 393 | #endif /* HTTPS_SUPPORT && UPGRADE_SUPPORT */ |
396 | 394 | ||
397 | /* end of upgrade_process.c */ | 395 | /* end of upgrade_process.c */ |