Index: libfdcore/p_psm.c
===================================================================
--- libfdcore/p_psm.c	(revision 1330)
+++ libfdcore/p_psm.c	(revision 1379)
@@ -41,7 +41,7 @@
  - the state machine described in rfc3539#section-3.4
  - the following observations.
- 
+
 The delivery of Diameter messages must not always be unordered: order is important at
-begining and end of a connection lifetime. It means we need agility to
+beginning and end of a connection lifetime. It means we need agility to
 switch between "ordering enforced" and "ordering not enforced to counter
 Head of the Line Blocking" modes of operation.
@@ -50,5 +50,5 @@
 incomplete, because it lacks the SUSPECT state and the 3 DWR/DWA
 exchanges (section 5.1) when the peer recovers from this state.
-Personnally I don't see the rationale for exchanging 3 messages (why 3?)
+Personally I don't see the rationale for exchanging 3 messages (why 3?)
 but, if we require at least 1 DWR/DWA exchange to be always performed
 after the CER/CEA exchange (and initiated by the peer that sent the
@@ -97,6 +97,6 @@
 I really cannot see a way to counter this effect by using the ordering
 of the messages, except by applying a timer (state STATE_CLOSING_GRACE).
-This timer can be also useful when we detect that some messages has not 
-yet received an answer on this link, to give time to the application to 
+This timer can be also useful when we detect that some messages has not
+yet received an answer on this link, to give time to the application to
 complete the exchange ongoing.
 
@@ -128,5 +128,5 @@
 	TRACE_ENTRY("");
 	CHECK_POSIX( pthread_mutex_lock(&started_mtx) );
-awake:	
+awake:
 	if (!ret && !started) {
 		pthread_cleanup_push( fd_cleanup_mutex, &started_mtx );
@@ -160,5 +160,5 @@
 	struct fd_list * li;
 	CHECK_PARAMS( FD_IS_LIST_EMPTY(&peer->p_actives) );
-	
+
 	/* Callback registered by the credential validator (fd_peer_validate_register) */
 	if (peer->p_cb2) {
@@ -171,10 +171,10 @@
 		return 0;
 	}
-	
+
 	/* Insert in the active peers list */
 	CHECK_POSIX( pthread_rwlock_wrlock(&fd_g_activ_peers_rw) );
 	for (li = fd_g_activ_peers.next; li != &fd_g_activ_peers; li = li->next) {
 		struct fd_peer * next_p = (struct fd_peer *)li->o;
-		int cmp = fd_os_cmp(peer->p_hdr.info.pi_diamid, peer->p_hdr.info.pi_diamidlen, 
+		int cmp = fd_os_cmp(peer->p_hdr.info.pi_diamid, peer->p_hdr.info.pi_diamidlen,
 					next_p->p_hdr.info.pi_diamid, next_p->p_hdr.info.pi_diamidlen);
 		if (cmp < 0)
@@ -183,5 +183,5 @@
 	fd_list_insert_before(li, &peer->p_actives);
 	CHECK_POSIX( pthread_rwlock_unlock(&fd_g_activ_peers_rw) );
-	
+
 	/* Callback registered when the peer was added, by fd_peer_add */
 	if (peer->p_cb) {
@@ -191,11 +191,11 @@
 		peer->p_cb_data = NULL;
 	}
-	
+
 	/* Start the thread to handle outgoing messages */
 	CHECK_FCT( fd_out_start(peer) );
-	
+
 	/* Update the expiry timer now */
 	CHECK_FCT( fd_p_expi_update(peer) );
-	
+
 	return 0;
 }
@@ -206,13 +206,13 @@
 	fd_list_unlink( &peer->p_actives );
 	CHECK_POSIX( pthread_rwlock_unlock(&fd_g_activ_peers_rw) );
-	
+
 	/* Stop the "out" thread */
 	CHECK_FCT( fd_out_stop(peer) );
-	
+
 	/* Failover the messages */
 	if (!skip_failover) {
 		fd_peer_failover_msg(peer);
 	}
-	
+
 	return 0;
 }
@@ -234,9 +234,9 @@
 			}
 			break;
-			
+
 			case FDEVP_TERMINATE:
 				/* Do not free the string since it is a constant */
 			break;
-			
+
 			case FDEVP_CNX_INCOMING: {
 				struct cnx_incoming * evd = ev->data;
@@ -256,14 +256,14 @@
 {
 	int ret;
-	
+
 	struct fd_peer * p = (struct fd_peer *)peer;
-	
+
 	if (!CHECK_PEER(p))
 		return -1;
-	
+
 	CHECK_POSIX_DO( pthread_mutex_lock(&p->p_state_mtx), return -1 );
 	ret = p->p_state;
 	CHECK_POSIX_DO( pthread_mutex_unlock(&p->p_state_mtx), return -1 );
-	
+
 	return ret;
 }
@@ -274,22 +274,22 @@
 {
 	int old;
-	
+
 	TRACE_ENTRY("%p %d(%s)", peer, new_state, STATE_STR(new_state));
 	CHECK_PARAMS( CHECK_PEER(peer) );
-	
+
 	old = fd_peer_getstate(peer);
 	if (old == new_state)
 		return 0;
-	
+
 	LOG(((old == STATE_OPEN) || (new_state == STATE_OPEN)) ? ((new_state == STATE_SUSPECT || new_state == STATE_CLOSED) ? FD_LOG_ERROR : FD_LOG_NOTICE ): FD_LOG_DEBUG, "'%s'\t-> '%s'\t'%s'",
 			STATE_STR(old),
 			STATE_STR(new_state),
 			peer->p_hdr.info.pi_diamid);
-	
-	
+
+
 	CHECK_POSIX( pthread_mutex_lock(&peer->p_state_mtx) );
 	peer->p_state = new_state;
 	CHECK_POSIX( pthread_mutex_unlock(&peer->p_state_mtx) );
-	
+
 	if (old == STATE_OPEN) {
 		CHECK_FCT( leave_open_state(peer, new_state == STATE_CLOSING_GRACE) );
@@ -302,18 +302,18 @@
 		CHECK_FCT( enter_open_state(peer) );
 	}
-	
+
 	if (new_state == STATE_CLOSED) {
 		/* Purge event list */
 		fd_psm_events_free(peer);
-		
-		/* Reset the counter of pending anwers to send */
+
+		/* Reset the counter of pending answers to send */
 		peer->p_reqin_count = 0;
-		
-		/* If the peer is not persistant, we destroy it */
+
+		/* If the peer is not persistent, we destroy it */
 		if (peer->p_hdr.info.config.pic_flags.persist == PI_PRST_NONE) {
 			CHECK_FCT( fd_event_send(peer->p_events, FDEVP_TERMINATE, 0, NULL) );
 		}
 	}
-	
+
 	return 0;
 }
@@ -323,8 +323,8 @@
 {
 	TRACE_DEBUG(FULL, "Peer timeout reset to %d seconds%s", delay, add_random ? " (+/- 2)" : "" );
-	
+
 	/* Initialize the timer */
 	CHECK_POSIX_DO(  clock_gettime( CLOCK_REALTIME,  &peer->p_psm_timer ), ASSERT(0) );
-	
+
 	if (add_random) {
 		if (delay > 2)
@@ -341,7 +341,7 @@
 		}
 	}
-	
+
 	peer->p_psm_timer.tv_sec += delay;
-	
+
 #ifdef SLOW_PSM
 	/* temporary for debug */
@@ -357,19 +357,19 @@
 		CHECK_FCT_DO( fd_psm_change_state(peer, STATE_CLOSED), /* continue */ );
 	}
-	
+
 	fd_p_cnx_abort(peer, terminate);
-	
+
 	fd_p_ce_clear_cnx(peer, NULL);
-	
+
 	if (peer->p_receiver) {
 		fd_cnx_destroy(peer->p_receiver);
 		peer->p_receiver = NULL;
 	}
-	
+
 	if (terminate) {
 		fd_psm_events_free(peer);
 		CHECK_FCT_DO( fd_fifo_del(&peer->p_events), /* continue */ );
 	}
-	
+
 }
 
