Make sure both client and server situations are hendled properly

This commit is contained in:
ehofman 2003-12-14 10:07:51 +00:00
parent 53bdf9dac4
commit a659969bcf

View File

@ -218,7 +218,7 @@ SGSocket::read( char *buf, int length )
if (result > 0) if (result > 0)
{ {
if (is_tcp) if (is_tcp && is_server)
{ {
result = client->recv( buf, length ); result = client->recv( buf, length );
} }
@ -257,7 +257,7 @@ SGSocket::readline( char *buf, int length )
// read a chunk, keep in the save buffer until we have the // read a chunk, keep in the save buffer until we have the
// requested amount read // requested amount read
if (is_tcp) if (is_tcp && is_server)
{ {
char *buf_ptr = save_buf + save_len; char *buf_ptr = save_buf + save_len;
result = client->recv( buf_ptr, SG_IO_MAX_MSG_SIZE - save_len ); result = client->recv( buf_ptr, SG_IO_MAX_MSG_SIZE - save_len );