cal: don't crash on HTTP request failure
authorStefan Becker <chemobejk@gmail.com>
Tue, 9 Jul 2013 07:03:11 +0000 (9 10:03 +0300)
committerStefan Becker <chemobejk@gmail.com>
Sat, 13 Jul 2013 12:55:50 +0000 (13 15:55 +0300)
There is no error handling in the calendar state machines, so we simply
skip the request. Not nice, but better than crashing.

(cherry picked from commit d24948efc67efed4520db1f1e33b642255ef3708)

src/core/sipe-domino.c
src/core/sipe-ews.c

index c6b35fe..6bf3f77 100755 (executable)
@@ -306,9 +306,11 @@ sipe_domino_time_to_str(time_t timestamp)
 
 static void sipe_domino_send_http_request(struct sipe_calendar *cal)
 {
-       sipe_cal_http_authentication(cal);
-       sipe_http_request_session(cal->request, cal->session);
-       sipe_http_request_ready(cal->request);
+       if (cal->request) {
+               sipe_cal_http_authentication(cal);
+               sipe_http_request_session(cal->request, cal->session);
+               sipe_http_request_ready(cal->request);
+       }
 }
 
 static void sipe_domino_do_calendar_request(struct sipe_calendar *cal)
index db50334..db21f94 100644 (file)
@@ -441,9 +441,11 @@ static void sipe_ews_process_autodiscover(SIPE_UNUSED_PARAMETER struct sipe_core
 
 static void sipe_ews_send_http_request(struct sipe_calendar *cal)
 {
-       sipe_cal_http_authentication(cal);
-       sipe_http_request_allow_redirect(cal->request);
-       sipe_http_request_ready(cal->request);
+       if (cal->request) {
+               sipe_cal_http_authentication(cal);
+               sipe_http_request_allow_redirect(cal->request);
+               sipe_http_request_ready(cal->request);
+       }
 }
 
 static void sipe_ews_do_autodiscover(struct sipe_calendar *cal,