| 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); |
no test coverage detected