X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FApplications%2Firc_src%2Fmain.c;h=3f46d1587feac7b026e6e444c736a45c6a4d0722;hb=2da16f7b05b8c3f17ac136128a849db332b067ad;hp=cf01d605efb37e58e9883d5e2b65b49844c8336e;hpb=ad5784a3686b481e148770d14bfa964e87336139;p=tpg%2Facess2.git diff --git a/Usermode/Applications/irc_src/main.c b/Usermode/Applications/irc_src/main.c index cf01d605..3f46d158 100644 --- a/Usermode/Applications/irc_src/main.c +++ b/Usermode/Applications/irc_src/main.c @@ -357,8 +357,7 @@ tMessage *Message_Append(tServer *Server, int Type, const char *Source, const ch // Determine if it's a channel or PM message else if( Dest[0] == '#' || Dest[0] == '&' ) // TODO: Better determining here { - tWindow *prev = NULL; - for(win = gpWindows; win; prev = win, win = win->Next) + for(win = gpWindows; win; win = win->Next) { if( win->Server == Server && strcmp(win->Name, Dest) == 0 ) { @@ -575,6 +574,7 @@ void ParseServerLine(tServer *Server, char *Line) char *class, *message; class = GetValue(Line, &pos); + _SysDebug("NOTICE class='%s'", class); if( Line[pos] == ':' ) { message = Line + pos + 1; @@ -706,38 +706,21 @@ int writef(int FD, const char *Format, ...) int OpenTCP(const char *AddressString, short PortNumber) { int fd, addrType; - char *iface; char addrBuffer[8]; // Parse IP Address addrType = Net_ParseAddress(AddressString, addrBuffer); if( addrType == 0 ) { fprintf(stderr, "Unable to parse '%s' as an IP address\n", AddressString); + _SysDebug("Unable to parse '%s' as an IP address\n", AddressString); return -1; } // Finds the interface for the destination address - iface = Net_GetInterface(addrType, addrBuffer); - if( iface == NULL ) { - fprintf(stderr, "Unable to find a route to '%s'\n", AddressString); - return -1; - } - -// printf("iface = '%s'\n", iface); - - // Open client socket - // TODO: Move this out to libnet? - { - int len = snprintf(NULL, 100, "/Devices/ip/%s/tcpc", iface); - char path[len+1]; - snprintf(path, 100, "/Devices/ip/%s/tcpc", iface); - fd = open(path, OPENFLAG_READ|OPENFLAG_WRITE); - } - - free(iface); - + fd = Net_OpenSocket(addrType, addrBuffer, "tcpc"); if( fd == -1 ) { - fprintf(stderr, "Unable to open TCP Client for reading\n"); + fprintf(stderr, "Unable to open TCP Client to '%s'\n", AddressString); + _SysDebug("Unable to open TCP client to '%s'\n", AddressString); return -1; }