| 1201 | } |
| 1202 | |
| 1203 | static inline TString ReadAll(THttpInput& in) { |
| 1204 | TString ret; |
| 1205 | ui64 clin; |
| 1206 | |
| 1207 | if (in.GetContentLength(clin)) { |
| 1208 | const size_t cl = SafeIntegerCast<size_t>(clin); |
| 1209 | |
| 1210 | ret.ReserveAndResize(cl); |
| 1211 | size_t sz = in.Load(ret.begin(), cl); |
| 1212 | if (sz != cl) { |
| 1213 | throw yexception() << TStringBuf("not full content: ") << sz << TStringBuf(" bytes from ") << cl; |
| 1214 | } |
| 1215 | } else if (in.HasContent()) { |
| 1216 | TVector<char> buff(9500); //common jumbo frame size |
| 1217 | |
| 1218 | while (size_t len = in.Read(buff.data(), buff.size())) { |
| 1219 | ret.AppendNoAlias(buff.data(), len); |
| 1220 | } |
| 1221 | } |
| 1222 | |
| 1223 | return ret; |
| 1224 | } |
| 1225 | |
| 1226 | template <class TRequestType> |
| 1227 | class THttpsRequest: public IJob { |
no test coverage detected