diff libfdcore/p_dp.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 56c36d1007b4
children
line wrap: on
line diff
--- a/libfdcore/p_dp.c	Sat Sep 14 12:56:05 2013 +0200
+++ b/libfdcore/p_dp.c	Thu Oct 10 16:08:46 2013 +0200
@@ -112,12 +112,12 @@
 		/* Do we have pending exchanges with this peer? */
 		CHECK_FCT( fd_peer_get_load_pending(&peer->p_hdr, &to_receive, &to_send) );
 		
-		if ((to_receive == 0) && (to_send == 1 /* only the DPA */)) {
+		if ((to_receive == 0) && (to_send == 0)) {
 			/* No pending exchange, move to CLOSING directly */
 			CHECK_FCT( fd_psm_change_state(peer, STATE_CLOSING) );
 		
 			/* Now send the DPA */
-			CHECK_FCT( fd_out_send( msg, NULL, peer) );
+			CHECK_FCT( fd_out_send( msg, NULL, peer, 0) );
 			
 			/* and move to CLOSED */
 			fd_psm_cleanup(peer, 0);
@@ -131,7 +131,7 @@
 			fd_psm_next_timeout(peer, 0, GRACE_TIMEOUT);
 			
 			/* Now send the DPA */
-			CHECK_FCT( fd_out_send( msg, NULL, peer) );
+			CHECK_FCT( fd_out_send( msg, NULL, peer, 0) );
 		}
 	} else {
 		/* We received a DPA */
@@ -201,7 +201,7 @@
 	fd_psm_next_timeout(peer, 0, DPR_TIMEOUT);
 	
 	/* Now send the DPR message */
-	CHECK_FCT_DO( fd_out_send(&msg, NULL, peer), /* ignore since we are on timeout anyway */ );
+	CHECK_FCT_DO( fd_out_send(&msg, NULL, peer, 0), /* ignore since we are on timeout anyway */ );
 	
 	return 0;
 }
"Welcome to our mercurial repository"