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

Unified Diff: runtime/bin/secure_socket.cc

Issue 14036017: Revert "Add new InternetAddress class with a static lookup function (including IPv6 results)." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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 | « runtime/bin/dbg_connection.cc ('k') | runtime/bin/socket.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/secure_socket.cc
diff --git a/runtime/bin/secure_socket.cc b/runtime/bin/secure_socket.cc
index 7a5b6f3ad5f21d57b79cb1c63be1b0ed145d37f8..e66ff357c576bf11ed7db7c7b5af44a679770a82 100644
--- a/runtime/bin/secure_socket.cc
+++ b/runtime/bin/secure_socket.cc
@@ -560,17 +560,19 @@ void SSLFilter::Connect(const char* host_name,
// SetPeerAddress
PRNetAddr host_address;
- PRAddrInfo* info = PR_GetAddrInfoByName(host_name,
- PR_AF_UNSPEC,
- PR_AI_ADDRCONFIG);
- if (info == NULL) {
- ThrowPRException("Failed PR_GetAddrInfoByName call");
+ char host_entry_buffer[PR_NETDB_BUF_SIZE];
+ PRHostEnt host_entry;
+ PRStatus rv = PR_GetHostByName(host_name, host_entry_buffer,
+ PR_NETDB_BUF_SIZE, &host_entry);
+ if (rv != PR_SUCCESS) {
+ ThrowPRException("Failed PR_GetHostByName call");
}
- PR_EnumerateAddrInfo(0, info, port, &host_address);
-
+ int index = PR_EnumerateHostEnt(0, &host_entry, port, &host_address);
+ if (index == -1 || index == 0) {
+ ThrowPRException("Failed PR_EnumerateHostEnt call");
+ }
memio_SetPeerName(filter_, &host_address);
- PR_FreeAddrInfo(info);
}
« no previous file with comments | « runtime/bin/dbg_connection.cc ('k') | runtime/bin/socket.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698