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

Method AddRequest

library/cpp/http/server/http.cpp:290–318  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

288 }
289
290 void AddRequest(TAutoPtr<TClientRequest> req, bool fail) {
291 struct TFailRequest: public THttpClientRequestEx {
292 inline TFailRequest(TAutoPtr<TClientRequest> parent) {
293 Conn_.Reset(parent->Conn_.Release());
294 HttpConn_.Reset(parent->HttpConn_.Release());
295 }
296
297 bool Reply(void*) override {
298 if (!ProcessHeaders()) {
299 return true;
300 }
301
302 ProcessFailRequest(0);
303 return true;
304 }
305 };
306
307 if (!fail && Requests->Add(req.Get())) {
308 Y_UNUSED(req.Release());
309 } else {
310 req = new TFailRequest(req);
311
312 if (FailRequests->Add(req.Get())) {
313 Y_UNUSED(req.Release());
314 } else {
315 Cb_->OnFailRequest(-1);
316 }
317 }
318 }
319
320 size_t GetRequestQueueSize() const {
321 return Requests->Size();

Callers 1

OnPollEventMethod · 0.45

Calls 5

Y_UNUSEDFunction · 0.85
OnFailRequestMethod · 0.80
AddMethod · 0.45
GetMethod · 0.45
ReleaseMethod · 0.45

Tested by

no test coverage detected