return;
}
/* now that the query has been handled, that mesh_reply entry
- * should be removed, from the tcp_req_info list */
- /* TODO: find it, need mstate ptr */
+ * should be removed, from the tcp_req_info list,
+ * the mesh state cleanup removes then with region_cleanup and
+ * replies_sent true. */
/* see if we can send it straight away (we are not doing
* anything else). If so, copy to buffer and start */
if(req->cp->tcp_is_reading && req->cp->tcp_byte_count == 0) {
/**
* Handle write done of the last result packet
+ * @param req: the tcp req info.
*/
void tcp_req_info_handle_writedone(struct tcp_req_info* req);
/**
* Handle read done of a new request from the client
+ * @param req: the tcp req info.
*/
void tcp_req_info_handle_readdone(struct tcp_req_info* req);
* Add mesh state to the tcp req list of open requests.
* So the comm_reply can be removed off the mesh reply list when
* the tcp channel has to be closed (for other reasons then that that
- * request was done, eg. channel closed by client or some format error.
+ * request was done, eg. channel closed by client or some format error).
* @param req: tcp req info structure. It keeps track of the simultaneous
* requests and results on a tcp (or TLS) channel.
* @param mesh: mesh area for the state.
{
struct mesh_reply* n, *prev = NULL;
n = m->reply_list;
+ /* when in mesh_cleanup, it sets the reply_list to NULL, so that
+ * there is no accounting twice */
if(!n) return; /* nothing to remove, also no accounting needed */
while(n) {
if(n->query_reply.c == cp) {
/**
* Remove mesh reply entry from the reply entry list. Searches for
- * the repinfo pointer.
+ * the comm_point pointer.
* @param mesh: to update the counters.
* @param m: the mesh state.
- * @param cp: the commpoint to remove from the list.
+ * @param cp: the comm_point to remove from the list.
*/
void mesh_state_remove_reply(struct mesh_area* mesh, struct mesh_state* m,
struct comm_point* cp);