Reset position in buffer each reparse (otherwise, stream will be read corrupt as parser is in wrong state).
This commit is contained in:
parent
f935075aec
commit
81bea52e4d
@ -360,14 +360,16 @@ int __guac_fill_instructionbuf(guac_socket* socket) {
|
||||
guac_instruction* guac_protocol_read_instruction(guac_socket* socket, int usec_timeout) {
|
||||
|
||||
int retval;
|
||||
int i = socket->__instructionbuf_parse_start;
|
||||
|
||||
|
||||
/* Loop until a instruction is read */
|
||||
for (;;) {
|
||||
|
||||
/* Length of element */
|
||||
int element_length = 0;
|
||||
|
||||
/* Position within buffer */
|
||||
int i = socket->__instructionbuf_parse_start;
|
||||
|
||||
/* Parse instruction in buffer */
|
||||
while (i < socket->__instructionbuf_used_length) {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user