Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions src/Monolog/Handler/Curl/Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ final class Util
* @param CurlHandle $ch curl handler
* @return bool|string @see curl_exec
*/
public static function execute(CurlHandle $ch, int $retries = 5, bool $closeAfterDone = true): bool|string
public static function execute(CurlHandle $ch, int $retries = 5): bool|string
{
while ($retries > 0) {
$retries--;
Expand All @@ -48,19 +48,11 @@ public static function execute(CurlHandle $ch, int $retries = 5, bool $closeAfte
if (false === \in_array($curlErrno, self::$retriableErrorCodes, true) || $retries === 0) {
$curlError = curl_error($ch);

if ($closeAfterDone) {
curl_close($ch);
}

throw new \RuntimeException(sprintf('Curl error (code %d): %s', $curlErrno, $curlError));
}
continue;
}

if ($closeAfterDone) {
curl_close($ch);
}

return $curlResponse;
}
return false;
Expand Down
2 changes: 1 addition & 1 deletion src/Monolog/Handler/LogglyHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ protected function send(string $data, string $endpoint): void
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

Curl\Util::execute($ch, 5, false);
Curl\Util::execute($ch, 5);
}

protected function getDefaultFormatter(): FormatterInterface
Expand Down