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

Method DoRun

library/cpp/neh/https.cpp:1412–1449  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1410 }
1411
1412 void DoRun(TCont* c) override {
1413 THolder<TWrite> This(this);
1414
1415 try {
1416 TContBIOWatcher w(*IO_, c);
1417
1418 PrepareSocket(IO_->Socket());
1419
1420 char buf[128];
1421 TMemoryOutput mo(buf, sizeof(buf));
1422
1423 mo << TStringBuf("HTTP/1.1 ");
1424 if (HttpCode_) {
1425 mo << HttpCodeStrEx(HttpCode_);
1426 } else {
1427 WriteHttpCode(mo, Error_);
1428 }
1429 mo << TStringBuf("\r\n");
1430
1431 if (!CompressionScheme_.empty()) {
1432 WriteHeader(mo, TStringBuf("Content-Encoding"), TStringBuf(CompressionScheme_));
1433 }
1434 WriteHeader(mo, TStringBuf("Connection"), TStringBuf("Keep-Alive"));
1435 WriteHeader(mo, TStringBuf("Content-Length"), size());
1436
1437 mo << Headers_;
1438
1439 mo << TStringBuf("\r\n");
1440
1441 IO_->Write(buf, mo.Buf() - buf);
1442 if (size()) {
1443 IO_->Write(data(), size());
1444 }
1445
1446 Server_->Enqueue(new TRead(IO_, Server_));
1447 } catch (...) {
1448 }
1449 }
1450
1451 private:
1452 const TString CompressionScheme_;

Callers

nothing calls this directly

Calls 10

HttpCodeStrExFunction · 0.85
PrepareSocketFunction · 0.70
WriteHeaderFunction · 0.50
sizeFunction · 0.50
dataFunction · 0.50
SocketMethod · 0.45
emptyMethod · 0.45
WriteMethod · 0.45
BufMethod · 0.45
EnqueueMethod · 0.45

Tested by

no test coverage detected