fix arguments to uclient_http_reset_headers
[project/uclient.git] / uclient-http.c
index 1ab1f46..f16d29d 100644 (file)
@@ -496,6 +496,8 @@ uclient_http_send_headers(struct uclient_http *uh)
        uclient_http_add_auth_header(uh);
 
        ustream_printf(uh->us, "\r\n");
+
+       uh->state = HTTP_STATE_HEADERS_SENT;
 }
 
 static void uclient_http_headers_complete(struct uclient_http *uh)
@@ -799,7 +801,7 @@ uclient_http_set_request_type(struct uclient *cl, const char *type)
 }
 
 int
-uclient_http_reset_headers(struct uclient *cl, const char *name, const char *value)
+uclient_http_reset_headers(struct uclient *cl)
 {
        struct uclient_http *uh = container_of(cl, struct uclient_http, uc);
 
@@ -850,6 +852,8 @@ uclient_http_request_done(struct uclient *cl)
                return -1;
 
        uclient_http_send_headers(uh);
+       if (uh->req_type == REQ_POST)
+               ustream_printf(uh->us, "0\r\n\r\n");
        uh->state = HTTP_STATE_REQUEST_DONE;
 
        return 0;