Skip to content

Commit a26bce5

Browse files
hanidamlajfacebook-github-bot
authored andcommitted
delete HTTPSink::safeToUpgrade
Summary: * continuining efforts to clean up the codebase and deprecating http/1.1 -> http/2 plaintext upgrades * removed the only usage of ::safeToUpgrade in D76834276, we can now remove all instances of the overriden virtual fn Reviewed By: kwaugh Differential Revision: D77604276 fbshipit-source-id: efea5c00a5fb1301555f36b2f191fb4fd4096c8c
1 parent 20aeaea commit a26bce5

File tree

5 files changed

+0
-35
lines changed

5 files changed

+0
-35
lines changed

third-party/proxygen/src/proxygen/lib/http/sink/HTTPConnectSink.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,6 @@ class HTTPConnectSink
159159
void setIdleTimeout(std::chrono::milliseconds timeout) override;
160160

161161
// Capabilities
162-
bool safeToUpgrade(HTTPMessage*) const override {
163-
return false;
164-
}
165-
166162
[[nodiscard]] bool supportsPush() const override {
167163
return false;
168164
}

third-party/proxygen/src/proxygen/lib/http/sink/HTTPSink.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ class HTTPSink {
9191
virtual void timeoutExpired() = 0;
9292
virtual void setIdleTimeout(std::chrono::milliseconds timeout) = 0;
9393
// Capabilities
94-
virtual bool safeToUpgrade(HTTPMessage* req) const = 0;
9594
[[nodiscard]] virtual bool supportsPush() const = 0;
9695
// Logging
9796
virtual void describe(std::ostream& os) = 0;

third-party/proxygen/src/proxygen/lib/http/sink/HTTPTransactionSink.cpp

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -47,29 +47,4 @@ quic::QuicSocket* HTTPTransactionSink::getQUICTransport() const {
4747
return nullptr;
4848
}
4949

50-
bool HTTPTransactionSink::safeToUpgrade(HTTPMessage* req) const {
51-
// There's a race condition if we haven't seen the end of a POST
52-
// terminated by content-length. If that's the case, don't request an upgrade
53-
// on this connection. We can live with a little HTTP/1.1 for now.
54-
55-
// Because HTTP/2 and HTTP/3 reported "chunked" messages for requests that
56-
// will see DATA frames, the only unsafe type of request is HTTP/1.1 with
57-
// Content-Length terminated body. We could force this to use chunked
58-
// encoding to make it safe, but for now we won't.
59-
60-
// One subtle case here is a pure HTTP/1.1 GET request with no body. It is
61-
// safeToUpgrade per this function, but it relies on the fact that the
62-
// resumeIngress call after sendingHeaders will trigger onClientEOM
63-
// immediately, causing the sendEOM to happen before the 101 response arrives
64-
65-
// And because we force chunk this request, it can't be a MUST not have body
66-
if (req && RFC2616::isRequestBodyAllowed(req->getMethod()) ==
67-
RFC2616::BodyAllowed::NOT_ALLOWED) {
68-
return false;
69-
}
70-
return (httpTransaction_ && httpTransaction_->isIngressEOMSeen()) ||
71-
(req && (!req->getHeaders().exists(HTTP_HEADER_CONTENT_LENGTH) ||
72-
req->getIsChunked()));
73-
}
74-
7550
} // namespace proxygen

third-party/proxygen/src/proxygen/lib/http/sink/HTTPTransactionSink.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ class HTTPTransactionSink : public HTTPSink {
156156
httpTransaction_->setIdleTimeout(timeout);
157157
}
158158
// Capabilities
159-
bool safeToUpgrade(HTTPMessage* req) const override;
160159
[[nodiscard]] bool supportsPush() const override {
161160
return true;
162161
}

third-party/proxygen/src/proxygen/lib/http/sink/HTTPTunnelSink.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,6 @@ class HTTPTunnelSink
159159
void setIdleTimeout(std::chrono::milliseconds timeout) override;
160160

161161
// Capabilities
162-
bool safeToUpgrade(HTTPMessage*) const override {
163-
return false;
164-
}
165-
166162
[[nodiscard]] bool supportsPush() const override {
167163
return false;
168164
}

0 commit comments

Comments
 (0)