[sr-dev] git:master:02fde16b: evapi: reset possition in received buffer if all data was processed

Daniel-Constantin Mierla miconda at gmail.com
Wed Sep 30 00:26:25 CEST 2015


Module: kamailio
Branch: master
Commit: 02fde16b151fc66653290cf1cc2073f3bb2cb96a
URL: https://github.com/kamailio/kamailio/commit/02fde16b151fc66653290cf1cc2073f3bb2cb96a

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2015-09-30T00:23:16+02:00

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

---

Modified: modules/evapi/evapi_dispatch.c

---

Diff:  https://github.com/kamailio/kamailio/commit/02fde16b151fc66653290cf1cc2073f3bb2cb96a.diff
Patch: https://github.com/kamailio/kamailio/commit/02fde16b151fc66653290cf1cc2073f3bb2cb96a.patch

---

diff --git a/modules/evapi/evapi_dispatch.c b/modules/evapi/evapi_dispatch.c
index b0aa8f5..502809b 100644
--- a/modules/evapi/evapi_dispatch.c
+++ b/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;




More information about the sr-dev mailing list