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

@@ -818,7 +818,7 @@ SocketList *sl;
{
case -1:
{
char *real_tmp = ((dgets_errno == -1) ? "Remote End Closed Connection" : strerror(dgets_errno));
const char *real_tmp = dgets_strerror(dgets_errno);
if (do_hook(DCC_LOST_LIST, "%s %s %s", nick, dcc_types[type]->name, real_tmp))
put_it("%s", convert_output_format(fget_string_var(FORMAT_DCC_ERROR_FSET),
"%s %s %s %s", update_clock(GET_TIME),
@@ -952,8 +952,8 @@ SocketList *sl;
{
case -1:
{
char *real_tmp = ((dgets_errno == -1) ? "Remote End Closed Connection" : strerror(dgets_errno));
if (do_hook(DCC_LOST_LIST, "%s %s %s", nick, dcc_types[type]->name, real_tmp))
const char *real_tmp = dgets_strerror(dgets_errno);
if (do_hook(DCC_LOST_LIST, "%s %s %s", nick, dcc_types[type]->name, real_tmp))
put_it("%s", convert_output_format(fget_string_var(FORMAT_DCC_ERROR_FSET),
"%s %s %s %s", update_clock(GET_TIME),
dcc_types[type]->name, nick, real_tmp));