Skip to content

Commit c1a44d6

Browse files
[HttpClient] Fix merge
1 parent 5bce0a6 commit c1a44d6

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,17 @@ public function __construct(
8989
$info['max_duration'] = $options['max_duration'];
9090
$info['debug'] = '';
9191

92+
$resolve = static function (string $host, ?string $ip = null) use ($multi): ?string {
93+
if (null !== $ip) {
94+
$multi->dnsCache[$host] = $ip;
95+
}
96+
97+
return $multi->dnsCache[$host] ?? null;
98+
};
9299
$onProgress = $options['on_progress'] ?? static function () {};
93-
$onProgress = $this->onProgress = static function () use (&$info, $onProgress) {
100+
$onProgress = $this->onProgress = static function () use (&$info, $onProgress, $resolve) {
94101
$info['total_time'] = microtime(true) - $info['start_time'];
95-
$onProgress((int) $info['size_download'], ((int) (1 + $info['download_content_length']) ?: 1) - 1, (array) $info);
102+
$onProgress((int) $info['size_download'], ((int) (1 + $info['download_content_length']) ?: 1) - 1, (array) $info, $resolve);
96103
};
97104

98105
$pause = 0.0;

0 commit comments

Comments
 (0)