Skip to content
Snippets Groups Projects
Commit e5589cfa authored by Michael Davis's avatar Michael Davis
Browse files

[EOS-CTA] SetNilResponse() if Response is empty

parent 7606a797
Branches
Tags
No related merge requests found
......@@ -236,6 +236,10 @@ template<typename RequestType, typename MetadataType, typename AlertType>
XrdSsiRequest::PRD_Xeq Request<RequestType, MetadataType, AlertType>
::ProcessResponseData(const XrdSsiErrInfo &eInfo, char *response_bufptr, int response_buflen, bool is_last)
{
#ifdef XRDSSI_DEBUG
std::cout << "[DEBUG] ProcessResponseData(): received " << response_buflen << " bytes of data" << std::endl;
#endif
// The buffer length can be 0 if the response is metadata only
if(response_buflen != 0)
......@@ -247,7 +251,7 @@ XrdSsiRequest::PRD_Xeq Request<RequestType, MetadataType, AlertType>
if(!is_last)
{
// If there is more datam get the next chunk
// If there is more data, get the next chunk
GetResponseData(response_bufptr, m_response_bufsize);
}
......
......@@ -177,10 +177,19 @@ void RequestProc<RequestType, MetadataType, AlertType>::Execute()
SetMetadata(m_metadata_str.c_str(), m_metadata_str.size());
}
// Send the response. This must always be called, even if the response is empty, as Finished()
// will not be called until the Response has been processed.
// Send the Response
SetResponse(m_response_str.c_str(), m_response_str.size());
if(m_response_str.size() == 0)
{
// Send a metadata-only response. If the Response is empty, we still have to call SetResponse(),
// otherwise Finished() will not be called on the Request.
SetNilResponse();
}
else
{
SetResponse(m_response_str.c_str(), m_response_str.size());
}
// Wait for the framework to call Finished()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment