diff --git a/src/XrdHttp/XrdHttpProtocol.cc b/src/XrdHttp/XrdHttpProtocol.cc index 31cfc01cbd4..4b86c86d2be 100644 --- a/src/XrdHttp/XrdHttpProtocol.cc +++ b/src/XrdHttp/XrdHttpProtocol.cc @@ -545,9 +545,12 @@ int XrdHttpProtocol::Process(XrdLink *lp) // We ignore the argument here } - if (CurrentReq.request == CurrentReq.rtUnknown) { + if (CurrentReq.request == CurrentReq.rtUnset) { TRACE(DEBUG, " Parsing first line: " << tmpline); - CurrentReq.parseFirstLine((char *)tmpline.c_str(), rc); + int result = CurrentReq.parseFirstLine((char *)tmpline.c_str(), rc); + if (result < 0) { + TRACE(DEBUG, " Parsing of first line failed with " << result); + } } else CurrentReq.parseLine((char *)tmpline.c_str(), rc); diff --git a/src/XrdHttp/XrdHttpReq.cc b/src/XrdHttp/XrdHttpReq.cc index f58c2f4108b..3940142f7ad 100644 --- a/src/XrdHttp/XrdHttpReq.cc +++ b/src/XrdHttp/XrdHttpReq.cc @@ -814,7 +814,13 @@ int XrdHttpReq::ProcessHTTPReq() { // switch (request) { + case XrdHttpReq::rtUnset: case XrdHttpReq::rtUnknown: + { + prot->SendSimpleResp(400, NULL, NULL, (char *) "Request unknown", 0); + reset(); + return -1; + } case XrdHttpReq::rtMalformed: { prot->SendSimpleResp(400, NULL, NULL, (char *) "Request malformed", 0); @@ -2254,7 +2260,7 @@ void XrdHttpReq::reset() { if (ralist) free(ralist); ralist = 0; - request = rtUnknown; + request = rtUnset; resource = ""; allheaders.clear(); diff --git a/src/XrdHttp/XrdHttpReq.hh b/src/XrdHttp/XrdHttpReq.hh index 68d051bf04f..7c9ee80913f 100644 --- a/src/XrdHttp/XrdHttpReq.hh +++ b/src/XrdHttp/XrdHttpReq.hh @@ -144,6 +144,7 @@ public: /// These are the HTTP/DAV requests that we support enum ReqType { + rtUnset = -1, rtUnknown = 0, rtMalformed, rtGET,