[asterisk-commits] mjordan: branch mjordan/trunk-http-stuff-and-things r432172 - /team/mjordan/t...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Feb 21 17:20:37 CST 2015


Author: mjordan
Date: Sat Feb 21 17:20:32 2015
New Revision: 432172

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=432172
Log:
res/res_http_media_cache: Fix a few bugs, add HTTPS

Modified:
    team/mjordan/trunk-http-stuff-and-things/res/res_http_media_cache.c
    team/mjordan/trunk-http-stuff-and-things/res/res_pjsip_sdp_rtp.c

Modified: team/mjordan/trunk-http-stuff-and-things/res/res_http_media_cache.c
URL: http://svnview.digium.com/svn/asterisk/team/mjordan/trunk-http-stuff-and-things/res/res_http_media_cache.c?view=diff&rev=432172&r1=432171&r2=432172
==============================================================================
--- team/mjordan/trunk-http-stuff-and-things/res/res_http_media_cache.c (original)
+++ team/mjordan/trunk-http-stuff-and-things/res/res_http_media_cache.c Sat Feb 21 17:20:32 2015
@@ -76,11 +76,10 @@
 	header = ast_alloca(realsize + 1);
 	memcpy(header, buffer, realsize);
 	header[realsize] = '\0';
-
 	value = strchr(header, ':');
 	if (!value) {
-		ast_log(LOG_WARNING, "Failed to split received header in cURL request\n");
-		return 0;
+		/* Not a header we care about; bail */
+		return realsize;
 	}
 	*value++ = '\0';
 
@@ -260,7 +259,7 @@
 		return 1;
 	}
 
-	return ast_tvcmp(current_time, expires) == 1 ? 1 : 0;
+	return ast_tvcmp(current_time, expires) == -1 ? 0 : 1;
 }
 
 static void update_pre_exec(struct ast_bucket_file *bucket_file, CURL *curl, void *obj)
@@ -348,14 +347,14 @@
 	return 0;
 }
 
-static struct ast_sorcery_wizard bucket_wizard = {
+static struct ast_sorcery_wizard http_bucket_wizard = {
 	.name = "http",
 	.create = bucket_http_wizard_create,
 	.retrieve_id = bucket_http_wizard_retrieve_id,
 	.delete = bucket_http_wizard_delete,
 };
 
-static struct ast_sorcery_wizard bucket_file_wizard = {
+static struct ast_sorcery_wizard http_bucket_file_wizard = {
 	.name = "http",
 	.create = bucket_http_wizard_create,
 	.update = bucket_http_wizard_update,
@@ -363,6 +362,20 @@
 	.delete = bucket_http_wizard_delete,
 };
 
+static struct ast_sorcery_wizard https_bucket_wizard = {
+	.name = "https",
+	.create = bucket_http_wizard_create,
+	.retrieve_id = bucket_http_wizard_retrieve_id,
+	.delete = bucket_http_wizard_delete,
+};
+
+static struct ast_sorcery_wizard https_bucket_file_wizard = {
+	.name = "https",
+	.create = bucket_http_wizard_create,
+	.update = bucket_http_wizard_update,
+	.retrieve_id = bucket_http_wizard_retrieve_id,
+	.delete = bucket_http_wizard_delete,
+};
 
 static int unload_module(void)
 {
@@ -371,9 +384,15 @@
 
 static int load_module(void)
 {
-	if (ast_bucket_scheme_register("http", &bucket_wizard, &bucket_file_wizard,
+	if (ast_bucket_scheme_register("http", &http_bucket_wizard, &http_bucket_file_wizard,
 			NULL, NULL)) {
 		ast_log(LOG_ERROR, "Failed to register Bucket HTTP wizard scheme implementation\n");
+		return AST_MODULE_LOAD_FAILURE;
+	}
+
+	if (ast_bucket_scheme_register("https", &https_bucket_wizard, &https_bucket_file_wizard,
+			NULL, NULL)) {
+		ast_log(LOG_ERROR, "Failed to register Bucket HTTPS wizard scheme implementation\n");
 		return AST_MODULE_LOAD_FAILURE;
 	}
 

Modified: team/mjordan/trunk-http-stuff-and-things/res/res_pjsip_sdp_rtp.c
URL: http://svnview.digium.com/svn/asterisk/team/mjordan/trunk-http-stuff-and-things/res/res_pjsip_sdp_rtp.c?view=diff&rev=432172&r1=432171&r2=432172
==============================================================================
--- team/mjordan/trunk-http-stuff-and-things/res/res_pjsip_sdp_rtp.c (original)
+++ team/mjordan/trunk-http-stuff-and-things/res/res_pjsip_sdp_rtp.c Sat Feb 21 17:20:32 2015
@@ -396,6 +396,8 @@
 	}
 
 	ao2_iterator_destroy(&it_candidates);
+	ao2_ref(candidates, -1);
+
 }
 
 /*! \brief Function which processes ICE attributes in an audio stream */




More information about the asterisk-commits mailing list