@@ -378,6 +378,6 @@
 /*                      The PSM thread                                  */
 /************************************************************************/
-/* Cancelation cleanup : set ZOMBIE state in the peer */
-void cleanup_setstate(void * arg) 
+/* Cancellation cleanup : set ZOMBIE state in the peer */
+void cleanup_setstate(void * arg)
 {
 	struct fd_peer * peer = (struct fd_peer *)arg;
@@ -389,5 +389,5 @@
 }
 
-/* The state machine thread (controler) */
+/* The state machine thread (controller) */
 static void * p_psm_th( void * arg )
 {
@@ -398,9 +398,9 @@
 	void * ev_data;
 	int cur_state;
-	
+
 	CHECK_PARAMS_DO( CHECK_PEER(peer), ASSERT(0) );
-	
+
 	pthread_cleanup_push( cleanup_setstate, arg );
-	
+
 	/* Set the thread name */
 	{
@@ -409,5 +409,5 @@
 		fd_log_threadname ( buf );
 	}
-	
+
 	/* The state machine starts in CLOSED state */
 	CHECK_POSIX_DO( pthread_mutex_lock(&peer->p_state_mtx), goto psm_end );
@@ -417,5 +417,5 @@
 	/* Wait that the PSM are authorized to start in the daemon */
 	CHECK_FCT_DO( fd_psm_waitstart(), goto psm_end );
-	
+
 	/* Initialize the timer */
 	if (peer->p_flags.pf_responder) {
@@ -424,5 +424,5 @@
 		fd_psm_next_timeout(peer, created_started, 0);
 	}
-	
+
 psm_loop:
 	/* Get next event */
@@ -430,9 +430,9 @@
 			peer->p_hdr.info.pi_diamid, STATE_STR(fd_peer_getstate(peer)));
 	CHECK_FCT_DO( fd_event_timedget(peer->p_events, &peer->p_psm_timer, FDEVP_PSM_TIMEOUT, &event, &ev_sz, &ev_data), goto psm_end );
