apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From minf...@apache.org
Subject svn commit: r1484271 - in /apr/apr/trunk: CHANGES memcache/apr_memcache.c
Date Sun, 19 May 2013 11:31:05 GMT
Author: minfrin
Date: Sun May 19 11:31:05 2013
New Revision: 1484271

URL: http://svn.apache.org/r1484271
Log:
Add support to apr_memcache for unix domain sockets.

Modified:
    apr/apr/trunk/CHANGES
    apr/apr/trunk/memcache/apr_memcache.c

Modified: apr/apr/trunk/CHANGES
URL: http://svn.apache.org/viewvc/apr/apr/trunk/CHANGES?rev=1484271&r1=1484270&r2=1484271&view=diff
==============================================================================
--- apr/apr/trunk/CHANGES [utf-8] (original)
+++ apr/apr/trunk/CHANGES [utf-8] Sun May 19 11:31:05 2013
@@ -1,6 +1,9 @@
                                                      -*- coding: utf-8 -*-
 Changes for APR 2.0.0
 
+  *) Add support to apr_memcache for unix domain sockets. PR 54573 [Remi
+     Gacogne <rgacogne+asf aquaray.com>]
+
   *) Add the apr_table_getm() call, which transparently handles the
      merging of keys with multiple values. [Graham Leggett]
 

Modified: apr/apr/trunk/memcache/apr_memcache.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/memcache/apr_memcache.c?rev=1484271&r1=1484270&r2=1484271&view=diff
==============================================================================
--- apr/apr/trunk/memcache/apr_memcache.c (original)
+++ apr/apr/trunk/memcache/apr_memcache.c Sun May 19 11:31:05 2013
@@ -289,8 +289,13 @@ static apr_status_t conn_connect(apr_mem
 {
     apr_status_t rv = APR_SUCCESS;
     apr_sockaddr_t *sa;
+#if APR_HAVE_SOCKADDR_UN
+    apr_int32_t family = conn->ms->host[0] != '/' ? APR_INET : APR_UNIX;
+#else
+    apr_int32_t family = APR_INET;
+#endif
 
-    rv = apr_sockaddr_info_get(&sa, conn->ms->host, APR_INET, conn->ms->port,
0, conn->p);
+    rv = apr_sockaddr_info_get(&sa, conn->ms->host, family, conn->ms->port,
0, conn->p);
     if (rv != APR_SUCCESS) {
         return rv;
     }
@@ -322,6 +327,11 @@ mc_conn_construct(void **conn_, void *pa
     apr_pool_t *np;
     apr_pool_t *tp;
     apr_memcache_server_t *ms = params;
+#if APR_HAVE_SOCKADDR_UN
+    apr_int32_t family = conn->ms->host[0] != '/' ? APR_INET : APR_UNIX;
+#else
+    apr_int32_t family = APR_INET;
+#endif
 
     rv = apr_pool_create(&np, pool);
     if (rv != APR_SUCCESS) {
@@ -339,7 +349,7 @@ mc_conn_construct(void **conn_, void *pa
     conn->p = np;
     conn->tp = tp;
 
-    rv = apr_socket_create(&conn->sock, APR_INET, SOCK_STREAM, 0, np);
+    rv = apr_socket_create(&conn->sock, family, SOCK_STREAM, 0, np);
 
     if (rv != APR_SUCCESS) {
         apr_pool_destroy(np);



Mime
View raw message