apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r746202 - /apr/apr/trunk/network_io/unix/sockaddr.c
Date Fri, 20 Feb 2009 11:02:54 GMT
Author: mturk
Date: Fri Feb 20 11:02:54 2009
New Revision: 746202

URL: http://svn.apache.org/viewvc?rev=746202&view=rev
Log:
If APR_UNIX given explicitly do not check if the hostname starts with '/'
Strdup when returning our hostname.
Thanks Ruediger

Modified:
    apr/apr/trunk/network_io/unix/sockaddr.c

Modified: apr/apr/trunk/network_io/unix/sockaddr.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/network_io/unix/sockaddr.c?rev=746202&r1=746201&r2=746202&view=diff
==============================================================================
--- apr/apr/trunk/network_io/unix/sockaddr.c (original)
+++ apr/apr/trunk/network_io/unix/sockaddr.c Fri Feb 20 11:02:54 2009
@@ -580,7 +580,7 @@
         family = APR_UNIX;
     if (family == APR_UNIX) {
 #if APR_HAVE_SOCKADDR_UN
-        if (hostname && *hostname == '/') {
+        if (hostname) {
             *sa = apr_pcalloc(p, sizeof(apr_sockaddr_t));
             (*sa)->pool = p;
             apr_cpystrn((*sa)->sa.unx.sun_path, hostname,
@@ -656,7 +656,7 @@
     }
 #if APR_HAVE_SOCKADDR_UN
     else if (sockaddr->family == APR_UNIX) {
-        *hostname = sockaddr->hostname;
+        *hostname = apr_pstrdup(sockaddr->pool, sockaddr->hostname);
         return APR_SUCCESS;
     }
 #endif



Mime
View raw message