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

Function ReadAll

library/cpp/neh/https.cpp:1203–1224  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers 2

ProcessRecvMethod · 0.85
TPostRequestMethod · 0.85

Calls 9

yexceptionClass · 0.85
AppendNoAliasMethod · 0.80
GetContentLengthMethod · 0.45
LoadMethod · 0.45
beginMethod · 0.45
HasContentMethod · 0.45
ReadMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected