wez Wed Oct 8 06:55:52 2003 EDT
Modified files:
/php-src/main/streams plain_wrapper.c xp_socket.c
Log:
Set the EOF indicator after each read attempt.
This prevents it getting stuck in the on position.
Index: php-src/main/streams/plain_wrapper.c
diff -u php-src/main/streams/plain_wrapper.c:1.22
php-src/main/streams/plain_wrapper.c:1.23
--- php-src/main/streams/plain_wrapper.c:1.22 Sat Sep 13 15:43:39 2003
+++ php-src/main/streams/plain_wrapper.c Wed Oct 8 06:55:51 2003
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: plain_wrapper.c,v 1.22 2003/09/13 19:43:39 abies Exp $ */
+/* $Id: plain_wrapper.c,v 1.23 2003/10/08 10:55:51 wez Exp $ */
#include "php.h"
#include "php_globals.h"
@@ -370,8 +370,7 @@
if (data->fd >= 0) {
ret = read(data->fd, buf, count);
- if (ret == 0 || (ret == -1 && errno != EWOULDBLOCK))
- stream->eof = 1;
+ stream->eof = (ret == 0 || (ret == -1 && errno != EWOULDBLOCK));
} else {
#if HAVE_FLUSHIO
@@ -382,8 +381,7 @@
ret = fread(buf, 1, count, data->file);
- if (feof(data->file))
- stream->eof = 1;
+ stream->eof = feof(data->file);
}
return ret;
}
Index: php-src/main/streams/xp_socket.c
diff -u php-src/main/streams/xp_socket.c:1.14 php-src/main/streams/xp_socket.c:1.15
--- php-src/main/streams/xp_socket.c:1.14 Sat Jun 28 07:24:47 2003
+++ php-src/main/streams/xp_socket.c Wed Oct 8 06:55:51 2003
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: xp_socket.c,v 1.14 2003/06/28 11:24:47 wez Exp $ */
+/* $Id: xp_socket.c,v 1.15 2003/10/08 10:55:51 wez Exp $ */
#include "php.h"
#include "ext/standard/file.h"
@@ -124,9 +124,7 @@
nr_bytes = recv(sock->socket, buf, count, 0);
- if (nr_bytes == 0 || (nr_bytes == -1 && php_socket_errno() != EWOULDBLOCK)) {
- stream->eof = 1;
- }
+ stream->eof = (nr_bytes == 0 || (nr_bytes == -1 && php_socket_errno() !=
EWOULDBLOCK));
if (nr_bytes > 0) {
php_stream_notify_progress_increment(stream->context, nr_bytes, 0);
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php