Github user changkun commented on a diff in the pull request:

    https://github.com/apache/guacamole-server/pull/183#discussion_r216511811
  
    --- Diff: src/libguac/parser.c ---
    @@ -222,7 +222,11 @@ int guac_parser_read(guac_parser* parser, guac_socket* 
socket, int usec_timeout)
                 retval = guac_socket_select(socket, usec_timeout);
                 if (retval <= 0)
                     return -1;
    -           
    +            
    +            /* Reset pointers if instruction buf len is less than max 
instruction len */
    +            if (buffer_end - unparsed_end < GUAC_INSTRUCTION_MAX_LENGTH)
    +                unparsed_end = unparsed_start = parser->__instructionbuf;
    --- End diff --
    
    > That isn't possible. Each call to read() is not guaranteed to return all 
data written to the socket - it may only return part of that data, but the next 
call to read() should return yet more of the data, and so on.
    
    I know it is not possible, socketpair has its own buffer on both side of 
sockets, they cache unread data. Magically, I somehow meet this problem.
    
    > __write_all() is not actually writing everything.
    
    So far, I observed from the output log, `__write_all` write entire buffer 
array successfully, in the end, before parse error.
    
    > You are testing against unmodified guacamole-server master, correct? 
You're not including your changes from #179?
    
    No, I do not including #179 . All tests and tracking are based on vanilla 
tag 0.9.14.



---

Reply via email to