Skip to content

Commit edac8a4

Browse files
committed
FST: Use the StartChunkResp/ChunkResp API for sending out the body of GET
reqeusts since the old SendSimpleResp API has changed in XRootD 6 and does not work as expected anymore.
1 parent 176b41f commit edac8a4

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

fst/http/xrdhttp/EosFstHttpHandler.cc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,9 @@ EosFstHttpHandler::ProcessReq(XrdHttpExtReq& req)
191191
response->GetHdrsWithFilter({HttpResponse::kContentLength}).c_str(),
192192
nullptr, content_length);
193193
} else {
194-
retc = req.SendSimpleResp(0, response->GetResponseCodeDescription().c_str(),
195-
response->GetHdrsWithFilter({HttpResponse::kContentLength}).c_str(),
196-
nullptr, content_length);
194+
retc = req.StartChunkedResp(
195+
response->GetResponseCode(), response->GetResponseCodeDescription().c_str(),
196+
response->GetHdrsWithFilter({HttpResponse::kContentLength}).c_str());
197197
}
198198

199199
if (retc) {
@@ -214,7 +214,7 @@ EosFstHttpHandler::ProcessReq(XrdHttpExtReq& req)
214214

215215
if (nread >= 0) {
216216
pos += nread;
217-
retc |= req.SendSimpleResp(1, nullptr, nullptr, &buffer[0], nread);
217+
retc |= req.ChunkResp(&buffer[0], nread);
218218
eos_static_debug("retc=%d", retc);
219219
} else {
220220
retc = -1;
@@ -225,6 +225,7 @@ EosFstHttpHandler::ProcessReq(XrdHttpExtReq& req)
225225
}
226226
} while ((pos != content_length) && (nread > 0) && !retc);
227227

228+
retc |= req.ChunkResp(nullptr, 0);
228229
OFS->mHttpd->FileClose(handler.get(), retc, eskip);
229230
return retc;
230231
}

0 commit comments

Comments
 (0)