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,7 +360,6 @@ 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 (;;) {
|
||||
@ -368,6 +367,9 @@ guac_instruction* guac_protocol_read_instruction(guac_socket* socket, int usec_t
|
||||
/* 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