Skip to content

Commit

Permalink
Upgrade Http::Stream::DeferredParams::reply as well
Browse files Browse the repository at this point in the history
  • Loading branch information
yadij committed Nov 16, 2024
1 parent 05eaae3 commit 900db9c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/client_side.cc
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,7 @@ ClientSocketContextPushDeferredIfNeeded(Http::StreamPointer deferredRequest, Con
/** defer now. */
clientSocketRecipient(deferredRequest->deferredparams.node,
deferredRequest->http,
deferredRequest->deferredparams.rep,
deferredRequest->deferredparams.reply.getRaw(),
deferredRequest->deferredparams.queuedBuffer);
}

Expand Down
5 changes: 2 additions & 3 deletions src/http/Stream.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ Http::Stream::Stream(const Comm::ConnectionPointer &aConn, ClientHttpRequest *aR
flags.deferred = 0;
flags.parsed_ok = 0;
deferredparams.node = nullptr;
deferredparams.rep = nullptr;
}

Http::Stream::~Stream()
Expand Down Expand Up @@ -554,13 +553,13 @@ Http::Stream::initiateClose(const char *reason)
}

void
Http::Stream::deferRecipientForLater(clientStreamNode *node, HttpReply *rep, StoreIOBuffer receivedData)
Http::Stream::deferRecipientForLater(clientStreamNode *node, const HttpReplyPointer &rep, StoreIOBuffer receivedData)
{
debugs(33, 2, "Deferring request " << http->uri);
assert(flags.deferred == 0);
flags.deferred = 1;
deferredparams.node = node;
deferredparams.rep = rep;
deferredparams.reply = rep;
deferredparams.queuedBuffer = receivedData;
}

Expand Down
4 changes: 2 additions & 2 deletions src/http/Stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class Stream : public RefCountable
/// terminate due to a send/write error (may continue reading)
void initiateClose(const char *reason);

void deferRecipientForLater(clientStreamNode *, HttpReply *, StoreIOBuffer receivedData);
void deferRecipientForLater(clientStreamNode *, const HttpReplyPointer &, StoreIOBuffer receivedData);

public: // HTTP/1.x state data

Expand All @@ -149,7 +149,7 @@ class Stream : public RefCountable

public:
clientStreamNode *node;
HttpReply *rep;
HttpReplyPointer reply;
StoreIOBuffer queuedBuffer;
};

Expand Down
2 changes: 1 addition & 1 deletion src/tests/stub_libhttp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,6 @@ ConnStateData *Stream::getConn() const STUB_RETVAL(nullptr)
void Stream::noteIoError(const Error &, const LogTagsErrors &) STUB
void Stream::finished() STUB
void Stream::initiateClose(const char *) STUB
void Stream::deferRecipientForLater(clientStreamNode *, HttpReply *, StoreIOBuffer) STUB
void Stream::deferRecipientForLater(clientStreamNode *, const HttpReplyPointer &, StoreIOBuffer) STUB
}

0 comments on commit 900db9c

Please sign in to comment.