Index: pjproject/trunk/pjsip/src/pjsip/sip_transport_tls.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip/sip_transport_tls.c	(revision 5821)
+++ pjproject/trunk/pjsip/src/pjsip/sip_transport_tls.c	(revision 5833)
@@ -413,4 +413,5 @@
     enum { INFO_LEN = 100 };
     char local_addr[PJ_INET6_ADDRSTRLEN + 10];
+    char pub_addr[PJ_INET6_ADDRSTRLEN + 10];
     pj_sockaddr *listener_addr = &listener->factory.local_addr;
 
@@ -420,18 +421,19 @@
     }
     pj_sockaddr_print(listener_addr, local_addr, sizeof(local_addr), 3);
+    pj_addr_str_print(&listener->factory.addr_name.host, 
+		      listener->factory.addr_name.port, pub_addr, 
+		      sizeof(pub_addr), 1);
     pj_ansi_snprintf(
-	    listener->factory.info, INFO_LEN, "tls %s [published as %.*s:%d]",
-	    local_addr,
-	    (int)listener->factory.addr_name.host.slen,
-	    listener->factory.addr_name.host.ptr,
-	    listener->factory.addr_name.port);
+	    listener->factory.info, INFO_LEN, "tls %s [published as %s]",
+	    local_addr, pub_addr);
 
     if (listener->ssock) {
+	char addr[PJ_INET6_ADDRSTRLEN+10];
+
 	PJ_LOG(4, (listener->factory.obj_name,
-	       "SIP TLS listener is ready for incoming connections "
-	       "at %.*s:%d",
-	       (int)listener->factory.addr_name.host.slen,
-	       listener->factory.addr_name.host.ptr,
-	       listener->factory.addr_name.port));
+	       "SIP TLS listener is ready for incoming connections at %s",
+	       pj_addr_str_print(&listener->factory.addr_name.host,
+			         listener->factory.addr_name.port, addr,
+				 sizeof(addr), 1)));
     } else {
 	PJ_LOG(4, (listener->factory.obj_name, "SIP TLS is ready "
@@ -1252,4 +1254,6 @@
     if (tls->has_pending_connect) {
 	pj_ssl_sock_info info;
+	char local_addr_buf[PJ_INET6_ADDRSTRLEN+10];
+	char remote_addr_buf[PJ_INET6_ADDRSTRLEN+10];
 
 	/* Update local address, just in case local address currently set is 
@@ -1281,11 +1285,11 @@
 
 	PJ_LOG(4,(tls->base.obj_name, 
-		  "TLS transport %.*s:%d is connecting to %.*s:%d...",
-		  (int)tls->base.local_name.host.slen,
-		  tls->base.local_name.host.ptr,
-		  tls->base.local_name.port,
-		  (int)tls->base.remote_name.host.slen,
-		  tls->base.remote_name.host.ptr,
-		  tls->base.remote_name.port));
+		  "TLS transport %s is connecting to %s...",
+		  pj_addr_str_print(&tls->base.local_name.host, 
+				    tls->base.local_name.port, 
+				    local_addr_buf, sizeof(local_addr_buf), 1),
+		  pj_addr_str_print(&tls->base.remote_name.host, 
+			        tls->base.remote_name.port, 
+				remote_addr_buf, sizeof(remote_addr_buf), 1)));
     }
 
@@ -1314,4 +1318,5 @@
     pj_bool_t is_shutdown;
     pj_status_t status;
+    char addr_buf[PJ_INET6_ADDRSTRLEN+10];        
 
     PJ_UNUSED_ARG(src_addr_len);
@@ -1325,9 +1330,9 @@
 
     PJ_LOG(4,(listener->factory.obj_name, 
-	      "TLS listener %.*s:%d: got incoming TLS connection "
+	      "TLS listener %s: got incoming TLS connection "
 	      "from %s, sock=%d",
-	      (int)listener->factory.addr_name.host.slen,
-	      listener->factory.addr_name.host.ptr,
-	      listener->factory.addr_name.port,
+	      pj_addr_str_print(&listener->factory.addr_name.host, 
+				listener->factory.addr_name.port, addr_buf, 
+				sizeof(addr_buf), 1),
 	      pj_sockaddr_print(src_addr, addr, sizeof(addr), 3),
 	      new_ssock));
@@ -1696,4 +1701,6 @@
     pjsip_tp_state_callback state_cb;
     pj_bool_t is_shutdown;
+    char local_addr_buf[PJ_INET6_ADDRSTRLEN+10];
+    char remote_addr_buf[PJ_INET6_ADDRSTRLEN+10];
 
     tls = (struct tls_transport*) pj_ssl_sock_get_user_data(ssock);
@@ -1881,10 +1888,10 @@
     PJ_LOG(4,(tls->base.obj_name, 
 	      "TLS transport %.*s:%d is connected to %.*s:%d",
-	      (int)tls->base.local_name.host.slen,
-	      tls->base.local_name.host.ptr,
-	      tls->base.local_name.port,
-	      (int)tls->base.remote_name.host.slen,
-	      tls->base.remote_name.host.ptr,
-	      tls->base.remote_name.port));
+	      pj_addr_str_print(&tls->base.local_name.host, 
+				tls->base.local_name.port, local_addr_buf, 
+				sizeof(local_addr_buf), 1),
+	      pj_addr_str_print(&tls->base.remote_name.host, 
+				tls->base.remote_name.port, remote_addr_buf, 
+				sizeof(remote_addr_buf), 1)));
 
     /* Start pending read */
@@ -1923,4 +1930,5 @@
     pj_ssize_t size;
     pj_status_t status;
+    char addr[PJ_INET6_ADDRSTRLEN+10];    
 
     PJ_UNUSED_ARG(th);
@@ -1942,8 +1950,9 @@
     }
 
-    PJ_LOG(5,(tls->base.obj_name, "Sending %d byte(s) keep-alive to %.*s:%d", 
-	      (int)tls->ka_pkt.slen, (int)tls->base.remote_name.host.slen,
-	      tls->base.remote_name.host.ptr,
-	      tls->base.remote_name.port));
+    PJ_LOG(5,(tls->base.obj_name, "Sending %d byte(s) keep-alive to %s", 
+	      (int)tls->ka_pkt.slen, 
+	      pj_addr_str_print(&tls->base.remote_name.host, 
+				tls->base.remote_name.port, addr, 
+				sizeof(addr), 1)));
 
     /* Send the data */