-	
+
 	cur_state = fd_peer_getstate(peer);
 	if (cur_state == -1)
 		goto psm_end;
-	
+
 	TRACE_DEBUG(FULL, "'%s'\t<-- '%s'\t(%p,%zd)\t'%s'",
 			STATE_STR(cur_state),
@@ -463,6 +463,6 @@
 				CHECK_FCT_DO( fd_p_dp_initiate(peer, ev_data), goto psm_end );
 				goto psm_loop;
-			
-			/*	
+
+			/*
 			case STATE_CLOSING:
 			case STATE_CLOSING_GRACE:
@@ -478,5 +478,5 @@
 		}
 	}
-	
+
 	/* A message was received */
 	if (event == FDEVP_CNX_MSG_RECV) {
@@ -485,11 +485,11 @@
 		struct fd_cnx_rcvdata rcv_data;
 		struct fd_msg_pmdl * pmdl = NULL;
-		
+
 		rcv_data.buffer = ev_data;
 		rcv_data.length = ev_sz;
 		pmdl = fd_msg_pmdl_get_inbuf(rcv_data.buffer, rcv_data.length);
-		
+
 		/* Parse the received buffer */
-		CHECK_FCT_DO( fd_msg_parse_buffer( (void *)&ev_data, ev_sz, &msg), 
+		CHECK_FCT_DO( fd_msg_parse_buffer( (void *)&ev_data, ev_sz, &msg),
 			{
 				fd_hook_call(HOOK_MESSAGE_PARSING_ERROR, NULL, peer, &rcv_data, pmdl );
@@ -498,8 +498,8 @@
 				goto psm_loop;
 			} );
-			
+
 		fd_hook_associate(msg, pmdl);
 		CHECK_FCT_DO( fd_msg_source_set( msg, peer->p_hdr.info.pi_diamid, peer->p_hdr.info.pi_diamidlen), goto psm_end);
-	
+
 		/* If the current state does not allow receiving messages, just drop it */
 		if (cur_state == STATE_CLOSED) {
@@ -509,8 +509,8 @@
 			goto psm_loop;
 		}
-		
+
 		/* Extract the header */
 		CHECK_FCT_DO( fd_msg_hdr(msg, &hdr), goto psm_end );
-		
+
 		/* If it is an answer, associate with the request or drop */
 		if (!(hdr->msg_flags & CMD_FLAG_REQUEST)) {
@@ -523,18 +523,18 @@
 				goto psm_loop;
 			}
-			
+
 			/* Associate */
 			CHECK_FCT_DO( fd_msg_answ_associate( msg, req ), goto psm_end );
-			
-		}
-		
+
+		}
+
 		/* Log incoming message */
 		fd_hook_call(HOOK_MESSAGE_RECEIVED, msg, peer, NULL, fd_msg_pmdl_get(msg));
-		
+
 		if (cur_state == STATE_OPEN_NEW) {
 			/* OK, we have received something, so the connection is supposedly now in OPEN state at the remote site */
 			fd_psm_change_state(peer, STATE_OPEN );
 		}
-		
+
 		/* Now handle non-link-local messages */
 		if (fd_msg_is_routable(msg)) {
@@ -563,5 +563,5 @@
 						CHECK_POSIX_DO( pthread_mutex_unlock(&peer->p_state_mtx), goto psm_end  );
 					}
-						
+
 					/* Requeue to the global incoming queue */
 					CHECK_FCT_DO(fd_fifo_post(fd_g_incoming, &msg), goto psm_end );
@@ -572,5 +572,5 @@
 					}
 					break;
