From: Wouter Wijngaards Date: Tue, 15 Jan 2019 13:42:22 +0000 (+0000) Subject: comment fixes after review. X-Git-Tag: release-1.9.0rc1~48 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec6f4bab46dccd519553ba38c6cffc0e1c7238c5;p=thirdparty%2Funbound.git comment fixes after review. git-svn-id: file:///svn/unbound/trunk@5036 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/services/listen_dnsport.c b/services/listen_dnsport.c index b931d17b3..711319e16 100644 --- a/services/listen_dnsport.c +++ b/services/listen_dnsport.c @@ -1818,8 +1818,9 @@ tcp_req_info_send_reply(struct tcp_req_info* req) 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) { diff --git a/services/listen_dnsport.h b/services/listen_dnsport.h index 653413bc6..07cb64d17 100644 --- a/services/listen_dnsport.h +++ b/services/listen_dnsport.h @@ -326,11 +326,13 @@ void tcp_req_info_remove_mesh_state(struct tcp_req_info* req, /** * 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); @@ -338,7 +340,7 @@ 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. diff --git a/services/mesh.c b/services/mesh.c index 5ffef7714..bee0f76a4 100644 --- a/services/mesh.c +++ b/services/mesh.c @@ -1636,6 +1636,8 @@ void mesh_state_remove_reply(struct mesh_area* mesh, struct mesh_state* m, { 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) { diff --git a/services/mesh.h b/services/mesh.h index e11c06bf4..6946eb5fa 100644 --- a/services/mesh.h +++ b/services/mesh.h @@ -635,10 +635,10 @@ void mesh_list_remove(struct mesh_state* m, struct mesh_state** fp, /** * 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);