Changeset 691:78b665400097 in freeDiameter for libfdcore/p_cnx.c
- Timestamp:
- Jan 20, 2011, 7:44:27 PM (13 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libfdcore/p_cnx.c
r662 r691 211 211 struct next_conn * nc = NULL; 212 212 int rebuilt = 0; 213 int fatal_error=0; 213 214 214 215 TRACE_ENTRY("%p", arg); … … 226 227 if (FD_IS_LIST_EMPTY(&peer->p_connparams)) { 227 228 if (! rebuilt) { 228 CHECK_FCT_DO( prepare_connection_list(peer), goto fatal_error);229 CHECK_FCT_DO( fatal_error = prepare_connection_list(peer), goto out ); 229 230 rebuilt ++; 230 231 } … … 232 233 /* We encountered an error or we have looped over all the addresses of the peer. */ 233 234 TRACE_DEBUG(INFO, "Unable to connect to the peer %s, aborting attempts for now.", peer->p_hdr.info.pi_diamid); 234 CHECK_FCT_DO( f d_event_send(peer->p_events, FDEVP_CNX_FAILED, 0, NULL), goto fatal_error);235 CHECK_FCT_DO( fatal_error = fd_event_send(peer->p_events, FDEVP_CNX_FAILED, 0, NULL), goto out ); 235 236 return NULL; 236 237 } … … 277 278 empty_connection_list(peer); 278 279 fd_ep_filter(&peer->p_hdr.info.pi_endpoints, EP_FL_CONF); 279 return NULL;280 goto out_pop; 280 281 } ); 281 282 } else { 282 283 /* Prepare to receive the next message */ 283 CHECK_FCT_DO( f d_cnx_start_clear(cnx, 0), goto fatal_error);284 CHECK_FCT_DO( fatal_error = fd_cnx_start_clear(cnx, 0), goto out_pop ); 284 285 } 285 286 286 287 /* Upon success, generate FDEVP_CNX_ESTABLISHED */ 287 CHECK_FCT_DO( fd_event_send(peer->p_events, FDEVP_CNX_ESTABLISHED, 0, cnx), goto fatal_error ); 288 288 CHECK_FCT_DO( fatal_error = fd_event_send(peer->p_events, FDEVP_CNX_ESTABLISHED, 0, cnx), ); 289 out_pop: 290 ; 289 291 pthread_cleanup_pop(0); 290 292 291 return NULL; 292 293 fatal_error: 294 /* Cleanup the connection */ 295 if (cnx) 296 fd_cnx_destroy(cnx); 297 298 /* Generate a termination event */ 299 CHECK_FCT_DO(fd_event_send(fd_g_config->cnf_main_ev, FDEV_TERMINATE, 0, NULL), ); 293 out: 294 295 if (fatal_error) { 296 297 /* Cleanup the connection */ 298 if (cnx) 299 fd_cnx_destroy(cnx); 300 301 /* Generate a termination event */ 302 CHECK_FCT_DO(fd_event_send(fd_g_config->cnf_main_ev, FDEV_TERMINATE, 0, NULL), ); 303 } 300 304 301 305 return NULL;
Note: See TracChangeset
for help on using the changeset viewer.