Skip to content

Commit

Permalink
Avoid a lookup to the staticpreload hash if there is no staticpreload.
Browse files Browse the repository at this point in the history
…Fixes xrootd#753
  • Loading branch information
ffurano committed Jun 26, 2018
1 parent cfdc6ac commit 292ef0f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/XrdHttp/XrdHttpReq.cc
Original file line number Diff line number Diff line change
Expand Up @@ -921,12 +921,15 @@ int XrdHttpReq::ProcessHTTPReq() {
} else {

// We lookup the requested path in a hash containing the preread files
XrdHttpProtocol::StaticPreloadInfo *mydata = prot->staticpreload->Find(resource.c_str());
if (mydata) {
if (prot->staticpreload) {
XrdHttpProtocol::StaticPreloadInfo *mydata = prot->staticpreload->Find(resource.c_str());
if (mydata) {
prot->SendSimpleResp(200, NULL, NULL, (char *) mydata->data, mydata->len);
reset();
return 1;
}
}

}


Expand Down

0 comments on commit 292ef0f

Please sign in to comment.