Skip to content

Commit 2252366

Browse files
Sharad Jaiswal (Eng)facebook-github-bot
Sharad Jaiswal (Eng)
authored andcommitted
Adding RequestHeadersComplete event for HTTPTransactionObserver
Summary: Add REQUEST_HEADERS_COMPLETE as a transaction byte event, to mark the start of an HTTP Request (corresponds to the HTTPSessionObserver RequestStart event) Reviewed By: metaduc Differential Revision: D73543450 Privacy Context Container: L1201441 fbshipit-source-id: ef37fc212eb35919d27250e31d82851ed2af2619
1 parent 8a7890a commit 2252366

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

proxygen/lib/http/observer/HTTPTransactionObserverInterface.h

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class HTTPTransactionObserverInterface {
2929

3030
struct TxnBytesEvent {
3131
enum class Type : uint8_t {
32+
REQUEST_HEADERS_COMPLETE,
3233
FIRST_HEADER_BYTE_WRITE,
3334
FIRST_BODY_BYTE_WRITE,
3435
FIRST_BODY_BYTE_ACK,

proxygen/lib/http/session/HTTPTransaction.cpp

+16
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,22 @@ void HTTPTransaction::onIngressHeadersComplete(
252252
if (transportCallback_) {
253253
transportCallback_->headerBytesReceived(msg->getIngressHeaderSize());
254254
}
255+
256+
if (txnObserverContainer_.hasObserversForEvent<
257+
HTTPTransactionObserverInterface::Events::TxnBytes>()) {
258+
const auto e =
259+
HTTPTransactionObserverInterface::TxnBytesEvent::Builder()
260+
.setTimestamp(proxygen::SteadyClock::now())
261+
.setType(HTTPTransactionObserverInterface::TxnBytesEvent::Type::
262+
REQUEST_HEADERS_COMPLETE)
263+
.build();
264+
txnObserverContainer_.invokeInterfaceMethod<
265+
HTTPTransactionObserverInterface::Events::TxnBytes>(
266+
[&e](auto observer, auto observed) {
267+
observer->onBytesEvent(observed, e);
268+
});
269+
}
270+
255271
updateIngressCompressionInfo(transport_.getCodec().getCompressionInfo());
256272
if (mustQueueIngress()) {
257273
checkCreateDeferredIngress();

0 commit comments

Comments
 (0)