[ostree/wip/metalinks] fetcher: Close request body on error paths



commit 7e33a3d012ae6a305300624ec1d020744880e3d5
Author: Colin Walters <walters verbum org>
Date:   Wed Aug 20 10:23:28 2014 -0400

    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.

 src/libostree/ostree-fetcher.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/src/libostree/ostree-fetcher.c b/src/libostree/ostree-fetcher.c
index b6dc761..62d44d7 100644
--- a/src/libostree/ostree-fetcher.c
+++ b/src/libostree/ostree-fetcher.c
@@ -489,6 +489,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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]