diff options
author | Mario <mario@mariovavti.com> | 2020-11-05 08:46:42 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2020-11-05 08:46:42 +0000 |
commit | bafbf0416462c6f18c3fb6c8c06a063c8d6fdae6 (patch) | |
tree | 8929845be585b09d0f420621281c5531e1efad3e /vendor/sabre/http/lib | |
parent | 6f93d9848c43019d43ea76c27d42d657ba031cd7 (diff) | |
parent | fdefa101d84dc2a9424eaedbdb003a4c30ec5d01 (diff) | |
download | volse-hubzilla-5.0.tar.gz volse-hubzilla-5.0.tar.bz2 volse-hubzilla-5.0.zip |
Merge branch '5.0RC'5.0
Diffstat (limited to 'vendor/sabre/http/lib')
-rw-r--r-- | vendor/sabre/http/lib/Client.php | 2 | ||||
-rw-r--r-- | vendor/sabre/http/lib/Message.php | 2 | ||||
-rw-r--r-- | vendor/sabre/http/lib/MessageDecoratorTrait.php | 2 | ||||
-rw-r--r-- | vendor/sabre/http/lib/MessageInterface.php | 2 | ||||
-rw-r--r-- | vendor/sabre/http/lib/ResponseDecorator.php | 2 | ||||
-rw-r--r-- | vendor/sabre/http/lib/Sapi.php | 12 | ||||
-rw-r--r-- | vendor/sabre/http/lib/Version.php | 2 | ||||
-rw-r--r-- | vendor/sabre/http/lib/functions.php | 15 |
8 files changed, 12 insertions, 27 deletions
diff --git a/vendor/sabre/http/lib/Client.php b/vendor/sabre/http/lib/Client.php index 48862e7da..b79c564da 100644 --- a/vendor/sabre/http/lib/Client.php +++ b/vendor/sabre/http/lib/Client.php @@ -450,8 +450,6 @@ class Client extends EventEmitter * * http_code - HTTP status code, as an int. Only set if Only set if * status is STATUS_SUCCESS, or STATUS_HTTPERROR * - * @param array $headerLines - * @param string $body * @param resource $curlHandle */ protected function parseCurlResponse(array $headerLines, string $body, $curlHandle): array diff --git a/vendor/sabre/http/lib/Message.php b/vendor/sabre/http/lib/Message.php index fc34f8d7f..90153fda5 100644 --- a/vendor/sabre/http/lib/Message.php +++ b/vendor/sabre/http/lib/Message.php @@ -283,8 +283,6 @@ abstract class Message implements MessageInterface /** * Returns the HTTP version. - * - * @return string */ public function getHttpVersion(): string { diff --git a/vendor/sabre/http/lib/MessageDecoratorTrait.php b/vendor/sabre/http/lib/MessageDecoratorTrait.php index d5504ac78..6f49dadfc 100644 --- a/vendor/sabre/http/lib/MessageDecoratorTrait.php +++ b/vendor/sabre/http/lib/MessageDecoratorTrait.php @@ -180,8 +180,6 @@ trait MessageDecoratorTrait * The specified header name must be treated as case-insensitive. * This method should return true if the header was successfully deleted, * and false if the header did not exist. - * - * @return bool */ public function removeHeader(string $name): bool { diff --git a/vendor/sabre/http/lib/MessageInterface.php b/vendor/sabre/http/lib/MessageInterface.php index 8070845d9..8504f0f59 100644 --- a/vendor/sabre/http/lib/MessageInterface.php +++ b/vendor/sabre/http/lib/MessageInterface.php @@ -29,8 +29,6 @@ interface MessageInterface * * Note that because the underlying data may be based on a stream, this * method could only work correctly the first time. - * - * @return string */ public function getBodyAsString(): string; diff --git a/vendor/sabre/http/lib/ResponseDecorator.php b/vendor/sabre/http/lib/ResponseDecorator.php index 289dba5cc..5f9fe7c65 100644 --- a/vendor/sabre/http/lib/ResponseDecorator.php +++ b/vendor/sabre/http/lib/ResponseDecorator.php @@ -64,8 +64,6 @@ class ResponseDecorator implements ResponseInterface * Serializes the request object as a string. * * This is useful for debugging purposes. - * - * @return string */ public function __toString(): string { diff --git a/vendor/sabre/http/lib/Sapi.php b/vendor/sabre/http/lib/Sapi.php index 80254f3f3..73674a5a1 100644 --- a/vendor/sabre/http/lib/Sapi.php +++ b/vendor/sabre/http/lib/Sapi.php @@ -99,7 +99,7 @@ class Sapi // If this is a partial response, flush the beginning bytes until the first position that is a multiple of the page size. $contentRange = $response->getHeader('Content-Range'); // Matching "Content-Range: bytes 1234-5678/7890" - if (null !== $contentRange && preg_match('/^bytes\s([0-9]*)-([0-9]*)\//i', $contentRange, $matches) && '' !== $matches[1]) { + if (null !== $contentRange && preg_match('/^bytes\s([0-9]+)-([0-9]+)\//i', $contentRange, $matches)) { // 4kB should be the default page size on most architectures $pageSize = 4096; $offset = (int) $matches[1]; @@ -109,7 +109,15 @@ class Sapi } } while ($left > 0) { - $left -= stream_copy_to_stream($body, $output, min($left, $chunk_size)); + $copied = stream_copy_to_stream($body, $output, min($left, $chunk_size)); + // stream_copy_to_stream($src, $dest, $maxLength) must return the number of bytes copied or false in case of failure + // But when the $maxLength is greater than the total number of bytes remaining in the stream, + // It returns the negative number of bytes copied + // So break the loop in such cases. + if ($copied <= 0) { + break; + } + $left -= $copied; } } else { // workaround for 32 Bit systems to avoid stream_copy_to_stream diff --git a/vendor/sabre/http/lib/Version.php b/vendor/sabre/http/lib/Version.php index 20a401773..8946a46a6 100644 --- a/vendor/sabre/http/lib/Version.php +++ b/vendor/sabre/http/lib/Version.php @@ -16,5 +16,5 @@ class Version /** * Full version number. */ - const VERSION = '5.0.4'; + const VERSION = '5.1.0'; } diff --git a/vendor/sabre/http/lib/functions.php b/vendor/sabre/http/lib/functions.php index 197a9e661..a23840a1a 100644 --- a/vendor/sabre/http/lib/functions.php +++ b/vendor/sabre/http/lib/functions.php @@ -29,8 +29,6 @@ use InvalidArgumentException; * See: * http://tools.ietf.org/html/rfc7231#section-7.1.1.1 * - * @param string $dateString - * * @return bool|DateTime */ function parseDate(string $dateString) @@ -75,10 +73,6 @@ function parseDate(string $dateString) /** * Transforms a DateTime object to a valid HTTP/1.1 Date header value. - * - * @param DateTime $dateTime - * - * @return string */ function toDate(DateTime $dateTime): string { @@ -107,7 +101,6 @@ function toDate(DateTime $dateTime): string * implying that no accept header was sent. * * @param string|null $acceptHeaderValue - * @param array $availableOptions * * @return string|null */ @@ -218,8 +211,6 @@ function negotiateContentType($acceptHeaderValue, array $availableOptions) * uses them. * * @param string|string[] $input - * - * @return array */ function parsePrefer($input): array { @@ -303,7 +294,7 @@ function getHeaderValues($values, $values2 = null): array $values = array_merge($values, (array) $values2); } - $result = array(); + $result = []; foreach ($values as $l1) { foreach (explode(',', $l1) as $l2) { $result[] = trim($l2); @@ -320,10 +311,6 @@ function getHeaderValues($values, $values2 = null): array * 2. subtype * 3. quality * 4. parameters - * - * @param string $str - * - * @return array */ function parseMimeType(string $str): array { |