A bit more debug info for failed connects.
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2667 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
Changes towards version 0.7:
|
||||
- A bit more debug info for failed connects. - SvdB
|
||||
- Exit with failure if basic content cannot be found, ensuring proper
|
||||
error reporting under Windows - Michael
|
||||
- Popup windows for "Really Exit?" and Game Pause are immune to fades
|
||||
|
||||
@@ -146,6 +146,9 @@ connectCallback(NetDescriptor *nd) {
|
||||
|
||||
if (connectState->state == Connect_closed) {
|
||||
// The connection attempt has been aborted.
|
||||
#ifdef DEBUG
|
||||
log_add(log_Debug, "Connection attempt was aborted.\n");
|
||||
#endif
|
||||
ConnectState_decRef(connectState);
|
||||
return;
|
||||
}
|
||||
@@ -256,10 +259,18 @@ tryConnectHostNext(ConnectState *connectState) {
|
||||
return sock;
|
||||
}
|
||||
|
||||
// Connection failed.
|
||||
// Connection failed immediately. This is just for one of the addresses,
|
||||
// so this does not have to be final.
|
||||
// Note that as the socket is non-blocking, most failed connection
|
||||
// errors will usually not be reported immediately.
|
||||
{
|
||||
int savedErrno = errno;
|
||||
Socket_close(sock);
|
||||
#ifdef DEBUG
|
||||
log_add(log_Debug, "connect() immediately failed for one address: "
|
||||
"%s.\n", strerror(errno));
|
||||
// TODO: add the address in the status message.
|
||||
#endif
|
||||
errno = savedErrno;
|
||||
}
|
||||
return Socket_noSocket;
|
||||
|
||||
Reference in New Issue
Block a user