Skip to content

Commit 9d5bab5

Browse files
committed
EOF related fixes.
1 parent 93f9eea commit 9d5bab5

File tree

3 files changed

+2
-2
lines changed

3 files changed

+2
-2
lines changed

ext/standard/file.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ PHP_FUNCTION(stream_get_meta_data)
633633

634634
add_assoc_bool(return_value, "timed_out", sock->timeout_event);
635635
add_assoc_bool(return_value, "blocked", sock->is_blocked);
636-
add_assoc_bool(return_value, "eof", sock->eof);
636+
add_assoc_bool(return_value, "eof", stream->eof);
637637
} else {
638638
add_assoc_bool(return_value, "timed_out", 0);
639639
add_assoc_bool(return_value, "blocked", 1);

main/php_network.h

-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ int php_sockaddr_size(php_sockaddr_storage *addr);
103103

104104
struct _php_netstream_data_t {
105105
int socket;
106-
char eof;
107106
char is_blocked;
108107
struct timeval timeout;
109108
char timeout_event;

main/streams.c

+1
Original file line numberDiff line numberDiff line change
@@ -1246,6 +1246,7 @@ static size_t php_stdiop_read(php_stream *stream, char *buf, size_t count TSRMLS
12461246
if (ret == 0 && feof(data->file))
12471247
stream->eof = 1;
12481248
}
1249+
return ret;
12491250
}
12501251

12511252
static int php_stdiop_close(php_stream *stream, int close_handle TSRMLS_DC)

0 commit comments

Comments
 (0)