aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2008-08-24 19:08:13 +0000
committerChristian Grothoff <christian@grothoff.org>2008-08-24 19:08:13 +0000
commitcff975d1ffb383575b38ad3eb8af90a102404a49 (patch)
treeeaac817b6e1b15c375210317e8ca091e66b3f837 /src
parentdeb0b94b538a60f341d0f532c782549e7d4de808 (diff)
downloadlibmicrohttpd-cff975d1ffb383575b38ad3eb8af90a102404a49.tar.gz
libmicrohttpd-cff975d1ffb383575b38ad3eb8af90a102404a49.zip
handle 0 as specified in documentation
Diffstat (limited to 'src')
-rw-r--r--src/daemon/connection.c9
-rw-r--r--src/daemon/daemon.c3
-rw-r--r--src/daemon/reason_phrase.c1
3 files changed, 12 insertions, 1 deletions
diff --git a/src/daemon/connection.c b/src/daemon/connection.c
index e94b1d46..3fd03a41 100644
--- a/src/daemon/connection.c
+++ b/src/daemon/connection.c
@@ -330,6 +330,9 @@ try_ready_normal_body (struct MHD_Connection *connection)
330 MHD_MIN (response->data_buffer_size, 330 MHD_MIN (response->data_buffer_size,
331 response->total_size - 331 response->total_size -
332 connection->response_write_position)); 332 connection->response_write_position));
333 if ( (ret == 0) &&
334 (0 != (connection->daemon->options & MHD_USE_SELECT_INTERNALLY)) )
335 abort(); /* serious client API violation */
333 if (ret == -1) 336 if (ret == -1)
334 { 337 {
335 /* either error or http 1.0 transfer, close 338 /* either error or http 1.0 transfer, close
@@ -1715,6 +1718,12 @@ MHD_connection_handle_write (struct MHD_Connection *connection)
1715 if (connection->socket_fd != -1) 1718 if (connection->socket_fd != -1)
1716 connection_close_error (connection); 1719 connection_close_error (connection);
1717 return MHD_NO; 1720 return MHD_NO;
1721 case MHD_TLS_CONNECTION_INIT:
1722 case MHD_TLS_HELLO_REQUEST:
1723 case MHD_TLS_HANDSHAKE_FAILED:
1724 case MHD_TLS_HANDSHAKE_COMPLETE:
1725 EXTRA_CHECK(0);
1726 break;
1718 } 1727 }
1719 break; 1728 break;
1720 } 1729 }
diff --git a/src/daemon/daemon.c b/src/daemon/daemon.c
index f116c192..599f983a 100644
--- a/src/daemon/daemon.c
+++ b/src/daemon/daemon.c
@@ -251,6 +251,9 @@ MHD_handle_connection (void *data)
251 tv.tv_sec = timeout - (now - con->last_activity); 251 tv.tv_sec = timeout - (now - con->last_activity);
252 else 252 else
253 tv.tv_sec = 0; 253 tv.tv_sec = 0;
254 if ( (con->state == MHD_CONNECTION_NORMAL_BODY_UNREADY) ||
255 (con->state == MHD_CONNECTION_CHUNKED_BODY_UNREADY) )
256 timeout = 1; /* do not block */
254 num_ready = SELECT (max + 1, 257 num_ready = SELECT (max + 1,
255 &rs, &ws, &es, (timeout != 0) ? &tv : NULL); 258 &rs, &ws, &es, (timeout != 0) ? &tv : NULL);
256 if (num_ready < 0) 259 if (num_ready < 0)
diff --git a/src/daemon/reason_phrase.c b/src/daemon/reason_phrase.c
index 095b6302..9ec4b346 100644
--- a/src/daemon/reason_phrase.c
+++ b/src/daemon/reason_phrase.c
@@ -2,7 +2,6 @@
2 This file is part of libmicrohttpd 2 This file is part of libmicrohttpd
3 (C) 2007 Lymba 3 (C) 2007 Lymba
4 4
5
6 This library is free software; you can redistribute it and/or 5 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public 6 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either 7 License as published by the Free Software Foundation; either