[wp-trac] [WordPress Trac] #13841: Some HTTP Transports do not respect transfer timeouts
WordPress Trac
wp-trac at lists.automattic.com
Fri Jun 11 04:48:30 UTC 2010
#13841: Some HTTP Transports do not respect transfer timeouts
--------------------------+-------------------------------------------------
Reporter: sivel | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 3.1
Component: HTTP | Version: 3.0
Severity: normal | Keywords:
--------------------------+-------------------------------------------------
While doing some testing I found that fopen, fsockopen and streams do not
respect transfer timeouts.
Out fopen transport cannot support a transfer timeout properly because we
do not pass the 3rd optional parameter to fopen for stream context. We
don't do this on purpose because the 3rd parameter was not added until php
5, and that is partially what the streams transport is designed to cover.
So in short, unless we want to conditionally use the streams context here
for php versions > 5, we cannot reliably use transfer timeouts.
The streams timeout was missing the context for timeout, which does
support "microtime". However, unsure at this point why, but the timeout
needs to be divided by 2, so that the timeout happens requested timeout.
With fsockopen, we need to actually test for the timeout during the while
loop, because the stream_set_timeout applies to each pass of fread and not
the total process.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/13841>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list