Skip to content

Commit

Permalink
HTTPProxy: remove message patch
Browse files Browse the repository at this point in the history
HTTP jump service requests save valid addresses to in-memory
address book, separating storage from HTTP message processing.

Refs monero-project#835 + monero-project#838
  • Loading branch information
coneiric committed Mar 22, 2018
1 parent 7131e7b commit b102cce
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/client/proxy/http.cc
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ void HTTPProxyHandler::HandleStreamRequestComplete(
}
/// @brief all this to change the useragent
/// @param len length of string
bool HTTPMessage::CreateHTTPRequest(const bool save_address) {
bool HTTPMessage::CreateHTTPRequest() {
if (!ExtractIncomingRequest()) {
// m_ErrorResponse is set in ExtractIncomingRequest
return false;
Expand Down Expand Up @@ -338,7 +338,7 @@ bool HTTPMessage::CreateHTTPRequest(const bool save_address) {
// - continue without saving option

// TODO(unassigned): separate this from message handling
if (!SaveJumpServiceAddress() && save_address)
if (!SaveJumpServiceAddress())
{
LOG(error)
<< "HTTPProxyHandler: failed to save address to address book";
Expand Down
4 changes: 1 addition & 3 deletions src/client/proxy/http.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,8 @@ class HTTPMessage : public std::enable_shared_from_this<HTTPMessage>{

/// @brief Processes original request: extracts, validates,
/// calls jump service, appends original request
/// @param save_address Save address to disk
/// @return true on success
// TODO(unassigned): save address param is a hack until storage is separated from message
bool CreateHTTPRequest(const bool save_address = true);
bool CreateHTTPRequest();

const unsigned int HEADERBODY_LEN = 2;
const unsigned int REQUESTLINE_HEADERS_MIN = 1;
Expand Down

0 comments on commit b102cce

Please sign in to comment.