[evolution-kolab] libekolabutil: error propagation fix



commit 0df1eaaa0c481869a27cc832375a2873a4c8131e
Author: Christian Hilberg <hilberg kernelconcepts de>
Date:   Thu May 10 17:29:20 2012 +0200

    libekolabutil: error propagation fix
    
    * in kolab_cal_util_fb_new_ecalcomp_from_request(),
      properly propagate errors from the HTTP getter
      util function
    * removed obsolete warning about Camel auth not
      yet implemented
    * ...always initialize local variables...

 src/libekolabutil/kolab-util-cal-freebusy.c |   22 ++++++++++------------
 1 files changed, 10 insertions(+), 12 deletions(-)
---
diff --git a/src/libekolabutil/kolab-util-cal-freebusy.c b/src/libekolabutil/kolab-util-cal-freebusy.c
index 534b84c..666485a 100644
--- a/src/libekolabutil/kolab-util-cal-freebusy.c
+++ b/src/libekolabutil/kolab-util-cal-freebusy.c
@@ -55,11 +55,11 @@ kolab_cal_util_fb_new_ecalcomp_from_request (KolabUtilHttpJob *job,
                                              Kolab_conv_freebusy_type listtype,
                                              GError **err)
 {
-	CamelURL *camel_url;
-	gchar *url_string;
-	gchar *servername;
-	gboolean use_ssl;
-	gssize nbytes;
+	CamelURL *camel_url = NULL;
+	gchar *url_string = NULL;
+	gchar *servername = NULL;
+	gboolean use_ssl = FALSE;
+	gssize nbytes = 0;
 	ECalComponent *ecalcomp = NULL;
 	GError *tmp_err = NULL;
 
@@ -96,12 +96,6 @@ kolab_cal_util_fb_new_ecalcomp_from_request (KolabUtilHttpJob *job,
 	camel_url_set_user (camel_url, job->url->user);
 	/* TODO authmech ? */
 
-	/* FIXME camel authentication stuff has moved to CamelSettings */
-	g_warning ("%s: Camel authentication not yet ported", __func__);
-#if 0
-	camel_url_set_passwd (camel_url, job->url->passwd);
-#endif
-
 	camel_url_set_port (camel_url, job->url->port);
 	if (job->url->query) camel_url_set_query (camel_url, job->url->query);
 	if (job->url->fragment) camel_url_set_fragment (camel_url, job->url->fragment);
@@ -112,7 +106,10 @@ kolab_cal_util_fb_new_ecalcomp_from_request (KolabUtilHttpJob *job,
 	g_assert (job->buffer != NULL);
 
 	/* issue HTTP GET request */
-	nbytes = kolab_util_http_get (job, NULL);
+	nbytes = kolab_util_http_get (job, &tmp_err);
+	if (tmp_err != NULL)
+		goto skip;
+
 	job->nbytes = nbytes; /* save number of bytes read since buffer will be destroyed */
 	g_debug ("%s: read %d bytes", __func__, nbytes);
 
@@ -120,6 +117,7 @@ kolab_cal_util_fb_new_ecalcomp_from_request (KolabUtilHttpJob *job,
 	ecalcomp = kolabconv_cal_util_freebusy_ecalcomp_new_from_ics ((gchar*)(job->buffer->data),
 	                                                              nbytes,
 	                                                              &tmp_err);
+ skip:
 	if ((ecalcomp == NULL) && (tmp_err != NULL))
 		g_propagate_error (err, tmp_err);
 



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