summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/inspircd.cpp18
-rw-r--r--src/message.cpp9
2 files changed, 14 insertions, 13 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index 0870116b2..c3c3acb3a 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -590,12 +590,12 @@ void Write(int sock,char *text, ...)
if (sock != -1)
{
int MOD_RESULT = 0;
- FOREACH_RESULT(OnRawSocketWrite(sock,tb,bytes > 514 ? 514 : bytes));
+ FOREACH_RESULT(OnRawSocketWrite(sock,tb,bytes > 512 ? 512 : bytes));
if (!MOD_RESULT)
- write(sock,tb,bytes > 514 ? 514 : bytes);
+ write(sock,tb,bytes > 512 ? 512 : bytes);
if (fd_ref_table[sock])
{
- fd_ref_table[sock]->bytes_out += (bytes > 514 ? 514 : bytes);
+ fd_ref_table[sock]->bytes_out += (bytes > 512 ? 512 : bytes);
fd_ref_table[sock]->cmds_out++;
}
}
@@ -623,12 +623,12 @@ void WriteServ(int sock, char* text, ...)
if (sock != -1)
{
int MOD_RESULT = 0;
- FOREACH_RESULT(OnRawSocketWrite(sock,tb,bytes > 514 ? 514 : bytes));
+ FOREACH_RESULT(OnRawSocketWrite(sock,tb,bytes > 512 ? 512 : bytes));
if (!MOD_RESULT)
- write(sock,tb,bytes > 514 ? 514 : bytes);
+ write(sock,tb,bytes > 512 ? 512 : bytes);
if (fd_ref_table[sock])
{
- fd_ref_table[sock]->bytes_out += (bytes > 514 ? 514 : bytes);
+ fd_ref_table[sock]->bytes_out += (bytes > 512 ? 512 : bytes);
fd_ref_table[sock]->cmds_out++;
}
}
@@ -656,12 +656,12 @@ void WriteFrom(int sock, userrec *user,char* text, ...)
if (sock != -1)
{
int MOD_RESULT = 0;
- FOREACH_RESULT(OnRawSocketWrite(sock,tb,bytes > 514 ? 514 : bytes));
+ FOREACH_RESULT(OnRawSocketWrite(sock,tb,bytes > 512 ? 512 : bytes));
if (!MOD_RESULT)
- write(sock,tb,bytes > 514 ? 514 : bytes);
+ write(sock,tb,bytes > 512 ? 512 : bytes);
if (fd_ref_table[sock])
{
- fd_ref_table[sock]->bytes_out += (bytes > 514 ? 514 : bytes);
+ fd_ref_table[sock]->bytes_out += (bytes > 512 ? 512 : bytes);
fd_ref_table[sock]->cmds_out++;
}
}
diff --git a/src/message.cpp b/src/message.cpp
index 4b2dfa98d..c90793090 100644
--- a/src/message.cpp
+++ b/src/message.cpp
@@ -187,11 +187,12 @@ void chop(char* str)
FOREACH_MOD OnServerRaw(temp,false,NULL);
const char* str2 = temp.c_str();
snprintf(str,MAXBUF,"%s",str2);
- if (strlen(str) >= 512)
+ if (strlen(str) >= 511)
{
- str[509] = '\r';
- str[510] = '\n';
- str[511] = '\0';
+ str[510] = '\r';
+ str[511] = '\n';
+ str[512] = '\0';
+ log(DEBUG,"Excess line chopped.");
}
}