diff --git a/channel.c b/channel.c index 9b0e2e2..028463b 100644 --- a/channel.c +++ b/channel.c @@ -27,7 +27,7 @@ tuveSendAllInChan(channel,userConnection,output); /* Notify people in the channel that someone has joined */ - sprintf(output,"chanmsg:TUveD:%s:%s has joined the channel.\n",channel,userConnection->userInfo.username); + sprintf(output,"chanmsg:TUveD:%s:%s has joined the channel.",channel,userConnection->userInfo.username); tuveSendAllInChan(channel,userConnection,output); return(0x0); @@ -42,7 +42,7 @@ tmpChan2 = tmpChan; for (;tmpChan != 0x0;tmpChan = tmpChan->next) { - sprintf(output,"chanmsg:EVIL NOTIFICATION:%s:%s Quit (Sig Pipe)\n",tmpChan->channel,userConnection->userInfo.username); + sprintf(output,"chanmsg:EVIL NOTIFICATION:%s:%s Quit (Sig Pipe)",tmpChan->channel,userConnection->userInfo.username); tuveSendAllInChan(tmpChan->channel,userConnection,output); sprintf(output,"PART:%s:%s\n",tmpChan->channel,userConnection->userInfo.username); tuveSendAllInChan(tmpChan->channel,userConnection,output); @@ -154,9 +154,9 @@ /* Send the new user the channel list */ for (tmpUsers = tmpChannel->users->next;tmpUsers != 0x0;tmpUsers = tmpUsers->next) { if (strlen(output) > 0) - sprintf(output,"%s:%s\n",output,tmpUsers->user->userInfo.username); + sprintf(output,"%s:%s",output,tmpUsers->user->userInfo.username); else - sprintf(output,"JOIN:%s:%s\n",tmpChannel->channel,tmpUsers->user->userInfo.username); + sprintf(output,"JOIN:%s:%s",tmpChannel->channel,tmpUsers->user->userInfo.username); } send(userConnection->fd,output,strlen(output),MSG_NOSIGNAL); diff --git a/socket.c b/socket.c index ef79160..9a4606f 100644 --- a/socket.c +++ b/socket.c @@ -224,7 +224,8 @@ if (tmpConnection->userInfo.pong < ping) { tmpConnection->userInfo.pfailed++; tmpConnection->userInfo.pong = ping; - send(tmpConnection->fd,"PING",sizeof("PING"),MSG_NOSIGNAL); + if (tmpConnection->userInfo.ident == 0x1) + send(tmpConnection->fd,"PING",sizeof("PING"),MSG_NOSIGNAL); } } else { @@ -241,7 +242,9 @@ myConnections_t *tmpConnection = 0x0; for (tmpConnection = connections;tmpConnection != 0x0;tmpConnection = tmpConnection->next) { + #ifdef DEBUG writeLog("socketFD: [%i]\n",tmpConnection->fd); + #endif if (FD_ISSET(tmpConnection->fd,readset) != 0x0) { writeLog("FD_ISSET\n"); if (tmpConnection->fd == listenerFD) {