@@ -114,6 +114,17 @@ class TIncomingConnectionActor : public TActor<TIncomingConnectionActor<TSocketI
114114 OnAccept ();
115115 }
116116
117+ TString GetRequestDebugText () {
118+ TStringBuilder text;
119+ if (CurrentRequest) {
120+ text << CurrentRequest->Method << " " << CurrentRequest->URL ;
121+ if (CurrentRequest->Body ) {
122+ text << " , " << CurrentRequest->Body .Size () << " bytes" ;
123+ }
124+ }
125+ return text;
126+ }
127+
117128 void HandleConnected (TEvPollerReady::TPtr& event) {
118129 if (event->Get ()->Read ) {
119130 for (;;) {
@@ -142,7 +153,7 @@ class TIncomingConnectionActor : public TActor<TIncomingConnectionActor<TSocketI
142153 CurrentRequest->Timer .Reset ();
143154 if (CurrentRequest->IsReady ()) {
144155 if (Endpoint->RateLimiter .Check (TActivationContext::Now ())) {
145- ALOG_DEBUG (HttpLog, " (#" << TSocketImpl::GetRawSocket () << " ," << Address << " ) -> (" << CurrentRequest-> Method << " " << CurrentRequest-> URL << " )" );
156+ ALOG_DEBUG (HttpLog, " (#" << TSocketImpl::GetRawSocket () << " ," << Address << " ) -> (" << GetRequestDebugText () << " )" );
146157 Send (Endpoint->Proxy , new TEvHttpProxy::TEvHttpIncomingRequest (CurrentRequest));
147158 CurrentRequest = nullptr ;
148159 } else {
@@ -153,7 +164,7 @@ class TIncomingConnectionActor : public TActor<TIncomingConnectionActor<TSocketI
153164 CleanupRequest (CurrentRequest);
154165 }
155166 } else if (CurrentRequest->IsError ()) {
156- ALOG_DEBUG (HttpLog, " (#" << TSocketImpl::GetRawSocket () << " ," << Address << " ) -! (" << CurrentRequest-> Method << " " << CurrentRequest-> URL << " )" );
167+ ALOG_DEBUG (HttpLog, " (#" << TSocketImpl::GetRawSocket () << " ," << Address << " ) -! (" << GetRequestDebugText () << " )" );
157168 bool success = Respond (CurrentRequest->CreateResponseBadRequest ());
158169 if (!success) {
159170 return ;
@@ -209,6 +220,31 @@ class TIncomingConnectionActor : public TActor<TIncomingConnectionActor<TSocketI
209220 Respond (event->Get ()->Response );
210221 }
211222
223+ static TString GetChunkDebugText (THttpOutgoingDataChunkPtr chunk) {
224+ TStringBuilder text;
225+ if (chunk->DataSize ) {
226+ text << " data chunk " << chunk->DataSize << " bytes" ;
227+ }
228+ if (chunk->DataSize && chunk->IsEndOfData ()) {
229+ text << " , " ;
230+ }
231+ if (chunk->IsEndOfData ()) {
232+ text << " end of stream" ;
233+ }
234+ return text;
235+ }
236+
237+ static TString GetResponseDebugText (THttpOutgoingResponsePtr response) {
238+ TStringBuilder text;
239+ if (response) {
240+ text << response->Status << " " << response->Message ;
241+ if (response->Body ) {
242+ text << " , " << response->Body .Size () << " bytes" ;
243+ }
244+ }
245+ return text;
246+ }
247+
212248 void HandleConnected (TEvHttpProxy::TEvHttpOutgoingDataChunk::TPtr& event) {
213249 if (event->Get ()->Error ) {
214250 ALOG_ERROR (HttpLog, " (#" << TSocketImpl::GetRawSocket () << " ," << Address << " ) connection closed - DataChunk error: " << event->Get ()->Error );
@@ -225,8 +261,7 @@ class TIncomingConnectionActor : public TActor<TIncomingConnectionActor<TSocketI
225261 return PassAway ();
226262 }
227263 }
228- ALOG_DEBUG (HttpLog, " (#" << TSocketImpl::GetRawSocket () << " ," << Address << " ) <- (data chunk "
229- << event->Get ()->DataChunk ->Size () << (event->Get ()->DataChunk ->IsEndOfData () ? " bytes, final)" : " bytes)" ));
264+ ALOG_DEBUG (HttpLog, " (#" << TSocketImpl::GetRawSocket () << " ," << Address << " ) <- (" << GetChunkDebugText (event->Get ()->DataChunk ) << " )" );
230265 if (event->Get ()->DataChunk ->IsEndOfData ()) {
231266 CancelSubscriber = nullptr ;
232267 }
@@ -240,7 +275,7 @@ class TIncomingConnectionActor : public TActor<TIncomingConnectionActor<TSocketI
240275 bool Respond (THttpOutgoingResponsePtr response) {
241276 THttpIncomingRequestPtr request = response->GetRequest ();
242277 ALOG_DEBUG (HttpLog, " (#" << TSocketImpl::GetRawSocket () << " ," << Address << " ) <- ("
243- << response-> Status << " " << response-> Message << (response->IsDone () ? " )" : " ) (incomplete)" ));
278+ << GetResponseDebugText ( response) << (response->IsDone () ? " )" : " ) (incomplete)" ));
244279 if (!response->Status .StartsWith (' 2' ) && !response->Status .StartsWith (' 3' ) && response->Status != " 404" ) {
245280 static constexpr size_t MAX_LOGGED_SIZE = 1024 ;
246281 ALOG_DEBUG (HttpLog,
0 commit comments