diff options
author | Timo Sirainen <cras@irssi.org> | 2001-07-14 18:52:53 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2001-07-14 18:52:53 +0000 |
commit | b500815724149a2183a6c926f1405f9522962cf8 (patch) | |
tree | 7f3cd19afe7df85af5d551c3c22e2f27c01a2555 | |
parent | 0cd57fb2015d9b4ad92e3cd363f010180d8ac398 (diff) | |
download | irssi-b500815724149a2183a6c926f1405f9522962cf8.zip |
Cut the messages sent to rawlog to 510 chars too.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1617 dbcabf3a-b0e7-0310-adc4-f8d773084564
-rw-r--r-- | src/irc/core/irc.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/irc/core/irc.c b/src/irc/core/irc.c index e6b380b2..bf41fbbc 100644 --- a/src/irc/core/irc.c +++ b/src/irc/core/irc.c @@ -54,18 +54,25 @@ void irc_send_cmd_full(IRC_SERVER_REC *server, const char *cmd, len = strlen(cmd); server->cmdcount++; - if (send_now) - rawlog_output(server->rawlog, cmd); - if (!raw) { /* check that we don't send any longer commands - than 512 bytes. also add the line feed. */ + than 510 bytes (2 bytes for CR+LF) */ strncpy(str, cmd, 510); if (len > 510) len = 510; - str[len++] = 13; str[len++] = 10; str[len] = '\0'; + str[len] = '\0'; cmd = str; } + if (send_now) + rawlog_output(server->rawlog, cmd); + + if (!raw) { + /* Add CR+LF to command */ + str[len++] = 13; + str[len++] = 10; + str[len] = '\0'; + } + if (send_now) { if (net_sendbuffer_send(server->handle, cmd, len) == -1) { /* something bad happened */ |