Skip to content

Commit

Permalink
Bug 1311044 - show error when connection to domain socket is failed; …
Browse files Browse the repository at this point in the history
…r=bagder

MozReview-Commit-ID: GtqKiMVwQyX
  • Loading branch information
Liang-Heng Chen committed Oct 19, 2016
1 parent 30f88d3 commit a76ffa1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions netwerk/socket/nsSOCKSIOLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -513,10 +513,16 @@ nsSOCKSSocketInfo::ConnectToProxy(PRFileDesc *fd)
status = fd->lower->methods->connect(fd->lower, &prProxy, mTimeout);
if (status != PR_SUCCESS) {
PRErrorCode c = PR_GetError();

// If EINPROGRESS, return now and check back later after polling
if (c == PR_WOULD_BLOCK_ERROR || c == PR_IN_PROGRESS_ERROR) {
mState = SOCKS_CONNECTING_TO_PROXY;
return status;
} else if (IsHostDomainSocket()) {
LOGERROR(("socks: connect to domain socket failed (%d)", c));
PR_SetError(PR_CONNECT_REFUSED_ERROR, 0);
mState = SOCKS_FAILED;
return status;
}
}
} while (status != PR_SUCCESS);
Expand Down

0 comments on commit a76ffa1

Please sign in to comment.