diff options
Diffstat (limited to 'src/daemon/session.c')
-rw-r--r-- | src/daemon/session.c | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/src/daemon/session.c b/src/daemon/session.c index 9e8afa83..b458cad7 100644 --- a/src/daemon/session.c +++ b/src/daemon/session.c | |||
@@ -175,7 +175,9 @@ MHD_get_next_header_line(struct MHD_Session * session) { | |||
175 | session->read_buffer_size *= 2; | 175 | session->read_buffer_size *= 2; |
176 | } else { | 176 | } else { |
177 | /* die, header far too long to be reasonable */ | 177 | /* die, header far too long to be reasonable */ |
178 | /* FIXME: log */ | 178 | MHD_DLOG(session->daemon, |
179 | "Received excessively long header line (>%u), closing connection.\n", | ||
180 | 4 * MHD_MAX_BUF_SIZE); | ||
179 | close(session->socket_fd); | 181 | close(session->socket_fd); |
180 | session->socket_fd = -1; | 182 | session->socket_fd = -1; |
181 | } | 183 | } |
@@ -251,7 +253,8 @@ MHD_parse_session_headers(struct MHD_Session * session) { | |||
251 | colon = strstr(line, ": "); | 253 | colon = strstr(line, ": "); |
252 | if (colon == NULL) { | 254 | if (colon == NULL) { |
253 | /* error in header line, die hard */ | 255 | /* error in header line, die hard */ |
254 | /* FIXME: log */ | 256 | MHD_DLOG(session->daemon, |
257 | "Received malformed line (no colon), closing connection.\n"); | ||
255 | goto DIE; | 258 | goto DIE; |
256 | } | 259 | } |
257 | /* zero-terminate header */ | 260 | /* zero-terminate header */ |
@@ -297,7 +300,9 @@ MHD_session_handle_read(struct MHD_Session * session) { | |||
297 | unsigned int processed; | 300 | unsigned int processed; |
298 | 301 | ||
299 | if (session->bodyReceived) { | 302 | if (session->bodyReceived) { |
300 | /* FIXME: LOG: why are we in select set? */ | 303 | MHD_DLOG(session->daemon, |
304 | "Unexpected call to %s.\n", | ||
305 | __FUNCTION__); | ||
301 | return MHD_NO; | 306 | return MHD_NO; |
302 | } | 307 | } |
303 | if (session->readLoc >= session->read_buffer_size) { | 308 | if (session->readLoc >= session->read_buffer_size) { |
@@ -315,7 +320,9 @@ MHD_session_handle_read(struct MHD_Session * session) { | |||
315 | if (bytes_read < 0) { | 320 | if (bytes_read < 0) { |
316 | if (errno == EINTR) | 321 | if (errno == EINTR) |
317 | return MHD_NO; | 322 | return MHD_NO; |
318 | /* FIXME: log error */ | 323 | MHD_DLOG(session->daemon, |
324 | "Failed to receive data: %s\n", | ||
325 | strerror(errno)); | ||
319 | return MHD_NO; | 326 | return MHD_NO; |
320 | } | 327 | } |
321 | if (bytes_read == 0) { | 328 | if (bytes_read == 0) { |
@@ -409,7 +416,9 @@ MHD_session_handle_write(struct MHD_Session * session) { | |||
409 | 416 | ||
410 | response = session->response; | 417 | response = session->response; |
411 | if(response == NULL) { | 418 | if(response == NULL) { |
412 | /* FIXME: LOG: why are we here? */ | 419 | MHD_DLOG(session->daemon, |
420 | "Unexpected call to %s.\n", | ||
421 | __FUNCTION__); | ||
413 | return MHD_NO; | 422 | return MHD_NO; |
414 | } | 423 | } |
415 | if (! session->headersSent) { | 424 | if (! session->headersSent) { |
@@ -422,7 +431,9 @@ MHD_session_handle_write(struct MHD_Session * session) { | |||
422 | if (ret < 0) { | 431 | if (ret < 0) { |
423 | if (errno == EINTR) | 432 | if (errno == EINTR) |
424 | return MHD_YES; | 433 | return MHD_YES; |
425 | /* FIXME: log error */ | 434 | MHD_DLOG(session->daemon, |
435 | "Failed to send data: %s\n", | ||
436 | strerror(errno)); | ||
426 | close(session->socket_fd); | 437 | close(session->socket_fd); |
427 | session->socket_fd = -1; | 438 | session->socket_fd = -1; |
428 | return MHD_NO; | 439 | return MHD_NO; |
@@ -480,7 +491,9 @@ MHD_session_handle_write(struct MHD_Session * session) { | |||
480 | if (ret == -1) { | 491 | if (ret == -1) { |
481 | if (errno == EINTR) | 492 | if (errno == EINTR) |
482 | return MHD_YES; | 493 | return MHD_YES; |
483 | /* FIXME: log */ | 494 | MHD_DLOG(session->daemon, |
495 | "Failed to send data: %s\n", | ||
496 | strerror(errno)); | ||
484 | return MHD_NO; | 497 | return MHD_NO; |
485 | } | 498 | } |
486 | session->messagePos += ret; | 499 | session->messagePos += ret; |