summaryrefslogtreecommitdiff
path: root/ext/curl/streams.c
diff options
context:
space:
mode:
authorWez Furlong <wez@php.net>2002-11-14 11:41:24 +0000
committerWez Furlong <wez@php.net>2002-11-14 11:41:24 +0000
commit9ae3c2f7bd7dd13adabbdab8c62cbfda06f8af07 (patch)
tree9dab9f08b9a09ff83398a7ea0a138b22c4ec5fd5 /ext/curl/streams.c
parentbab4957d1c6696e62b45293b3608e0851fc20931 (diff)
downloadphp-git-9ae3c2f7bd7dd13adabbdab8c62cbfda06f8af07.tar.gz
Commit these before Sterling renames the files again :-)
When curlstreams are enabled, registers a each supported protocol with PHP. "More Correctly" implement eof for curlstreams. Still not ready for anything like primetime.
Diffstat (limited to 'ext/curl/streams.c')
-rw-r--r--ext/curl/streams.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/ext/curl/streams.c b/ext/curl/streams.c
index eaee95409d..d7f613f7cf 100644
--- a/ext/curl/streams.c
+++ b/ext/curl/streams.c
@@ -140,18 +140,6 @@ static size_t php_curl_stream_read(php_stream *stream, char *buf, size_t count T
{
php_curl_stream *curlstream = (php_curl_stream*)stream->abstract;
size_t didread = 0;
-
- if (buf == NULL && count == 0) {
- /* check for EOF */
-
- /* if we have buffered data, then we are not at EOF */
- if (curlstream->readbuffer.writepos > 0
- && curlstream->readbuffer.readpos < curlstream->readbuffer.writepos)
- return 0;
-
-
- return curlstream->pending ? 0 : EOF;
- }
if (curlstream->readbuffer.readpos >= curlstream->readbuffer.writepos && curlstream->pending) {
/* we need to read some more data */
@@ -198,6 +186,11 @@ static size_t php_curl_stream_read(php_stream *stream, char *buf, size_t count T
curlstream->readbuffer.readpos = php_stream_tell(curlstream->readbuffer.buf);
}
+
+ if (didread == 0) {
+ stream->eof = 1;
+ }
+
return didread;
}