Only allow clients to send messages for now

This commit is contained in:
Pierre Pronchery 2012-12-04 15:42:06 +01:00
parent ce556dd215
commit 3c91657465

View File

@ -374,7 +374,8 @@ static int _tcp_send(TCP * tcp, AppMessage * message, int acknowledge)
{
Buffer * buffer;
/* XXX this assumes being a client */
if(tcp->mode != ATM_CLIENT)
return -error_set_code(1, "%s", "Not a client");
if((buffer = buffer_new(0, NULL)) == NULL)
return -1;
if(appmessage_serialize(message, buffer) != 0