Comments (3)
Found the cause of the issue, and it was that the Proxygen is sending END_STREAM Flag separately in a empty DATA Frame, instead it can send it with the HEADERS Frame itself. Modified it to send END_STREAM Flag within the HEADERS Frame and the issue got resolved.
from proxygen.
Can you share a snippet of your code fix?
There's definitely some friction in proxies because the onHeadersComplete codec callback doesn't include the END_STREAM flag, so it can be challenging to immediately pass through to an upstream without making an assumption (eg: GET == END_STREAM) or delaying an event loop so the onEOM downstream callback fires.
I've even tried fixing this once, but ran into some complications.
from proxygen.
I don't know whether this approach is right or not. But somehow it works for now.
HTTP2Codec.cpp
Line No:520
if (!(curHeader_.flags & http2::END_STREAM)) {
// If it there are DATA frames coming, consider it chunked
msg->setIsChunked(true);
}
This code tells that if the stream ends or not. If it doesn't end the HTTPMessage is set to chunked.
So in ProxyHandler, I am checking whether the CodecProtocol is HTTP2 and HTTPMessage is not chunked, if both conditions satisfy, then sending the Upstream transaction with EOM using sendHeadersWithEOM().
ProxyHandler.cpp
if (txn_->getTransport().getHTTPSessionBase()->getCodecProtocol() == proxygen::CodecProtocol::HTTP_2 &&
downstream_->getTransaction()->getTransport().getHTTPSessionBase()->getCodecProtocol() == proxygen::CodecProtocol::HTTP_2 &&
!request_->getIsChunked()) {
txn_->sendHeadersWithEOM(*request_);
}
else {
txn_->sendHeaders(*request_);
}
This code checks whether both Upstream and Downstream works in HTTP2 and then checks whether the message is chunked which in turn is true if END_STREAM is not set.
Please provide some insights on whether this approach is right or not.
from proxygen.
Related Issues (20)
- Request smuggling vulnerability in Proxygen
- websocket client with SSL problem: Server replied to me "Bad Request" HOT 5
- proxygen fails to build when a newer glog package is installed HOT 1
- Proxygen for iOS HOT 2
- httpserver/samples/websocket
- Ingress Error and drain() HOT 3
- httpserver/samples/websocket
- Segfault in HQ server HOT 2
- Build problems, segfault UT HOT 2
- Remove the use of requiring sudo for installing deps HOT 3
- Proxygen For Windows
- ld: error: undefined reference due to --no-allow-shlib-undefined: vtable for fizz::openssl::OpenSSLECKeyExchange HOT 1
- Link fails: ld: error: undefined reference due to --no-allow-shlib-undefined: typeinfo for snappy::Source
- TLS Renegotiation for Client Certificate
- HTTP2 Protocol Handling HOT 5
- HTTP Parsing Issue HOT 14
- Correct way to implement middleware in proxygen HOT 3
- getdeps.sh fails on windows when applying patch to boost HOT 4
- Issue with HTTP Thread Utilization and Request Backlog Under High Load HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from proxygen.