-					
+
 				/* In other states, we discard the message, it is either old or invalid to send it for the remote peer */
 				case STATE_WAITCNXACK:
@@ -588,5 +588,5 @@
 			goto psm_loop;
 		}
-		
+
 		/* Link-local message: They must be understood by our dictionary, otherwise we return an error */
 		{
@@ -594,11 +594,11 @@
 			int ret = fd_msg_parse_or_error( &msg, &error );
 			if (ret != EBADMSG) {
-				CHECK_FCT_DO( ret, 
+				CHECK_FCT_DO( ret,
 					{
 						char buf[256];
-						snprintf(buf, sizeof(buf), "%s: An unexpected error occurred while parsing a link-local message", peer->p_hdr.info.pi_diamid); 
+						snprintf(buf, sizeof(buf), "%s: An unexpected error occurred while parsing a link-local message", peer->p_hdr.info.pi_diamid);
 						fd_hook_call(HOOK_MESSAGE_DROPPED, msg, peer, buf, fd_msg_pmdl_get(msg));
-						fd_msg_free(msg); 
-						goto psm_end; 
+						fd_msg_free(msg);
+						goto psm_end;
 					} );
 			} else {
@@ -609,5 +609,5 @@
 						char buf[256];
 						/* Only if an error occurred & the message was not saved / dumped */
-						snprintf(buf, sizeof(buf), "%s: error sending a message", peer->p_hdr.info.pi_diamid); 
+						snprintf(buf, sizeof(buf), "%s: error sending a message", peer->p_hdr.info.pi_diamid);
 						fd_hook_call(HOOK_MESSAGE_DROPPED, error, peer, buf, fd_msg_pmdl_get(error));
 						CHECK_FCT_DO( fd_msg_free(error), goto psm_end);
@@ -624,9 +624,9 @@
 			}
 		}
-		
+
 		/* Handle the LL message and update the expiry timer appropriately */
 		switch (hdr->msg_code) {
 			case CC_CAPABILITIES_EXCHANGE:
-				CHECK_FCT_DO( fd_p_ce_msgrcv(&msg, (hdr->msg_flags & CMD_FLAG_REQUEST), peer), 
+				CHECK_FCT_DO( fd_p_ce_msgrcv(&msg, (hdr->msg_flags & CMD_FLAG_REQUEST), peer),
 					{
 						if (msg)
@@ -635,5 +635,5 @@
 					} );
 				break;
-			
+
 			case CC_DISCONNECT_PEER:
 				CHECK_FCT_DO( fd_p_dp_handle(&msg, (hdr->msg_flags & CMD_FLAG_REQUEST), peer), goto psm_reset );
@@ -642,9 +642,9 @@
 
 				break;
-			
+
 			case CC_DEVICE_WATCHDOG:
 				CHECK_FCT_DO( fd_p_dw_handle(&msg, (hdr->msg_flags & CMD_FLAG_REQUEST), peer), goto psm_reset );
 				break;
-			
+
 			default:
 				/* Unknown / unexpected / invalid message -- but validated by our dictionary */
@@ -665,5 +665,5 @@
 					TRACE_DEBUG(INFO, "Received answer with erroneous 'is_routable' result...");
 				}
-				
+
 				/* Cleanup the message if not done */
 				if (msg) {
@@ -675,5 +675,5 @@
 				}
 		};
-		
+
 		/* At this point the message must have been fully handled already */
 		if (msg) {
@@ -683,8 +683,8 @@
 			fd_msg_free(msg);
 		}
-		
+
 		goto psm_loop;
 	}
