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

Method PollReadT

library/cpp/neh/https.cpp:961–985  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

959 }
960
961 int PollReadT(const TDuration& timeout) {
962 if (!Connection_) {
963 return -1;
964 }
965
966 while (true) {
967 const int rpoll = Connection_->PollT(CONT_POLL_READ, timeout);
968 if (!Ssl_ || rpoll) {
969 return rpoll;
970 }
971
972 char c = 0;
973 const int rpeek = SSL_peek(Ssl_.Get(), &c, sizeof(c));
974 if (rpeek < 0) {
975 return -1;
976 } else if (rpeek > 0) {
977 return 0;
978 } else {
979 if ((SSL_get_shutdown(Ssl_.Get()) & SSL_RECEIVED_SHUTDOWN) != 0) {
980 Shutdown(); // wait until shutdown is finished
981 return EIO;
982 }
983 }
984 }
985 }
986
987 void Shutdown() {
988 if (Ssl_ && Connection_) {

Callers 1

operator()Method · 0.80

Calls 3

PollTMethod · 0.80
ShutdownFunction · 0.50
GetMethod · 0.45

Tested by

no test coverage detected