WordPress.org

Make WordPress Core


Ignore:
Timestamp:
06/14/2016 05:29:58 AM (4 years ago)
Author:
rmccue
Message:

HTTP API: Update Requests.

This introduces a minimum value of 1 second for timeouts passed to cURL.

Internally, cURL uses alarm() for interrupts, which accepts a second-resolution timeout. Any values lower than 1 second are instantly failed rather than being rounded upwards. While this makes the experience worse for those using asynchronous DNS lookups, there's no way to detect which DNS resolver is being used from PHP.

See #33055, #8923.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-requests.php

    r37674 r37694  
    305305     *
    306306     * - `timeout`: How long should we wait for a response?
     307     *    Note: for cURL, a minimum of 1 second applies, as DNS resolution
     308     *    operates at second-resolution only.
    307309     *    (float, seconds with a millisecond precision, default: 10, example: 0.01)
    308310     * - `connect_timeout`: How long should we wait while trying to connect?
Note: See TracChangeset for help on using the changeset viewer.