-	
+
 	/* The connection object is broken */
 	if (event == FDEVP_CNX_ERROR) {
@@ -696,5 +696,5 @@
 				CHECK_FCT_DO( fd_p_ce_process_receiver(peer), goto psm_end );
 				break;
-			
+
 			case STATE_WAITCEA:
 			case STATE_OPEN:
@@ -706,23 +706,23 @@
 				/* Mark the connection problem */
 				peer->p_flags.pf_cnx_pb = 1;
-			
+
 				fd_hook_call(HOOK_PEER_CONNECT_FAILED, NULL, peer, "The connection was broken", NULL);
-				
+
 				/* Destroy the connection, restart the timer to a new connection attempt */
 				fd_psm_next_timeout(peer, 1, peer->p_hdr.info.config.pic_tctimer ?: fd_g_config->cnf_timer_tc);
-				
+
 			case STATE_CLOSED:
 				goto psm_reset;
-				
+
 			case STATE_CLOSING:
 				/* We sent a DPR so we are terminating, do not wait for DPA */
 				goto psm_end;
-				
+
 			case STATE_CLOSING_GRACE:
 				if (peer->p_flags.pf_localterm) /* initiated here */
 					goto psm_end;
-				
+
 				fd_psm_cleanup(peer, 0);
-				
+
 				/* Reset the timer for next connection attempt */
 				fd_psm_next_timeout(peer, 1, fd_p_dp_newdelay(peer));
@@ -731,16 +731,16 @@
 		goto psm_loop;
 	}
-	
+
 	/* The connection notified a change in endpoints */
 	if (event == FDEVP_CNX_EP_CHANGE) {
 		/* We actually don't care if we are in OPEN state here... */
-		
+
 		/* Cleanup the remote LL and primary addresses */
 		CHECK_FCT_DO( fd_ep_filter( &peer->p_hdr.info.pi_endpoints, EP_FL_CONF | EP_FL_DISC | EP_FL_ADV ), /* ignore the error */);
 		CHECK_FCT_DO( fd_ep_clearflags( &peer->p_hdr.info.pi_endpoints, EP_FL_PRIMARY ), /* ignore the error */);
-		
+
 		/* Get the new ones */
 		CHECK_FCT_DO( fd_cnx_getremoteeps(peer->p_cnxctx, &peer->p_hdr.info.pi_endpoints), /* ignore the error */);
-		
+
 		/* We do not support local endpoints change currently, but it could be added here if needed (refresh fd_g_config->cnf_endpoints) */
 		{
@@ -750,17 +750,17 @@
 			free(buf);
 		}
-		
+
 		/* Done */
 		goto psm_loop;
 	}
-	
+
 	/* A new connection was established and CER containing this peer id was received */
 	if (event == FDEVP_CNX_INCOMING) {
 		struct cnx_incoming * params = ev_data;
 		ASSERT(params);
-		
+
 		/* Handle the message */
 		CHECK_FCT_DO( fd_p_ce_handle_newCER(&params->cer, peer, &params->cnx, params->validate), goto psm_end );
-		
+
 		/* Cleanup if needed */
 		if (params->cnx) {
@@ -772,18 +772,18 @@
 			params->cer = NULL;
 		}
-		
+
 		/* Loop */
 		free(ev_data);
 		goto psm_loop;
 	}
-	
+
 	/* A new connection has been established with the remote peer */
 	if (event == FDEVP_CNX_ESTABLISHED) {
 		struct cnxctx * cnx = ev_data;
-		
+
 		/* Release the resources of the connecting thread */
 		CHECK_POSIX_DO( pthread_join( peer->p_ini_thr, NULL), /* ignore, it is not a big deal */);
 		peer->p_ini_thr = (pthread_t)NULL;
-		
+
 		switch (cur_state) {
 			case STATE_WAITCNXACK_ELEC:
@@ -792,5 +792,5 @@
 				fd_p_ce_handle_newcnx(peer, cnx);
 				break;
-				
+
 			default:
 				/* Just abort the attempt and continue */
@@ -798,15 +798,15 @@
 				fd_cnx_destroy(cnx);
 		}
-		
+
 		goto psm_loop;
 	}
