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

Method Read

library/cpp/neh/https.cpp:890–920  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

888 }
889
890 int Read(char* data, size_t dlen, size_t* readbytes) override {
891 if (Y_UNLIKELY(!Cont_)) {
892 return -1;
893 }
894
895 if (!Canceled_) {
896 while (true) {
897 auto done = NCoro::ReadI(Cont_, S_, data, dlen);
898 if (EAGAIN != done.Status()) {
899 *readbytes = done.Processed();
900 return 1;
901 }
902 }
903 }
904
905 while (true) {
906 if (*Canceled_) {
907 return SSL_RVAL_TIMEOUT;
908 }
909
910 TContIOStatus ioStat(NCoro::ReadT(Cont_, S_, data, dlen, Timeout_));
911 if (ioStat.Status() == ETIMEDOUT) {
912 //increase to 1.5 times every iteration (to 1sec floor)
913 Timeout_ = TDuration::MicroSeconds(Min<ui64>(1000000, Timeout_.MicroSeconds() + (Timeout_.MicroSeconds() >> 1)));
914 continue;
915 }
916
917 *readbytes = ioStat.Processed();
918 return 1;
919 }
920 }
921
922 int Puts(const char* buf) override {
923 Y_UNUSED(buf);

Callers 7

NextMethod · 0.45
WaitMethod · 0.45
TUdpHttpRequestMethod · 0.45
TUdpHttpResponseMethod · 0.45
ReadAllFunction · 0.45
ResetMethod · 0.45

Calls 6

ReadIFunction · 0.85
ReadTFunction · 0.85
MicroSecondsFunction · 0.85
ProcessedMethod · 0.80
StatusMethod · 0.45
MicroSecondsMethod · 0.45

Tested by

no test coverage detected