From 900db9c15675a4ada6d6f07f32d1dc470a85fea8 Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Mon, 1 Jul 2024 23:51:08 +1200 Subject: [PATCH] Upgrade Http::Stream::DeferredParams::reply as well --- src/client_side.cc | 2 +- src/http/Stream.cc | 5 ++--- src/http/Stream.h | 4 ++-- src/tests/stub_libhttp.cc | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/client_side.cc b/src/client_side.cc index 2ec12ddca1f..7d4f4d6d9f3 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -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); } diff --git a/src/http/Stream.cc b/src/http/Stream.cc index d1c0e30dcff..7e2195d23de 100644 --- a/src/http/Stream.cc +++ b/src/http/Stream.cc @@ -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() @@ -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; } diff --git a/src/http/Stream.h b/src/http/Stream.h index 5378e1e3f52..5a66dd2441d 100644 --- a/src/http/Stream.h +++ b/src/http/Stream.h @@ -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 @@ -149,7 +149,7 @@ class Stream : public RefCountable public: clientStreamNode *node; - HttpReply *rep; + HttpReplyPointer reply; StoreIOBuffer queuedBuffer; }; diff --git a/src/tests/stub_libhttp.cc b/src/tests/stub_libhttp.cc index 74e525bad7a..c61300df59d 100644 --- a/src/tests/stub_libhttp.cc +++ b/src/tests/stub_libhttp.cc @@ -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 }