wez Fri Nov 28 18:20:23 2003 EDT
Modified files:
/php-src/ext/openssl xp_ssl.c
/php-src/main/streams streams.c xp_socket.c
Log:
(sort of) MFB, feof fix for sockets.
Index: php-src/ext/openssl/xp_ssl.c
diff -u php-src/ext/openssl/xp_ssl.c:1.11 php-src/ext/openssl/xp_ssl.c:1.12
--- php-src/ext/openssl/xp_ssl.c:1.11 Thu Nov 27 12:40:15 2003
+++ php-src/ext/openssl/xp_ssl.c Fri Nov 28 18:20:22 2003
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: xp_ssl.c,v 1.11 2003/11/27 17:40:15 wez Exp $ */
+/* $Id: xp_ssl.c,v 1.12 2003/11/28 23:20:22 wez Exp $ */
#include "php.h"
#include "ext/standard/file.h"
@@ -437,10 +437,16 @@
case PHP_STREAM_OPTION_CHECK_LIVENESS:
{
fd_set rfds;
- struct timeval tv = {0,0};
+ struct timeval tv;
char buf;
int alive = 1;
+ if (sslsock->s.timeout.tv_sec == -1) {
+ tv.tv_sec = FG(default_socket_timeout);
+ } else {
+ tv = sslsock->s.timeout;
+ }
+
if (sslsock->s.socket == -1) {
alive = 0;
} else {
Index: php-src/main/streams/streams.c
diff -u php-src/main/streams/streams.c:1.41 php-src/main/streams/streams.c:1.42
--- php-src/main/streams/streams.c:1.41 Thu Nov 27 19:00:28 2003
+++ php-src/main/streams/streams.c Fri Nov 28 18:20:23 2003
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: streams.c,v 1.41 2003/11/28 00:00:28 iliaa Exp $ */
+/* $Id: streams.c,v 1.42 2003/11/28 23:20:23 wez Exp $ */
#define _GNU_SOURCE
#include "php.h"
@@ -602,6 +602,12 @@
return 0;
}
+ if (!stream->eof && PHP_STREAM_OPTION_RETURN_ERR ==
+ php_stream_set_option(stream, PHP_STREAM_OPTION_CHECK_LIVENESS,
+ 0, NULL)) {
+ stream->eof = 1;
+ }
+
return stream->eof;
}
@@ -1113,7 +1119,7 @@
break;
default:
- ret = PHP_STREAM_OPTION_RETURN_ERR;
+ ;
}
}
Index: php-src/main/streams/xp_socket.c
diff -u php-src/main/streams/xp_socket.c:1.16 php-src/main/streams/xp_socket.c:1.17
--- php-src/main/streams/xp_socket.c:1.16 Thu Nov 27 12:39:01 2003
+++ php-src/main/streams/xp_socket.c Fri Nov 28 18:20:23 2003
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: xp_socket.c,v 1.16 2003/11/27 17:39:01 wez Exp $ */
+/* $Id: xp_socket.c,v 1.17 2003/11/28 23:20:23 wez Exp $ */
#include "php.h"
#include "ext/standard/file.h"
@@ -203,10 +203,16 @@
case PHP_STREAM_OPTION_CHECK_LIVENESS:
{
fd_set rfds;
- struct timeval tv = {0,0};
+ struct timeval tv;
char buf;
int alive = 1;
+ if (sock->timeout.tv_sec == -1) {
+ tv.tv_sec = FG(default_socket_timeout);
+ } else {
+ tv = sock->timeout;
+ }
+
if (sock->socket == -1) {
alive = 0;
} else {
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php