Skip to content

Commit

Permalink
XrdHttp: Fix empty PUT
Browse files Browse the repository at this point in the history
If the remote client is trying to create an empty file, the state
machine broke because it was waiting for more bytes from the bridge
before advancing the query.

This short-circuits the wait and causes an immediate callback,
allowing XrdHttp to immediately close the file.
  • Loading branch information
bbockelm committed Jan 30, 2021
1 parent 9e7d834 commit c469ba6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/XrdHttp/XrdHttpReq.cc
Expand Up @@ -1365,8 +1365,9 @@ int XrdHttpReq::ProcessHTTPReq() {


// We want to be invoked again after this request is finished
// Only if there is data to fetch from the socket
if (prot->BuffUsed() > 0)
// Only if there is data to fetch from the socket or there will
// never be more data
if (prot->BuffUsed() > 0 || length == 0)
return 0;

return 1;
Expand Down

0 comments on commit c469ba6

Please sign in to comment.