[evolution-kolab/ek-wip-xfb: 7/8] libekolabutil: set number of bytes read on KolabUtilHttpJob



commit ba7cf44443eb070b9eba4f11182fe98aa91b66f2
Author: Christian Hilberg <hilberg kernelconcepts de>
Date:   Tue Oct 23 12:57:28 2012 +0200

    libekolabutil: set number of bytes read on KolabUtilHttpJob
    
    * if we were successful reading from the HTTP
      stream, set the number of bytes read on the
      KolabUtilHttpJob::nbytes member

 src/libekolabutil/kolab-util-http.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/libekolabutil/kolab-util-http.c b/src/libekolabutil/kolab-util-http.c
index ee32628..a14ea56 100644
--- a/src/libekolabutil/kolab-util-http.c
+++ b/src/libekolabutil/kolab-util-http.c
@@ -327,8 +327,7 @@ util_http_curl_get (KolabUtilHttpJob *job, GError **error)
 		             _("Access to URL '%s' failed in libcurl with CURLcode: %u (%s)"),
 		             camel_url_to_string (job->url, CAMEL_URL_HIDE_AUTH),
 		             curlcode, curl_easy_strerror (curlcode));
-	}
-	else {
+	} else {
 		nbytes = (gssize)job->buffer->len;
 	}
 
@@ -337,6 +336,9 @@ util_http_curl_get (KolabUtilHttpJob *job, GError **error)
 	 *      if so, also increment nbytes
 	 */
 
+	if (nbytes > -1)
+		job->nbytes = nbytes;
+
 	return nbytes;
 }
 



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