Ver Fonte

evapi: reset possition in received buffer if all data was processed

- if there was some residual data from previous read, once reading again
  ends up in processing all netstring frames, then reset position in
  order to start from beginning with next packet
- credits to Jayesh Nambiar assisting with troubleshooting
Daniel-Constantin Mierla há 10 anos atrás
pai
commit
02fde16b15
1 ficheiros alterados com 1 adições e 0 exclusões
  1. 1 0
      modules/evapi/evapi_dispatch.c

+ 1 - 0
modules/evapi/evapi_dispatch.c

@@ -371,6 +371,7 @@ void evapi_recv_client(struct ev_loop *loop, struct ev_io *watcher, int revents)
 			evapi_run_cfg_route(&evenv, _evapi_rts.msg_received);
 			k++;
 		}
+		_evapi_clients[i].rpos = 0 ;
 	} else {
 		evenv.msg.s = _evapi_clients[i].rbuffer;
 		evenv.msg.len = rlen;