diff options
author | Wez Furlong <wez@php.net> | 2003-11-27 17:39:01 +0000 |
---|---|---|
committer | Wez Furlong <wez@php.net> | 2003-11-27 17:39:01 +0000 |
commit | 3ee72aa5be43a26a96ec6cfab1cc96afd6ee73cb (patch) | |
tree | 61bd6491bc260c01f04220f06fb73eb59811aac3 /main/streams/transports.c | |
parent | 43698d6dbb66aed8ede33da1eaa886d86cce138e (diff) | |
download | php-git-3ee72aa5be43a26a96ec6cfab1cc96afd6ee73cb.tar.gz |
port "liveness" checks and a couple of other things from the 4.3 branch.
Liveness checks are used to validate persistent socket connects when they
are re-used.
Diffstat (limited to 'main/streams/transports.c')
-rw-r--r-- | main/streams/transports.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/main/streams/transports.c b/main/streams/transports.c index f07268602d..dd593baed6 100644 --- a/main/streams/transports.c +++ b/main/streams/transports.c @@ -74,8 +74,10 @@ PHPAPI php_stream *_php_stream_xport_create(const char *name, long namelen, int if (persistent_id) { switch(php_stream_from_persistent_id(persistent_id, &stream TSRMLS_CC)) { case PHP_STREAM_PERSISTENT_SUCCESS: - /* TODO: check if the socket is still live */ - return stream; + if (PHP_STREAM_OPTION_RETURN_OK == php_stream_set_option(stream, PHP_STREAM_OPTION_CHECK_LIVENESS, 0, NULL)) { + return stream; + } + /* fall through */ case PHP_STREAM_PERSISTENT_FAILURE: default: |