fetcher: Close request body on error paths

Otherwise, we're potentially holding up subsequent requests.

I was hitting this when testing the metalink code, where we want to
continue doing more fetches after hitting a 404.

https://bugzilla.gnome.org/show_bug.cgi?id=729585
This commit is contained in:
Colin Walters 2014-08-20 10:23:28 -04:00
parent 6dfe99a283
commit c08a4503ce
1 changed files with 2 additions and 0 deletions

View File

@ -505,6 +505,8 @@ on_request_sent (GObject *object,
out:
if (local_error)
{
if (pending->request_body)
(void) g_input_stream_close (pending->request_body, NULL, NULL);
g_simple_async_result_take_error (pending->result, local_error);
g_simple_async_result_complete (pending->result);
g_object_unref (pending->result);