summaryrefslogtreecommitdiff
path: root/client.c
diff options
context:
space:
mode:
Diffstat (limited to 'client.c')
-rw-r--r--client.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/client.c b/client.c
index b5736e4..6233d01 100644
--- a/client.c
+++ b/client.c
@@ -396,6 +396,7 @@ void client_poll_post_data(struct client *cl)
{
struct dispatch *d = &cl->dispatch;
struct http_request *r = &cl->request;
+ enum client_state st;
char *buf;
int len;
@@ -460,10 +461,13 @@ void client_poll_post_data(struct client *cl)
buf = ustream_get_read_buf(cl->us, &len);
if (!r->content_length && !r->transfer_chunked &&
cl->state != CLIENT_STATE_DONE) {
+ st = cl->state;
+
if (cl->dispatch.data_done)
cl->dispatch.data_done(cl);
- cl->state = CLIENT_STATE_DONE;
+ if (cl->state == st)
+ cl->state = CLIENT_STATE_DONE;
}
}