The fifth parameter to fsockopen is the number of seconds
to wait before declaring the connection a failure. When not
provided it defaults to the php ini value of 'default_socket_timeout'
which is 60s. Under no circumstances should we wait 60s to
connect to ourselves, 100ms seems like a reasonable timeout
since its explicitly connecting to itself, but the exact timeout
could be slightly longer.
Change-Id: I18d328274ddf1e0848fce40ebf39e0466b5c4d5d
$info['host'],
isset( $info['port'] ) ? $info['port'] : 80,
$errno,
- $errstr
+ $errstr,
+ // If it takes more than 100ms to connect to ourselves there
+ // is a problem elsewhere.
+ 0.1
);
wfRestoreWarnings();
if ( !$sock ) {