diff libfdcore/p_out.c @ 1238:8f9684264fe0

Change management of the p_reqin_count counter to be updated only on routable messages. This should limit the errors in the counter value resulting from rejected or discarded link-local messages.
author Sebastien Decugis <sdecugis@freediameter.net>
date Thu, 10 Oct 2013 16:08:46 +0200
parents 043b894b0511
children 035f489b845b
line wrap: on
line diff
--- a/libfdcore/p_out.c	Sat Sep 14 12:56:05 2013 +0200
+++ b/libfdcore/p_out.c	Thu Oct 10 16:08:46 2013 +0200
@@ -159,14 +159,14 @@
 }
 
 /* Wrapper to sending a message either by out thread (peer in OPEN state) or directly; cnx or peer must be provided. Flags are valid only for direct sending, not through thread (unused) */
-int fd_out_send(struct msg ** msg, struct cnxctx * cnx, struct fd_peer * peer)
+int fd_out_send(struct msg ** msg, struct cnxctx * cnx, struct fd_peer * peer, int update_reqin_cnt)
 {
 	struct msg_hdr * hdr;
 	
 	TRACE_ENTRY("%p %p %p", msg, cnx, peer);
 	CHECK_PARAMS( msg && *msg && (cnx || (peer && peer->p_cnxctx)));
 	
-	if (peer) {
+	if (update_reqin_cnt && peer) {
 		CHECK_FCT( fd_msg_hdr(*msg, &hdr) );
 		if (!(hdr->msg_flags & CMD_FLAG_REQUEST)) {
 			/* Update the count of pending answers to send */
"Welcome to our mercurial repository"