MCPcopy Create free account
hub / github.com/catboost/catboost / OnResponse

Method OnResponse

library/cpp/neh/http2.cpp:1233–1261  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1231 }
1232
1233 void THttpRequest::OnResponse(TAutoPtr<THttpParser>& rsp) {
1234 DBGOUT("THttpRequest::OnResponse()");
1235 ReleaseConn();
1236 if (Y_LIKELY(IsNotError(rsp->RetCode()))) {
1237 NotifyResponse(rsp->DecodedContent(), rsp->FirstLine(), rsp->Headers());
1238 } else {
1239 TString message;
1240
1241 if (THttp2Options::FullHeadersAsErrorMessage) {
1242 TStringStream err;
1243 err << rsp->FirstLine();
1244
1245 THttpHeaders hdrs = rsp->Headers();
1246 for (auto h = hdrs.begin(); h < hdrs.end(); h++) {
1247 err << h->ToString() << TStringBuf("\r\n");
1248 }
1249
1250 message = err.Str();
1251 } else if (THttp2Options::UseResponseAsErrorMessage) {
1252 message = rsp->DecodedContent();
1253 } else {
1254 TStringStream err;
1255 err << TStringBuf("request failed(") << rsp->FirstLine() << TStringBuf(")");
1256 message = err.Str();
1257 }
1258
1259 NotifyError(new TError(message, TError::ProtocolSpecific, rsp->RetCode()), rsp.Get());
1260 }
1261 }
1262
1263 void THttpRequest::OnConnectFailed(THttpConn* c, const TErrorCode& ec) {
1264 DBGOUT("THttpRequest::OnConnectFailed()");

Callers 1

OnReadSomeMethod · 0.45

Calls 7

IsNotErrorFunction · 0.85
RetCodeMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
ToStringMethod · 0.45
StrMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected