Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrected docs and default connect timeout value to 300 seconds #3075

Merged
merged 3 commits into from May 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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