[wp-trac] [WordPress Trac] #25747: The `http_api_debug` hook isn't called for all HTTP requests (was: The `http_api_debug` hook isn't called when there are no available transports)

WordPress Trac noreply at wordpress.org
Thu Oct 31 01:46:33 UTC 2013


#25747: The `http_api_debug` hook isn't called for all HTTP requests
--------------------------+------------------------------
 Reporter:  johnbillion   |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  HTTP          |     Version:  3.2
 Severity:  minor         |  Resolution:
 Keywords:  needs-patch   |
--------------------------+------------------------------
Changes (by johnbillion):

 * keywords:  has-patch => needs-patch


Old description:

> In `WP_Http::_dispatch_request()`, the `http_api_debug` action isn't
> called if there are no available transports for the request. This means
> we miss a situation that is ripe for debugging.

New description:

 In `WP_Http::_dispatch_request()`, the `http_api_debug` action isn't
 called if there are no available transports for the request. This means we
 miss a situation that is ripe for debugging.

 '''Edit:''' There's more. See my comments below.

--

Comment:

 There are actually several places where an HTTP request's return value
 doesn't trigger the `http_api_debug` action. None of the following
 responses trigger it:

  * Anything short-circuiting requests with the `pre_http_request` filter
 ([http://core.trac.wordpress.org/browser/tags/3.7.1/src/wp-includes/class-
 http.php#L104 here]).
  * Invalid URLs ([http://core.trac.wordpress.org/browser/tags/3.7.1/src
 /wp-includes/class-http.php#L117 here]).
  * Blocked requests
 ([http://core.trac.wordpress.org/browser/tags/3.7.1/src/wp-includes/class-
 http.php#L120 here]).
  * Unwritable directories when streaming
 ([http://core.trac.wordpress.org/browser/tags/3.7.1/src/wp-includes/class-
 http.php#L137 here]).

 We might need a little refactoring here, or a helper method to trigger
 this action.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/25747#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list