Skip to content

Commit

Permalink
Corrected docs and default connect timeout value to 300 seconds (#3075)
Browse files Browse the repository at this point in the history
Co-authored-by: Graham Campbell <GrahamCampbell@users.noreply.github.com>
  • Loading branch information
aivus and GrahamCampbell committed May 14, 2023
1 parent 15c3f69 commit 39ad11f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/request-options.rst
Expand Up @@ -282,7 +282,7 @@ connect_timeout
---------------

:Summary: Float describing the number of seconds to wait while trying to connect
to a server. Use ``0`` to wait indefinitely (the default behavior).
to a server. Use ``0`` to wait 300 seconds (the default behavior).
:Types: float
:Default: ``0``
:Constant: ``GuzzleHttp\RequestOptions::CONNECT_TIMEOUT``
Expand Down
2 changes: 1 addition & 1 deletion src/Handler/CurlFactory.php
Expand Up @@ -224,7 +224,7 @@ private function getDefaultConf(EasyHandle $easy): array
\CURLOPT_URL => (string) $easy->request->getUri()->withFragment(''),
\CURLOPT_RETURNTRANSFER => false,
\CURLOPT_HEADER => false,
\CURLOPT_CONNECTTIMEOUT => 150,
\CURLOPT_CONNECTTIMEOUT => 300,
];

if (\defined('CURLOPT_PROTOCOLS')) {
Expand Down
2 changes: 1 addition & 1 deletion src/RequestOptions.php
Expand Up @@ -70,7 +70,7 @@ final class RequestOptions
/**
* connect_timeout: (float, default=0) Float describing the number of
* seconds to wait while trying to connect to a server. Use 0 to wait
* indefinitely (the default behavior).
* 300 seconds (the default behavior).
*/
public const CONNECT_TIMEOUT = 'connect_timeout';

Expand Down
2 changes: 1 addition & 1 deletion tests/Handler/CurlFactoryTest.php
Expand Up @@ -66,7 +66,7 @@ public function testCreatesCurlHandle()
self::assertSame('testing', $_SERVER['_curl'][\CURLOPT_POSTFIELDS]);
self::assertEquals(0, $_SERVER['_curl'][\CURLOPT_RETURNTRANSFER]);
self::assertEquals(0, $_SERVER['_curl'][\CURLOPT_HEADER]);
self::assertSame(150, $_SERVER['_curl'][\CURLOPT_CONNECTTIMEOUT]);
self::assertSame(300, $_SERVER['_curl'][\CURLOPT_CONNECTTIMEOUT]);
self::assertInstanceOf('Closure', $_SERVER['_curl'][\CURLOPT_HEADERFUNCTION]);
if (\defined('CURLOPT_PROTOCOLS')) {
self::assertSame(
Expand Down

0 comments on commit 39ad11f

Please sign in to comment.