]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Mon May 26 14:57:28 EDT 2008 Pekka Pessi <first.last@nokia.com>
authorMichael Jerris <mike@jerris.com>
Tue, 27 May 2008 00:18:31 +0000 (00:18 +0000)
committerMichael Jerris <mike@jerris.com>
Tue, 27 May 2008 00:18:31 +0000 (00:18 +0000)
  * nth: gracefully downgrade to tcp only if no tls certificates are available

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8676 d0543943-73ff-0310-b7d9-9358b9ac24b2

libs/sofia-sip/.update
libs/sofia-sip/libsofia-sip-ua/nth/nth_client.c
libs/sofia-sip/libsofia-sip-ua/nth/nth_server.c

index 4f8741188593f8349fe3a2a51c1582b6b645747d..1172f36695aa50e02d68e2c0dfcc676cd984d95c 100644 (file)
@@ -1 +1 @@
-Mon May 26 20:18:02 EDT 2008
+Mon May 26 20:18:27 EDT 2008
index 0622c0ff923da767344965bc6faeb0c0a2ca66e8..f9236b636182ca73e550e7b7f3fa12c4a1dabcb9 100644 (file)
@@ -440,6 +440,8 @@ static char const *const he_tports[] = {
   "tcp", "tls", NULL
 };
 
+static char const *const he_no_tls_tports[] = { "tcp", NULL };
+
 static tp_stack_class_t http_client_class[1] = { {
                                                  sizeof(http_client_class),
                                                  he_recv_message,
@@ -456,7 +458,11 @@ int he_create_tports(nth_engine_t * he, tagi_t *tags)
   if (!he->he_tports)
     return -1;
 
-  return tport_tbind(he->he_tports, he_name, he_tports,
+  if (tport_tbind(he->he_tports, he_name, he_tports,
+                 TPTAG_SERVER(0), TAG_NEXT(tags)) >= 0)
+    return 0;
+
+  return tport_tbind(he->he_tports, he_name, he_no_tls_tports,
                     TPTAG_SERVER(0), TAG_NEXT(tags));
 }
 
index 41176488386543e24be264480328c7b20fab8a1a..dadf51b1ab5716519815973ed3200418490aefc2 100644 (file)
@@ -688,6 +688,8 @@ static char const * const http_tports[] =
     "tcp", "tls", NULL
   };
 
+static char const * const http_no_tls_tports[] = { "tcp", NULL };
+
 static tp_stack_class_t nth_server_class[1] =
   {{
     sizeof(nth_server_class),
@@ -738,6 +740,8 @@ server_t *server_create(url_t const *url,
   srv->srv_max_bodylen = 1 << 30; /* 1 GB */
 
   if (tport_tbind(srv->srv_tports, tpn, http_tports,
+                 TAG_END()) >= 0 ||
+      tport_tbind(srv->srv_tports, tpn, http_no_tls_tports,
                  TAG_END()) >= 0) {
     srv->srv_root = root;
     srv->srv_mclass = mclass ? mclass : http_default_mclass();