From 526e8fca14fec8d11be1a3560f1dd907a1c2a5d8 Mon Sep 17 00:00:00 2001 From: Jan Kalab <pitlicek@gmail.com> Date: Fri, 17 Sep 2010 08:46:45 +0000 Subject: [PATCH] Merged revisions 287269-287271 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ........ r287269 | pitel | 2010-09-17 10:37:49 +0200 (Pá, 17 zář 2010) | 8 lines Support for HTTP redirects in calendar's URL libneon does not support HTTP redirects (3xx responses) by default. You must tell it to follow them. Also, another little unsigned int fix. (closes issue #17776) Review: https://reviewboard.asterisk.org/r/921/ ........ r287270 | pitel | 2010-09-17 10:42:37 +0200 (Pá, 17 zář 2010) | 6 lines Asterisk crashing because of double free when EWS request fails The free is done later in code. I think ast_free() should have built in checks for double free. (closes issue #17782) ........ r287271 | pitel | 2010-09-17 10:44:28 +0200 (Pá, 17 zář 2010) | 6 lines Events are visible after they were removed from EWS calendar Because we must merge calendar even when it's empty. (closes issue #17786) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@287272 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- res/res_calendar_caldav.c | 2 ++ res/res_calendar_ews.c | 6 ++++-- res/res_calendar_exchange.c | 2 ++ res/res_calendar_icalendar.c | 2 ++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/res/res_calendar_caldav.c b/res/res_calendar_caldav.c index e0d8c483e6..dd150afd6c 100644 --- a/res/res_calendar_caldav.c +++ b/res/res_calendar_caldav.c @@ -34,6 +34,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include <ne_uri.h> #include <ne_request.h> #include <ne_auth.h> +#include <ne_redirect.h> #include <libxml/xmlmemory.h> #include <libxml/parser.h> @@ -643,6 +644,7 @@ static void *caldav_load_calendar(void *void_data) } pvt->session = ne_session_create(pvt->uri.scheme, pvt->uri.host, pvt->uri.port); + ne_redirect_register(pvt->session); ne_set_server_auth(pvt->session, auth_credentials, pvt); if (!strcasecmp(pvt->uri.scheme, "https")) { ne_ssl_trust_default_ca(pvt->session); diff --git a/res/res_calendar_ews.c b/res/res_calendar_ews.c index 504d156f75..31df353121 100644 --- a/res/res_calendar_ews.c +++ b/res/res_calendar_ews.c @@ -35,6 +35,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include <ne_xml.h> #include <ne_xmlreq.h> #include <ne_utils.h> +#include <ne_redirect.h> #include "asterisk/module.h" #include "asterisk/calendar.h" @@ -197,10 +198,11 @@ static int startelm(void *userdata, int parent, const char *nspace, const char * return NE_XML_ABORT; } - ast_debug(3, "EWS: %d calendar items to load\n", items); + ast_debug(3, "EWS: %u calendar items to load\n", items); ctx->pvt->items = items; if (items < 1) { /* Stop processing XML if there are no events */ + ast_calendar_merge_events(ctx->pvt->owner, ctx->pvt->events); return NE_XML_DECLINE; } return 1; @@ -527,7 +529,6 @@ static int send_ews_request_and_parse(struct ast_str *request, struct xml_contex if (ret != NE_OK) { /* Error handling */ ast_log(LOG_WARNING, "Unable to communicate with Exchange Web Service at '%s': %s\n", ctx->pvt->url, ne_get_error(ctx->pvt->session)); ne_request_destroy(req); - ast_free(request); ne_xml_destroy(parser); return -1; } @@ -838,6 +839,7 @@ static void *ewscal_load_calendar(void *void_data) ast_debug(3, "secret = %s\n", pvt->secret); pvt->session = ne_session_create(pvt->uri.scheme, pvt->uri.host, pvt->uri.port); + ne_redirect_register(pvt->session); ne_set_server_auth(pvt->session, auth_credentials, pvt); ne_set_useragent(pvt->session, "Asterisk"); diff --git a/res/res_calendar_exchange.c b/res/res_calendar_exchange.c index b1707c5e2a..8f3989c5df 100644 --- a/res/res_calendar_exchange.c +++ b/res/res_calendar_exchange.c @@ -34,6 +34,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include <ne_uri.h> #include <ne_request.h> #include <ne_auth.h> +#include <ne_redirect.h> #include <iksemel.h> #include "asterisk/module.h" @@ -693,6 +694,7 @@ static void *exchangecal_load_calendar(void *void_data) } pvt->session = ne_session_create(pvt->uri.scheme, pvt->uri.host, pvt->uri.port); + ne_redirect_register(pvt->session); ne_set_server_auth(pvt->session, auth_credentials, pvt); if (!strcasecmp(pvt->uri.scheme, "https")) { ne_ssl_trust_default_ca(pvt->session); diff --git a/res/res_calendar_icalendar.c b/res/res_calendar_icalendar.c index 300da2ac9b..d91cd0fe09 100644 --- a/res/res_calendar_icalendar.c +++ b/res/res_calendar_icalendar.c @@ -33,6 +33,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include <ne_uri.h> #include <ne_request.h> #include <ne_auth.h> +#include <ne_redirect.h> #include "asterisk/module.h" #include "asterisk/calendar.h" @@ -420,6 +421,7 @@ static void *ical_load_calendar(void *void_data) } pvt->session = ne_session_create(pvt->uri.scheme, pvt->uri.host, pvt->uri.port); + ne_redirect_register(pvt->session); ne_set_server_auth(pvt->session, auth_credentials, pvt); if (!strcasecmp(pvt->uri.scheme, "https")) { ne_ssl_trust_default_ca(pvt->session); -- GitLab