Minor performance improvement to Response.

Now that we have conditional handling of content(), I added a
tweak to slightly improve CURL performance.
This commit is contained in:
Technosophos 2012-05-31 10:27:39 -05:00
parent efff5a1673
commit 7451d92e29

View File

@ -177,12 +177,13 @@ class Response {
}
}
else {
while (!feof($this->handle)) {
$out .= fread($this->handle, 8192);
}
// XXX: This works fine with CURL, but will not
// work with PHP HTTP Stream Wrapper b/c the
// wrapper has a bug that will cause this to
// hang.
$out = stream_get_contents($this->handle);
}
// Should we close or rewind?
// Cannot rewind PHP HTTP streams.
fclose($this->handle);