Skip to content

Commit

Permalink
Remove multibyte
Browse files Browse the repository at this point in the history
  • Loading branch information
Meldiron committed Aug 13, 2024
1 parent a0447f6 commit 7146eac
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/Orchestration/Adapter/DockerAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,21 +139,21 @@ protected function streamCall(string $url, int $timeout = -1): array
return 0;
}

$originalSize = \mb_strlen($str);
$originalSize = \strlen($str);

while (\mb_strlen($str) > 0) {
while (\strlen($str) > 0) {
if ($isHeader) {
$header = \unpack('Ctype/Cfill1/Cfill2/Cfill3/Nsize', $str);
$str = \mb_strcut($str, 8, null);
$str = \substr($str, 8, null);
$isHeader = false;
$currentHeader = $header;
} else {
$size = $currentHeader['size'];
$type = $currentHeader['type'];

if (\mb_strlen($str) >= $size) {
$currentData .= \mb_strcut($str, 0, $size);
$str = \mb_strcut($str, $size, null);
if (\strlen($str) >= $size) {
$currentData .= \substr($str, 0, $size);
$str = \strcut($str, $size, null);
$isHeader = true;
$currentHeader = null;

Expand All @@ -164,7 +164,7 @@ protected function streamCall(string $url, int $timeout = -1): array
}
$currentData = '';
} else {
$currentHeader['size'] -= \mb_strlen($str);
$currentHeader['size'] -= \strlen($str);
$currentData .= $str;
$str = '';
}
Expand Down

0 comments on commit 7146eac

Please sign in to comment.