Show correct message ("Remote end closed connection") when we get EOF

on a socket.

I also added a wrapper function around strerror() for dgets_errno, since
we did the same thing in a few places.  This all needs to be cleaned up
a little - the -1 value we use could in theory clash with an actual
errno error number.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@104 13b04d17-f746-0410-82c6-800466cd88b0
This commit is contained in:
Kevin Easton
2010-09-30 13:26:06 +00:00
parent 7a59da1f2e
commit d1e13bc526
5 changed files with 22 additions and 5 deletions

View File

@@ -535,7 +535,7 @@ static time_t last_timeout = 0;
/* Try to make sure output goes to the correct window */
if(server_list[i].server_change_refnum > -1)
set_display_target_by_winref(server_list[i].server_change_refnum);
say("Connection closed from %s: %s", server_list[i].name, (dgets_errno == -1) ? "Remote end closed connection" : strerror(dgets_errno));
say("Connection closed from %s: %s", server_list[i].name, dgets_strerror(dgets_errno));
server_list[i].reconnecting = 1;
close_server(i, empty_string);