-	
+
 	/* A new connection has not been established with the remote peer */
 	if (event == FDEVP_CNX_FAILED) {
-		
+
 		/* Release the resources of the connecting thread */
 		CHECK_POSIX_DO( pthread_join( peer->p_ini_thr, NULL), /* ignore, it is not a big deal */);
 		peer->p_ini_thr = (pthread_t)NULL;
-		
+
 		switch (cur_state) {
 			case STATE_WAITCNXACK_ELEC:
@@ -816,18 +816,18 @@
 				CHECK_FCT_DO( fd_p_ce_process_receiver(peer), goto psm_end );
 				break;
-				
+
 			case STATE_WAITCNXACK:
 				/* Go back to CLOSE */
 				fd_psm_next_timeout(peer, 1, peer->p_hdr.info.config.pic_tctimer ?: fd_g_config->cnf_timer_tc);
 				goto psm_reset;
-				
+
 			default:
 				/* Just ignore */
 				TRACE_DEBUG(FULL, "Connection attempt failed but current state is %s, ignoring...", STATE_STR(cur_state));
 		}
-		
+
 		goto psm_loop;
 	}
-	
+
 	/* The timeout for the current state has been reached */
 	if (event == FDEVP_PSM_TIMEOUT) {
@@ -838,5 +838,5 @@
 				CHECK_FCT_DO( fd_p_dw_timeout(peer), goto psm_end );
 				goto psm_loop;
-				
+
 			case STATE_CLOSED:
 				LOG_D("%s: Connecting...", peer->p_hdr.info.pi_diamid);
@@ -845,5 +845,5 @@
 				CHECK_FCT_DO( fd_p_cnx_init(peer), goto psm_end );
 				goto psm_loop;
-				
+
 			case STATE_SUSPECT:
 				/* Mark the connection problem */
@@ -856,15 +856,15 @@
 				fd_psm_next_timeout(peer, 1, peer->p_hdr.info.config.pic_tctimer ?: fd_g_config->cnf_timer_tc);
 				goto psm_reset;
-				
+
 			case STATE_CLOSING_GRACE:
 				/* The grace period is completed, now close */
 				if (peer->p_flags.pf_localterm)
 					goto psm_end;
-				
+
 				fd_psm_cleanup(peer, 0);
 				/* Reset the timer for next connection attempt */
 				fd_psm_next_timeout(peer, 1, fd_p_dp_newdelay(peer));
 				goto psm_loop;
-				
+
 			case STATE_WAITCNXACK_ELEC:
 				/* Abort the initiating side */
@@ -873,10 +873,10 @@
 				CHECK_FCT_DO( fd_p_ce_process_receiver(peer), goto psm_end );
 				goto psm_loop;
-			
+
 			default:
 				ASSERT(0); /* implementation problem, we did not foresee this case? */
 		}
 	}
-	
+
 	/* Default action : the handling has not yet been implemented. [for debug only] */
 	TRACE_DEBUG(INFO, "Missing handler in PSM for '%s'\t<-- '%s'", STATE_STR(cur_state), fd_pev_str(event));
@@ -886,5 +886,5 @@
 	fd_psm_cleanup(peer, 0);
 	goto psm_loop;
-	
+
 psm_end:
 	cur_state = fd_peer_getstate(peer);
@@ -912,14 +912,14 @@
 {
 	TRACE_ENTRY("%p", peer);
-	
+
 	/* Check the peer and state are OK */
 	CHECK_PARAMS( fd_peer_getstate(peer) == STATE_NEW );
-	
+
 	/* Create the FIFO for events */
 	CHECK_FCT( fd_fifo_new(&peer->p_events, 0) );
-	
-	/* Create the PSM controler thread */
+
+	/* Create the PSM controller thread */
 	CHECK_POSIX( pthread_create( &peer->p_psm, NULL, p_psm_th, peer ) );
-	
+
 	/* We're done */
 	return 0;
@@ -931,5 +931,5 @@
 	TRACE_ENTRY("%p", peer);
 	CHECK_PARAMS( CHECK_PEER(peer) );
-	
+
 	if (fd_peer_getstate(peer) != STATE_ZOMBIE) {
 		CHECK_FCT( fd_event_send(peer->p_events, FDEVP_TERMINATE, 0, reason) );
@@ -944,14 +944,14 @@
 {
 	TRACE_ENTRY("%p", peer);
-	
+
 	/* Cancel PSM thread */
 	CHECK_FCT_DO( fd_thr_term(&peer->p_psm), /* continue */ );
-	
+
 	/* Cleanup the data */
 	fd_psm_cleanup(peer, 1);
-	
+
 	/* Destroy the event list */
 	CHECK_FCT_DO( fd_fifo_del(&peer->p_events), /* continue */ );
-	
+
 	/* Remaining cleanups are performed in fd_peer_free */
 	return;
