mirror of
https://github.com/osmarks/ngircd.git
synced 2025-01-19 03:52:52 +00:00
Make sure SimpleMessage() sends <= 512 chars
This commit is contained in:
parent
74424cb1a5
commit
1cf8ccd8fe
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
#include "portab.h"
|
#include "portab.h"
|
||||||
|
|
||||||
static char UNUSED id[] = "$Id: conn.c,v 1.153 2005/06/12 16:28:55 alex Exp $";
|
static char UNUSED id[] = "$Id: conn.c,v 1.154 2005/06/12 17:21:46 fw Exp $";
|
||||||
|
|
||||||
#include "imp.h"
|
#include "imp.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
@ -1650,15 +1650,16 @@ try_resolve:
|
|||||||
LOCAL void
|
LOCAL void
|
||||||
Simple_Message( int Sock, char *Msg )
|
Simple_Message( int Sock, char *Msg )
|
||||||
{
|
{
|
||||||
|
char buf[COMMAND_LEN];
|
||||||
/* Write "simple" message to socket, without using compression
|
/* Write "simple" message to socket, without using compression
|
||||||
* or even the connection write buffers. Used e.g. for error
|
* or even the connection write buffers. Used e.g. for error
|
||||||
* messages by New_Connection(). */
|
* messages by New_Connection(). */
|
||||||
|
|
||||||
assert( Sock > NONE );
|
assert( Sock > NONE );
|
||||||
assert( Msg != NULL );
|
assert( Msg != NULL );
|
||||||
|
|
||||||
(void)write( Sock, Msg, strlen( Msg ) );
|
strlcpy( buf, Msg, sizeof buf - 2);
|
||||||
(void)write( Sock, "\r\n", 2 );
|
strlcat( buf, "\r\n", sizeof buf);
|
||||||
|
(void)write( Sock, buf, strlen( buf ) );
|
||||||
} /* Simple_Error */
|
} /* Simple_Error */
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user