Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1050)

Unified Diff: net/socket/socks5_client_socket.cc

Issue 9716020: Add base::HostToNetXX() & NetToHostXX(), and use them to replace htonX() & ntohX() in Chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/server/web_socket.cc ('k') | net/socket/socks5_client_socket_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/socks5_client_socket.cc
diff --git a/net/socket/socks5_client_socket.cc b/net/socket/socks5_client_socket.cc
index b8b3439169b6b1c364b970dff2d9df21d6c566aa..f9932a902907c295b7c16cdc9730b04222d40633 100644
--- a/net/socket/socks5_client_socket.cc
+++ b/net/socket/socks5_client_socket.cc
@@ -9,6 +9,7 @@
#include "base/debug/trace_event.h"
#include "base/format_macros.h"
#include "base/string_util.h"
+#include "base/sys_byteorder.h"
#include "net/base/io_buffer.h"
#include "net/base/net_log.h"
#include "net/base/net_util.h"
@@ -364,7 +365,7 @@ int SOCKS5ClientSocket::BuildHandshakeWriteBuffer(std::string* handshake)
host_request_info_.hostname().size()));
handshake->append(host_request_info_.hostname());
- uint16 nw_port = htons(host_request_info_.port());
+ uint16 nw_port = base::HostToNet16(host_request_info_.port());
handshake->append(reinterpret_cast<char*>(&nw_port), sizeof(nw_port));
return OK;
}
« no previous file with comments | « net/server/web_socket.cc ('k') | net/socket/socks5_client_socket_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698