comparison freeDiameter/p_psm.c @ 49:204718b0fa54

Couple of fixes
author Sebastien Decugis <sdecugis@nict.go.jp>
date Fri, 27 Nov 2009 16:45:32 +0900
parents 2db15632a63d
children 114fac60bc8e
comparison
equal deleted inserted replaced
48:2b1cba7e949d 49:204718b0fa54
608 if (event == FDEVP_PSM_TIMEOUT) { 608 if (event == FDEVP_PSM_TIMEOUT) {
609 switch (peer->p_hdr.info.runtime.pir_state) { 609 switch (peer->p_hdr.info.runtime.pir_state) {
610 case STATE_OPEN: 610 case STATE_OPEN:
611 case STATE_REOPEN: 611 case STATE_REOPEN:
612 CHECK_FCT_DO( fd_p_dw_timeout(peer), goto psm_end ); 612 CHECK_FCT_DO( fd_p_dw_timeout(peer), goto psm_end );
613 break; 613 goto psm_loop;
614 614
615 case STATE_CLOSED: 615 case STATE_CLOSED:
616 CHECK_FCT_DO( fd_psm_change_state(peer, STATE_WAITCNXACK), goto psm_end ); 616 CHECK_FCT_DO( fd_psm_change_state(peer, STATE_WAITCNXACK), goto psm_end );
617 fd_psm_next_timeout(peer, 0, CNX_TIMEOUT); 617 fd_psm_next_timeout(peer, 0, CNX_TIMEOUT);
618 CHECK_FCT_DO( fd_p_cnx_init(peer), goto psm_end ); 618 CHECK_FCT_DO( fd_p_cnx_init(peer), goto psm_end );
619 break; 619 goto psm_loop;
620 620
621 case STATE_CLOSING: 621 case STATE_CLOSING:
622 case STATE_SUSPECT: 622 case STATE_SUSPECT:
623 case STATE_WAITCNXACK: 623 case STATE_WAITCNXACK:
624 case STATE_WAITCEA: 624 case STATE_WAITCEA:
625 /* Destroy the connection, restart the timer to a new connection attempt */ 625 /* Destroy the connection, restart the timer to a new connection attempt */
626 fd_psm_cleanup(peer, 0); 626 fd_psm_cleanup(peer, 0);
627 fd_psm_next_timeout(peer, 1, peer->p_hdr.info.config.pic_tctimer ?: fd_g_config->cnf_timer_tc); 627 fd_psm_next_timeout(peer, 1, peer->p_hdr.info.config.pic_tctimer ?: fd_g_config->cnf_timer_tc);
628 break; 628 goto psm_loop;
629 629
630 case STATE_WAITCNXACK_ELEC: 630 case STATE_WAITCNXACK_ELEC:
631 631
632 /* Abort the initiating side */ 632 /* Abort the initiating side */
633 fd_p_cnx_abort(peer, 0); 633 fd_p_cnx_abort(peer, 0);
634 634
635 /* Handle receiver side */ 635 /* Handle receiver side */
636 CHECK_FCT_DO( fd_p_ce_process_receiver(peer), goto psm_end ); 636 CHECK_FCT_DO( fd_p_ce_process_receiver(peer), goto psm_end );
637 break; 637 goto psm_loop;
638 } 638 }
639 } 639 }
640 640
641 /* Default action : the handling has not yet been implemented. [for debug only] */ 641 /* Default action : the handling has not yet been implemented. [for debug only] */
642 TODO("Missing handler in PSM : '%s'\t<-- '%s'", STATE_STR(peer->p_hdr.info.runtime.pir_state), fd_pev_str(event)); 642 TODO("Missing handler in PSM : '%s'\t<-- '%s'", STATE_STR(peer->p_hdr.info.runtime.pir_state), fd_pev_str(event));
643 if (event == FDEVP_PSM_TIMEOUT) {
644 /* We have not handled timeout in this state, let's postpone next alert to avoid flood */
645 fd_psm_next_timeout(peer, 0, 60);
646 }
647
648 goto psm_loop; 643 goto psm_loop;
649 644
650 psm_end: 645 psm_end:
651 fd_psm_cleanup(peer, 1); 646 fd_psm_cleanup(peer, 1);
652 pthread_cleanup_pop(1); /* set STATE_ZOMBIE */ 647 pthread_cleanup_pop(1); /* set STATE_ZOMBIE */
"Welcome to our mercurial repository"