Changeset 1010:357c2f892d24 in freeDiameter for libfdcore/p_psm.c
- Timestamp:
- Mar 26, 2013, 12:39:32 AM (11 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libfdcore/p_psm.c
r975 r1010 45 45 begining and end of a connection lifetime. It means we need agility to 46 46 switch between "ordering enforced" and "ordering not enforced to counter 47 H otLB" modes of operation.48 49 The connection state machine represented in RFC3588 (and rfc3588bis) is47 Head of the Line Blocking" modes of operation. 48 49 The connection state machine represented in RFC3588 (and RFC6733) is 50 50 incomplete, because it lacks the SUSPECT state and the 3 DWR/DWA 51 51 exchanges (section 5.1) when the peer recovers from this state. … … 91 91 application message is lost. 92 92 93 This situation is actually quite possiblebecause DPR/DPA messages are93 This situation is actually happening easily because DPR/DPA messages are 94 94 very short, while application messages can be quite large. Therefore, 95 95 they require much more time to deliver. … … 97 97 I really cannot see a way to counter this effect by using the ordering 98 98 of the messages, except by applying a timer (state STATE_CLOSING_GRACE). 99 This timer can be also useful when we detect that some messages has not 100 yet received an answer on this link, to give time to the application to 101 complete the exchange ongoing. 99 102 100 103 However, this problem must be balanced with the fact that the message … … 197 200 return 0; 198 201 } 199 static int leave_open_state(struct fd_peer * peer )202 static int leave_open_state(struct fd_peer * peer, int skip_failover) 200 203 { 201 204 /* Remove from active peers list */ … … 208 211 209 212 /* Failover the messages */ 210 fd_peer_failover_msg(peer); 213 if (!skip_failover) { 214 fd_peer_failover_msg(peer); 215 } 211 216 212 217 return 0; … … 288 293 289 294 if (old == STATE_OPEN) { 290 CHECK_FCT( leave_open_state(peer) ); 291 } 292 295 CHECK_FCT( leave_open_state(peer, new_state == STATE_CLOSING_GRACE) ); 296 } 297 if (old == STATE_CLOSING_GRACE) { 298 fd_peer_failover_msg(peer); 299 } 300 293 301 if (new_state == STATE_OPEN) { 294 302 CHECK_FCT( enter_open_state(peer) ); … … 298 306 /* Purge event list */ 299 307 fd_psm_events_free(peer); 308 309 /* Reset the counter of pending anwers to send */ 310 peer->p_reqin_count = 0; 300 311 301 312 /* If the peer is not persistant, we destroy it */ … … 529 540 fd_msg_log( FD_MSG_LOG_TIMING, msg, "Answer received in %d.%06.6d sec.", delay.tv_sec, delay.tv_nsec / 1000 ); 530 541 } 542 } else { 543 /* Mark the incoming request so that we know we have pending answers for this peer */ 544 CHECK_POSIX_DO( pthread_mutex_lock(&peer->p_state_mtx), goto psm_end ); 545 peer->p_reqin_count++; 546 CHECK_POSIX_DO( pthread_mutex_unlock(&peer->p_state_mtx), goto psm_end ); 531 547 } 532 548
Note: See TracChangeset
for help on using the changeset viewer.