From b2840a3f1684a6c8d9f681c56b87a997e9ef3fce Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sat, 4 Jun 2011 16:05:19 +0200 Subject: [PATCH] plist_fetch: add some debugging printfs to know when network access is working. --- lib/plist_fetch.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/plist_fetch.c b/lib/plist_fetch.c index 7628ec56..07e585fc 100644 --- a/lib/plist_fetch.c +++ b/lib/plist_fetch.c @@ -32,7 +32,6 @@ #include #include "xbps_api_impl.h" -#include "fetch.h" /** * @file lib/plist_fetch.c @@ -53,6 +52,8 @@ fetch_archive_open(struct archive *a, void *client_data) (void)a; + xbps_dbg_printf("%s: establishing connection to `%s'...\n", + __func__, f->url->host); f->fetch = fetchGet(f->url, NULL); if (f->fetch == NULL) return ENOENT; @@ -68,6 +69,9 @@ fetch_archive_read(struct archive *a, void *client_data, const void **buf) (void)a; *buf = f->buffer; + xbps_dbg_printf("%s: fetching data from `%s'...\n", + __func__, f->url->doc); + return fetchIO_read(f->fetch, f->buffer, sizeof(f->buffer)); } @@ -78,8 +82,11 @@ fetch_archive_close(struct archive *a, void *client_data) (void)a; - if (f->fetch != NULL) + if (f->fetch != NULL) { + xbps_dbg_printf("%s: closing connection to `%s'...\n", + __func__, f->url->host); fetchIO_close(f->fetch); + } free(f); return 0;