| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -172,7 +172,6 @@ int HTTPConnection::updateBuffer() { | |||
| 172 | 172 | } | |
| 173 | 173 | _bufferUnusedIdx -= _bufferProcessed; | |
| 174 | 174 | _bufferProcessed = 0; | |
| 175 | - | ||
| 176 | 175 | } | |
| 177 | 176 | ||
| 178 | 177 | if (_bufferUnusedIdx < HTTPS_CONNECTION_DATA_CHUNK_SIZE) { | |
@@ -198,7 +197,7 @@ int HTTPConnection::updateBuffer() { | |||
| 198 | 197 | } else if (readReturnCode == 0) { | |
| 199 | 198 | // The connection has been closed by the client | |
| 200 | 199 | _clientState = CSTATE_CLOSED; | |
| 201 | - HTTPS_LOGI("Client closed connection, FID=%d", _socket); | ||
| 200 | + HTTPS_LOGW("Client closed connection, FID=%d", _socket); | ||
| 202 | 201 | // TODO: If we are in state websocket, we might need to do something here | |
| 203 | 202 | return 0; | |
| 204 | 203 | } else { | |
@@ -212,7 +211,7 @@ int HTTPConnection::updateBuffer() { | |||
| 212 | 211 | // When the connection for whatever reason is unable to receive more data, the application essentially gets | |
| 213 | 212 | // stuck in an infinite while loop. This extra timeout check prevents this from occurring. | |
| 214 | 213 | } else if (isTimeoutExceeded()) { | |
| 215 | - HTTPS_LOGI("Connection timeout. FID=%d", _socket); | ||
| 214 | + HTTPS_LOGW("Connection timeout. FID=%d", _socket); | ||
| 216 | 215 | closeConnection(); | |
| 217 | 216 | return -1; | |
| 218 | 217 | } | |
@@ -227,10 +226,10 @@ bool HTTPConnection::canReadData() { | |||
| 227 | 226 | FD_ZERO( &sockfds ); | |
| 228 | 227 | FD_SET(_socket, &sockfds); | |
| 229 | 228 | ||
| 230 | - // We define an immediate timeout (return immediately, if there's no data) | ||
| 229 | + // Wait up to 250 ms for data to be available before returning false | ||
| 231 | 230 | timeval timeout; | |
| 232 | - timeout.tv_sec = 0; | ||
| 233 | - timeout.tv_usec = 0; | ||
| 231 | + timeout.tv_sec = 0; | ||
| 232 | + timeout.tv_usec = 250000; | ||
| 234 | 233 | ||
| 235 | 234 | // Check for input | |
| 236 | 235 | // As by 2017-12-14, it seems that FD_SETSIZE is defined as 0x40, but socket IDs now | |
| Back | FazBrowse Home | New Git URL |
0 commit comments