changeset 17390:abffff2e916f

lib-http: Fixed assertion failure in http_client_request_send_payload() caused by inappropriate retry attempt.
author Stephan Bosch <stephan@rename-it.nl>
date Tue, 27 May 2014 17:01:15 +0300
parents 5c6f49e2d8d9
children b54844d64ee5
files src/lib-http/http-client-request.c
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-http/http-client-request.c	Mon May 26 04:26:01 2014 +0300
+++ b/src/lib-http/http-client-request.c	Tue May 27 17:01:15 2014 +0300
@@ -1004,6 +1004,13 @@
 
 bool http_client_request_try_retry(struct http_client_request *req)
 {
+	/* don't ever retry if we're sending data in small blocks via
+	   http_client_request_send_payload() and we're not waiting for a
+	   100 continue (there's no way to rewind the payload for a retry)
+	 */
+	if (req->payload_wait &&
+		(!req->payload_sync || req->conn->payload_continue))
+		return FALSE;
 	/* limit the number of attempts for each request */
 	if (req->attempts+1 >= req->client->set.max_attempts)
 		return FALSE;