Commit 049618cebe5848e8c5456c32fd136aefdeecccc6

Tyler Ang-Wanek 2021-04-30T15:11:54

httpclient: git_http_client_skip_body should drain socket of body

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/transports/httpclient.c b/src/transports/httpclient.c
index d397574..4ba6da0 100644
--- a/src/transports/httpclient.c
+++ b/src/transports/httpclient.c
@@ -1503,7 +1503,7 @@ int git_http_client_skip_body(git_http_client *client)
 			              "unexpected data handled in callback");
 			error = -1;
 		}
-	} while (!error);
+	} while (error >= 0 && client->state != DONE);
 
 	if (error < 0)
 		client->connected = 0;