[wp-trac] [WordPress Trac] #8622: HTTP API Fallover & non-blocking
order doesnt appear to be working
WordPress Trac
wp-trac at lists.automattic.com
Mon Dec 15 13:16:44 GMT 2008
#8622: HTTP API Fallover & non-blocking order doesnt appear to be working
---------------------+------------------------------------------------------
Reporter: DD32 | Owner: anonymous
Type: defect | Status: new
Priority: normal | Milestone: 2.7.1
Component: General | Version: 2.7
Severity: normal | Keywords: has-patch needs-testing
---------------------+------------------------------------------------------
It seem that the _getTransport() and _postTransport() functions are not
falling over to the next available transport upon error, As the If block
only ever matches a single transport.
That also has the effect of the non-blocking priority list being useless
since which ever transport is matched, will be the only one available.
attached patch changes it to test each object, This could have a negitive
downside of making requests take even longer in cases where Slowdowns are
being experienced (ie. 4x 2second delays, 1 for each transport instead of
only 1x 2second delay)
Perhaps some caching needs to be done to not use a transport if its failed
in the last 12 hours, Much like the fsockopen class attempts to do.
Before:
{{{
array
0 => &
object(WP_Http_Curl)[241]
transports: WP_Http_Curl
Requesting http://dd32.id.au/ using WP_Http_Curl took 0.000sWP_Http_Curl
has failed with error:test
}}}
(curl::request returning a dummy error object, in reality, if it fails,
it'll be timing out after 2-4 seconds)[[BR]]
(Aside: I believe this is the root issue on #8590, as it'll attempt to
fire cron on every page load, and doesnt appear to be going into non-
blocking mode in the details on that ticket)
After:
{{{
array
0 => &
object(WP_Http_Curl)[241]
1 => &
object(WP_Http_Streams)[242]
2 => &
object(WP_Http_Fopen)[243]
3 => &
object(WP_Http_Fsockopen)[246]
transports: WP_Http_Curl, WP_Http_Streams, WP_Http_Fopen,
WP_Http_Fsockopen
Requesting http://dd32.id.au/ using WP_Http_Curl took 0.001sWP_Http_Curl
has failed with error:test
Requesting http://dd32.id.au/ using WP_Http_Streams took
0.710sWP_Http_Streams has failed with error:Could not open handle for
fopen() to http://dd32.id.au/
Requesting http://dd32.id.au/ using WP_Http_Fopen took 1.214s
}}}
(thats a var_dump of the available transports at the start there)
jacobsantos: Any feedback?
--
Ticket URL: <http://trac.wordpress.org/ticket/8622>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list