summaryrefslogtreecommitdiff
path: root/memcache
diff options
context:
space:
mode:
authorpquerna <pquerna@13f79535-47bb-0310-9956-ffa450edef68>2006-12-02 07:12:56 +0000
committerpquerna <pquerna@13f79535-47bb-0310-9956-ffa450edef68>2006-12-02 07:12:56 +0000
commite30f1f11fdb913d43fbc85d6bc5bc802637a81a1 (patch)
tree13d5c4e4d419dfaacbe472d5d560a4fdc7882626 /memcache
parentf10bfa7edfd60e815f0f8f35f18f7e934dfe985d (diff)
downloadlibapr-util-e30f1f11fdb913d43fbc85d6bc5bc802637a81a1.tar.gz
Reset the socket to blocking mode after connect() finishes.
This fixes some issues with both larger writes, and larger multi-gets, where the connection would timeout, even though everything is working fine. A better solution would be to write a socket_writev_full(), to ensure the usage of timeouts effectively, but the reality of memcached is that if you can connect, your request will always be serviced, unless the memcached instance went away at exactly that moment. git-svn-id: http://svn.apache.org/repos/asf/apr/apr-util/trunk@481513 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'memcache')
-rw-r--r--memcache/apr_memcache.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/memcache/apr_memcache.c b/memcache/apr_memcache.c
index 8e6dc056..0539917f 100644
--- a/memcache/apr_memcache.c
+++ b/memcache/apr_memcache.c
@@ -277,6 +277,11 @@ static apr_status_t conn_connect(apr_memcache_conn_t *conn)
return rv;
}
+ rv = apr_socket_timeout_set(conn->sock, -1);
+ if (rv != APR_SUCCESS) {
+ return rv;
+ }
+
return rv;
}