Skip to content
Permalink
Browse files

Use IP if no hostname is present in dcclist, add + for SSL

Found by: Cizzle
Patch by: Cizzle, Geo
Closes #155 
* Use IP if no hostname is present in dcclist.
* Add ports and SSL status to dcclist
  • Loading branch information...
Cizzle authored and vanosg committed Jul 17, 2019
1 parent 96ada33 commit b29d8b6e4a3fd854e20efcd7e37d0d15c6ce64c5
Showing with 14 additions and 6 deletions.
  1. +14 −6 src/tcldcc.c
@@ -649,8 +649,9 @@ static int tcl_dcclist STDVAR
{
int i;
char *p, idxstr[10], timestamp[11], other[160];
char portstring[7];
long tv;
EGG_CONST char *list[6];
EGG_CONST char *list[7];

BADARGS(1, 2, " ?type?");

@@ -669,11 +670,18 @@ static int tcl_dcclist STDVAR
}
list[0] = idxstr;
list[1] = dcc[i].nick;
list[2] = dcc[i].host;
list[3] = dcc[i].type ? dcc[i].type->name : "*UNKNOWN*";
list[4] = other;
list[5] = timestamp;
p = Tcl_Merge(6, list);
list[2] = (dcc[i].host == NULL || dcc[i].host[0] == '\0') ?
iptostr(&dcc[i].sockname.addr.sa) : dcc[i].host;
#ifdef TLS
egg_snprintf(portstring, sizeof portstring, "%s%d", dcc[i].ssl ? "+" : "", dcc[i].port);
#else
portstring = dcc[i].port;
#endif
list[3] = portstring;
list[4] = dcc[i].type ? dcc[i].type->name : "*UNKNOWN*";
list[5] = other;
list[6] = timestamp;
p = Tcl_Merge(7, list);
Tcl_AppendElement(irp, p);
Tcl_Free((char *) p);
}

0 comments on commit b29d8b6

Please sign in to comment.
You can’t perform that action at this time.