aboutsummaryrefslogtreecommitdiff
path: root/src/daemon/connection.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-03-10 12:19:27 +0000
committerChristian Grothoff <christian@grothoff.org>2010-03-10 12:19:27 +0000
commita747d35a8bb6593e3418c5bf2c5704c29dc56d73 (patch)
tree0ccf716ec1677b00dd1b6c7c0d7185985c70c6e5 /src/daemon/connection.c
parent2fb1e810a3f5bca2b32f946b3a33b6faebb54f6d (diff)
downloadlibmicrohttpd-a747d35a8bb6593e3418c5bf2c5704c29dc56d73.tar.gz
libmicrohttpd-a747d35a8bb6593e3418c5bf2c5704c29dc56d73.zip
bugfix
Diffstat (limited to 'src/daemon/connection.c')
-rw-r--r--src/daemon/connection.c38
1 files changed, 37 insertions, 1 deletions
diff --git a/src/daemon/connection.c b/src/daemon/connection.c
index ef47b1c9..623a1f65 100644
--- a/src/daemon/connection.c
+++ b/src/daemon/connection.c
@@ -1140,6 +1140,7 @@ parse_initial_message_line (struct MHD_Connection *connection, char *line)
1140 return MHD_YES; 1140 return MHD_YES;
1141} 1141}
1142 1142
1143
1143/** 1144/**
1144 * Call the handler of the application for this 1145 * Call the handler of the application for this
1145 * connection. Handles chunking of the upload 1146 * connection. Handles chunking of the upload
@@ -1149,6 +1150,41 @@ static void
1149call_connection_handler (struct MHD_Connection *connection) 1150call_connection_handler (struct MHD_Connection *connection)
1150{ 1151{
1151 size_t processed; 1152 size_t processed;
1153
1154 if (connection->response != NULL)
1155 return; /* already queued a response */
1156 processed = 0;
1157 connection->client_aware = MHD_YES;
1158 if (MHD_NO ==
1159 connection->daemon->default_handler (connection->daemon->
1160 default_handler_cls,
1161 connection, connection->url,
1162 connection->method,
1163 connection->version,
1164 NULL, &processed,
1165 &connection->client_context))
1166 {
1167 /* serious internal error, close connection */
1168#if HAVE_MESSAGES
1169 MHD_DLOG (connection->daemon,
1170 "Internal application error, closing connection.\n");
1171#endif
1172 connection_close_error (connection);
1173 return;
1174 }
1175}
1176
1177
1178
1179/**
1180 * Call the handler of the application for this
1181 * connection. Handles chunking of the upload
1182 * as well as normal uploads.
1183 */
1184static void
1185process_request_body (struct MHD_Connection *connection)
1186{
1187 size_t processed;
1152 size_t available; 1188 size_t available;
1153 size_t used; 1189 size_t used;
1154 size_t i; 1190 size_t i;
@@ -1949,7 +1985,7 @@ MHD_connection_handle_idle (struct MHD_Connection *connection)
1949 case MHD_CONNECTION_CONTINUE_SENT: 1985 case MHD_CONNECTION_CONTINUE_SENT:
1950 if (connection->read_buffer_offset != 0) 1986 if (connection->read_buffer_offset != 0)
1951 { 1987 {
1952 call_connection_handler (connection); /* loop call */ 1988 process_request_body (connection); /* loop call */
1953 if (connection->state == MHD_CONNECTION_CLOSED) 1989 if (connection->state == MHD_CONNECTION_CLOSED)
1954 continue; 1990 continue;
1955 } 1991 }