mirror of
https://github.com/danog/MadelineProto.git
synced 2024-11-27 03:14:39 +01:00
Fix
This commit is contained in:
parent
7a3822e0cc
commit
2c9eb73566
@ -264,21 +264,11 @@ final class Connection
|
||||
}
|
||||
$this->httpReqCount = 0;
|
||||
$this->httpResCount = 0;
|
||||
if (!isset($this->writer)) {
|
||||
$this->writer = new WriteLoop($this);
|
||||
}
|
||||
if (!isset($this->reader)) {
|
||||
$this->reader = new ReadLoop($this);
|
||||
}
|
||||
if (!isset($this->checker)) {
|
||||
$this->checker = new CheckLoop($this);
|
||||
}
|
||||
if (!isset($this->cleanup)) {
|
||||
$this->cleanup = new CleanupLoop($this);
|
||||
}
|
||||
if (!isset($this->waiter)) {
|
||||
$this->waiter = new HttpWaitLoop($this);
|
||||
}
|
||||
$this->writer ??= new WriteLoop($this);
|
||||
$this->reader ??= new ReadLoop($this);
|
||||
$this->checker ??= new CheckLoop($this);
|
||||
$this->cleanup ??= new CleanupLoop($this);
|
||||
$this->waiter ??= new HttpWaitLoop($this);
|
||||
if (!isset($this->pinger) && !$this->ctx->isMedia() && !$this->ctx->isCDN()) {
|
||||
$this->pinger = new PingLoop($this);
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ trait Files
|
||||
throw new Exception("Wrong status code: {$status} ".$response->getReason());
|
||||
}
|
||||
$mime = \trim(\explode(';', $response->getHeader('content-type') ?? 'application/octet-stream')[0]);
|
||||
$size = $response->getHeader('content-length') ?? $size;
|
||||
$size = (int) ($response->getHeader('content-length') ?? $size);
|
||||
$stream = $response->getBody();
|
||||
if (!$size) {
|
||||
$this->logger->logger("No content length for {$url}, caching first");
|
||||
|
Loading…
Reference in New Issue
Block a user