- return memcached_set_error(*ptr, MEMCACHED_CONNECTION_FAILURE, MEMCACHED_AT); /* The last error should be from connect() */
+ if (timeout_error_occured and server->state < MEMCACHED_SERVER_STATE_IN_PROGRESS)
+ {
+ return memcached_set_error(*server, MEMCACHED_TIMEOUT, MEMCACHED_AT);
+ }
+
+ return memcached_set_error(*server, MEMCACHED_CONNECTION_FAILURE, MEMCACHED_AT); /* The last error should be from connect() */