summaryrefslogtreecommitdiff
path: root/libsoup/soup-message-io.c
diff options
context:
space:
mode:
Diffstat (limited to 'libsoup/soup-message-io.c')
-rw-r--r--libsoup/soup-message-io.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/libsoup/soup-message-io.c b/libsoup/soup-message-io.c
index db98dc28..4629568f 100644
--- a/libsoup/soup-message-io.c
+++ b/libsoup/soup-message-io.c
@@ -360,6 +360,15 @@ io_write (SoupMessage *msg, gboolean blocking,
switch (io->write_state) {
case SOUP_MESSAGE_IO_STATE_HEADERS:
+ if (io->mode == SOUP_MESSAGE_IO_SERVER &&
+ io->read_state == SOUP_MESSAGE_IO_STATE_BLOCKING &&
+ msg->status_code == 0) {
+ /* Client requested "Expect: 100-continue", and
+ * server did not set an error.
+ */
+ soup_message_set_status (msg, SOUP_STATUS_CONTINUE);
+ }
+
if (!io->write_buf->len) {
io->get_headers_cb (msg, io->write_buf,
&io->write_encoding,
@@ -606,11 +615,11 @@ io_read (SoupMessage *msg, gboolean blocking,
break;
} else if (io->mode == SOUP_MESSAGE_IO_SERVER &&
soup_message_headers_get_expectations (msg->request_headers) & SOUP_EXPECTATION_CONTINUE) {
- /* The client requested a Continue response. The
- * got_headers handler may change this to something
- * else though.
+ /* We must return a status code and response
+ * headers to the client; either an error to
+ * be set by a got-headers handler below, or
+ * else %SOUP_STATUS_CONTINUE otherwise.
*/
- soup_message_set_status (msg, SOUP_STATUS_CONTINUE);
io->write_state = SOUP_MESSAGE_IO_STATE_HEADERS;
io->read_state = SOUP_MESSAGE_IO_STATE_BLOCKING;
} else {