mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 14:59:39 -04:00
Merge bitcoin/bitcoin#26666: refactor: Deleted unreachable code in httpserver.cpp
8f5c560e11
refactor: Refactored RequestMethodString function to follow developer notes (JoaoAJMatos)7fd3b9491b
refactor: Deleted unreachable code in httpserver.cpp (JoaoAJMatos) Pull request description: Some of the code in httpserver.cpp was unreachable, and didn't follow the developer notes. Continuation of [#26570 ](https://github.com/bitcoin/bitcoin/pull/26570) ACKs for top commit: stickies-v: re-ACK [8f5c560
](8f5c560e11
) Tree-SHA512: ba8cf4c6dde9e2bb0ca9d63a0de86dfa37b070803dde71ac8384c261045835697a2335652cf5894511b3af8fd99f30e1cbda4e4234815b8b39538ade90fab3f9
This commit is contained in:
commit
1ea02791f3
1 changed files with 3 additions and 11 deletions
|
@ -192,19 +192,16 @@ std::string RequestMethodString(HTTPRequest::RequestMethod m)
|
|||
switch (m) {
|
||||
case HTTPRequest::GET:
|
||||
return "GET";
|
||||
break;
|
||||
case HTTPRequest::POST:
|
||||
return "POST";
|
||||
break;
|
||||
case HTTPRequest::HEAD:
|
||||
return "HEAD";
|
||||
break;
|
||||
case HTTPRequest::PUT:
|
||||
return "PUT";
|
||||
break;
|
||||
default:
|
||||
case HTTPRequest::UNKNOWN:
|
||||
return "unknown";
|
||||
}
|
||||
} // no default case, so the compiler can warn about missing cases
|
||||
assert(false);
|
||||
}
|
||||
|
||||
/** HTTP request callback */
|
||||
|
@ -626,19 +623,14 @@ HTTPRequest::RequestMethod HTTPRequest::GetRequestMethod() const
|
|||
switch (evhttp_request_get_command(req)) {
|
||||
case EVHTTP_REQ_GET:
|
||||
return GET;
|
||||
break;
|
||||
case EVHTTP_REQ_POST:
|
||||
return POST;
|
||||
break;
|
||||
case EVHTTP_REQ_HEAD:
|
||||
return HEAD;
|
||||
break;
|
||||
case EVHTTP_REQ_PUT:
|
||||
return PUT;
|
||||
break;
|
||||
default:
|
||||
return UNKNOWN;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue