summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorwtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-04 00:09:04 +0000
committerwtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-04 00:09:04 +0000
commit38a187241c77a88617a7048988373b0e80608d6a (patch)
tree50872f914e007f8f272095999ac93aa68d33316f /net
parent265d542675ecd4e0394ed24dff7ca1a30db8374d (diff)
downloadchromium_src-38a187241c77a88617a7048988373b0e80608d6a.zip
chromium_src-38a187241c77a88617a7048988373b0e80608d6a.tar.gz
chromium_src-38a187241c77a88617a7048988373b0e80608d6a.tar.bz2
Fix incorrect error codes. 9999 is not a valid network error
code (always a negative number). The most likely reason for memio_CreateIOLayer or SSL_ImportFD to fail is that we ran out of memory, so just return ERR_OUT_OF_MEMORY. R=dank BUG=none TEST=no compilation errors. Review URL: http://codereview.chromium.org/464024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33754 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/socket/ssl_client_socket_nss.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/net/socket/ssl_client_socket_nss.cc b/net/socket/ssl_client_socket_nss.cc
index 19832ad..cc3200c 100644
--- a/net/socket/ssl_client_socket_nss.cc
+++ b/net/socket/ssl_client_socket_nss.cc
@@ -246,7 +246,7 @@ int SSLClientSocketNSS::InitializeSSLOptions() {
// TODO(port): specify rx and tx buffer sizes separately
nss_fd_ = memio_CreateIOLayer(kRecvBufferSize);
if (nss_fd_ == NULL) {
- return 9999; // TODO(port): real error
+ return ERR_OUT_OF_MEMORY; // TODO(port): map NSPR error code.
}
// Tell NSS who we're connected to
@@ -255,7 +255,8 @@ int SSLClientSocketNSS::InitializeSSLOptions() {
int err = transport_->GetPeerName((struct sockaddr *)&peername, &len);
if (err) {
DLOG(ERROR) << "GetPeerName failed";
- return 9999; // TODO(port): real error
+ // TODO(wtc): Change GetPeerName to return a network error code.
+ return ERR_UNEXPECTED;
}
memio_SetPeerName(nss_fd_, &peername);
@@ -266,7 +267,7 @@ int SSLClientSocketNSS::InitializeSSLOptions() {
/* Push SSL onto our fake I/O socket */
nss_fd_ = SSL_ImportFD(NULL, nss_fd_);
if (nss_fd_ == NULL) {
- return ERR_SSL_PROTOCOL_ERROR; // TODO(port): real error
+ return ERR_OUT_OF_MEMORY; // TODO(port): map NSPR/NSS error code.
}
// TODO(port): set more ssl options! Check errors!