Skip to content

Commit a0e10fd

Browse files
committed
bug #52864 [HttpClient][Mailer][Process] always pass microseconds to usleep as integers (xabbuh)
This PR was merged into the 5.4 branch. Discussion ---------- [HttpClient][Mailer][Process] always pass microseconds to usleep as integers | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix #52856 | License | MIT Commits ------- fb0ef06 always pass microseconds to usleep as integers
2 parents 2b10976 + fb0ef06 commit a0e10fd

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/Symfony/Component/HttpClient/Response/AsyncContext.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public function pause(float $duration): void
9292
if (\is_callable($pause = $this->response->getInfo('pause_handler'))) {
9393
$pause($duration);
9494
} elseif (0 < $duration) {
95-
usleep(1E6 * $duration);
95+
usleep((int) (1E6 * $duration));
9696
}
9797
}
9898

src/Symfony/Component/HttpClient/Response/TransportResponseTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ public static function stream(iterable $responses, float $timeout = null): \Gene
303303
}
304304

305305
if (-1 === self::select($multi, min($timeoutMin, $timeoutMax - $elapsedTimeout))) {
306-
usleep(min(500, 1E6 * $timeoutMin));
306+
usleep((int) min(500, 1E6 * $timeoutMin));
307307
}
308308

309309
$elapsedTimeout = microtime(true) - $lastActivity;

src/Symfony/Component/Mailer/Transport/AbstractTransport.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ private function checkThrottling()
104104
$sleep = (1 / $this->rate) - (microtime(true) - $this->lastSent);
105105
if (0 < $sleep) {
106106
$this->logger->debug(sprintf('Email transport "%s" sleeps for %.2f seconds', __CLASS__, $sleep));
107-
usleep($sleep * 1000000);
107+
usleep((int) ($sleep * 1000000));
108108
}
109109
$this->lastSent = microtime(true);
110110
}

src/Symfony/Component/Process/Pipes/WindowsPipes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public function readAndWrite(bool $blocking, bool $close = false): array
149149
if ($w) {
150150
@stream_select($r, $w, $e, 0, Process::TIMEOUT_PRECISION * 1E6);
151151
} elseif ($this->fileHandles) {
152-
usleep(Process::TIMEOUT_PRECISION * 1E6);
152+
usleep((int) (Process::TIMEOUT_PRECISION * 1E6));
153153
}
154154
}
155155
foreach ($this->fileHandles as $type => $fileHandle) {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy