diff options
author | pquerna <pquerna@13f79535-47bb-0310-9956-ffa450edef68> | 2006-12-02 07:12:56 +0000 |
---|---|---|
committer | pquerna <pquerna@13f79535-47bb-0310-9956-ffa450edef68> | 2006-12-02 07:12:56 +0000 |
commit | e30f1f11fdb913d43fbc85d6bc5bc802637a81a1 (patch) | |
tree | 13d5c4e4d419dfaacbe472d5d560a4fdc7882626 | |
parent | f10bfa7edfd60e815f0f8f35f18f7e934dfe985d (diff) | |
download | libapr-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
-rw-r--r-- | memcache/apr_memcache.c | 5 |
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; } |