]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Support for HTTP redirects in calendar's URL
authorJan Kalab <pitlicek@gmail.com>
Fri, 17 Sep 2010 08:37:49 +0000 (08:37 +0000)
committerJan Kalab <pitlicek@gmail.com>
Fri, 17 Sep 2010 08:37:49 +0000 (08:37 +0000)
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/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@287269 65c4cc65-6c06-0410-ace0-fbb531ad65f3

res/res_calendar_caldav.c
res/res_calendar_ews.c
res/res_calendar_exchange.c
res/res_calendar_icalendar.c

index e0d8c483e64e8aefeaef49e8914c2145bc47e6c3..dd150afd6ca808efb6c9257762e84d5cb7ff38f3 100644 (file)
@@ -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);
index 504d156f75091af729999adbdf490fe7a5a582f3..4932423055b5731862a24be34b597c5e907cd809 100644 (file)
@@ -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,7 +198,7 @@ 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 */
@@ -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");
 
index b1707c5e2ad914f21ad9bc51d8f8fdfbc7a25d24..8f3989c5df7b514fb1020cabaa4e240389b8cf82 100644 (file)
@@ -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);
index 300da2ac9b3af7b9d15b0c3c3e0e0a13aa7987a3..d91cd0fe09c00e2dccfa600642c9bc7f54f0276a 100644 (file)
@@ -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);