-
-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Call to a member function promise() on null #319
Comments
This this an issue you can reproduce? |
I don't know how to reproduce this, it happends everyday on my server, not many. |
Still happends.
|
I have make a little change to make sure not get a null Add code after (before write or read some in async) https://github.com/amphp/http-client/blob/4.x/src/Connection/Internal/Http2ConnectionProcessor.php#L1125 $pendingResponse = $http2stream->pendingResponse; return yield $pendingResponse->promise(); Now the error has turned into a different kind of situation:
|
I was upload through http proxy with
When remove force protocol setting, it will stuck at if ($windowSize > 0) {
// Read next body chunk if less than 8192 bytes will remain in the buffer
if ($length - 8192 < $windowSize && $stream->windowSizeIncrease) {
$deferred = $stream->windowSizeIncrease;
$stream->windowSizeIncrease = null;
$deferred->resolve();
}
$data = $stream->requestBodyBuffer;
$end = $windowSize - $this->frameSizeLimit;
$stream->clientWindow -= $windowSize;
$this->clientWindow -= $windowSize;
for ($off = 0; $off < $end; $off += $this->frameSizeLimit) {
$this->writeFrame(
Http2Parser::DATA,
Http2Parser::NO_FLAG,
$stream->id,
\substr($data, $off, $this->frameSizeLimit)
);
}
//stuck at writeFrame here:
$promise = $this->writeFrame(
Http2Parser::DATA,
Http2Parser::NO_FLAG,
$stream->id,
\substr($data, $off, $windowSize - $off)
);
$stream->requestBodyBuffer = \substr($data, $windowSize);
$stream->enableInactivityWatcher();
return $promise;
} |
It's be a little strange, sometime it's just stuck there, sometimes it throw error |
It's a weird problem
But I see there is check on the code https://github.com/amphp/http-client/blob/4.x/src/Connection/Internal/Http2ConnectionProcessor.php#L1165
The text was updated successfully, but these errors were encountered: