]> git.mxchange.org Git - simgear.git/commitdiff
Make sure both client and server situations are hendled properly
authorehofman <ehofman>
Sun, 14 Dec 2003 10:07:51 +0000 (10:07 +0000)
committerehofman <ehofman>
Sun, 14 Dec 2003 10:07:51 +0000 (10:07 +0000)
simgear/io/sg_socket.cxx

index 4ee0eba2e8a3ac863987cd80de4d18c5e776b01e..4012d71ae80db221b22ad80de884c469a8570db2 100644 (file)
@@ -218,7 +218,7 @@ SGSocket::read( char *buf, int length )
 
     if (result > 0)
     {
-       if (is_tcp)
+       if (is_tcp && is_server)
        {
             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
        // requested amount read
 
-       if (is_tcp)
+       if (is_tcp && is_server)
        {
            char *buf_ptr = save_buf + save_len;
            result = client->recv( buf_ptr, SG_IO_MAX_MSG_SIZE - save_len );