httpclient: git_http_client_skip_body should drain socket of body
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;