Changeset 1216:581bbd48524a in freeDiameter
- Timestamp:
- Jun 19, 2013, 11:03:24 PM (11 years ago)
- Branch:
- default
- Children:
- 1217:3f7c74ef3787, 1218:152466ff49f8
- Phase:
- public
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/dbg_rt/dbg_rt.c
r1127 r1216 59 59 60 60 /* Path selection debug callback */ 61 static int dbgrt_out_cb(void * cbdata, struct msg * 61 static int dbgrt_out_cb(void * cbdata, struct msg ** pmsg, struct fd_list * candidates) 62 62 { 63 63 struct fd_list * li; 64 struct msg * msg = *pmsg; 64 65 char * buf = NULL; size_t buflen; 65 66 -
extensions/rt_default/rt_default.c
r741 r1216 41 41 42 42 /* The callback called on new messages */ 43 static int rtd_out(void * cbdata, struct msg * 43 static int rtd_out(void * cbdata, struct msg ** pmsg, struct fd_list * candidates) 44 44 { 45 struct msg * msg = *pmsg; 45 46 TRACE_ENTRY("%p %p %p", cbdata, msg, candidates); 46 47 -
extensions/rt_ereg/rtereg.c
r1127 r1216 126 126 127 127 /* The callback called on new messages */ 128 static int rtereg_out(void * cbdata, struct msg * msg, struct fd_list * candidates) 129 { 128 static int rtereg_out(void * cbdata, struct msg ** pmsg, struct fd_list * candidates) 129 { 130 struct msg * msg = *pmsg; 130 131 struct avp * avp = NULL; 131 132 -
extensions/rt_load_balance/rt_load_balance.c
r1043 r1216 37 37 38 38 /* The callback for load balancing the requests across the peers */ 39 static int rt_load_balancing(void * cbdata, struct msg * 39 static int rt_load_balancing(void * cbdata, struct msg ** pmsg, struct fd_list * candidates) 40 40 { 41 41 struct fd_list *lic; 42 struct msg * msg = *pmsg; 42 43 43 44 TRACE_ENTRY("%p %p %p", cbdata, msg, candidates); -
extensions/rt_redirect/redir_out.c
r1127 r1216 38 38 39 39 /* Find the data pertinent to a type in the input data */ 40 static int get_data_to_match(enum redir_h_u type, struct msg * 40 static int get_data_to_match(enum redir_h_u type, struct msg *msg, union matchdata * data, int * nodata) 41 41 { 42 42 TRACE_ENTRY("%d %p %p %p", type, msg, data, nodata); … … 220 220 221 221 /* OUT callback */ 222 int redir_out_cb(void * cbdata, struct msg * 222 int redir_out_cb(void * cbdata, struct msg ** pmsg, struct fd_list * candidates) 223 223 { 224 224 int i, ret = 0; 225 struct msg * msg = *pmsg; 225 226 226 227 TRACE_ENTRY("%p %p %p", cbdata, msg, candidates); -
extensions/rt_redirect/rt_redir.h
r740 r1216 171 171 172 172 /* Out callback */ 173 int redir_out_cb(void * cbdata, struct msg * 173 int redir_out_cb(void * cbdata, struct msg ** pmsg, struct fd_list * candidates); -
extensions/test_rt_any/test_rt_any.c
r741 r1216 41 41 42 42 /* The callback */ 43 static int tra_out_cb(void * cbdata, struct msg * 43 static int tra_out_cb(void * cbdata, struct msg ** pmsg, struct fd_list * candidates) 44 44 { 45 struct msg * msg = *pmsg; 45 46 struct fd_list * li; 46 47 -
include/freeDiameter/libfdcore.h
r1194 r1216 763 763 * ENOMEM : Not enough memory to complete the operation 764 764 */ 765 int fd_rt_out_register ( int (*rt_out_cb)(void * cbdata, struct msg * 765 int fd_rt_out_register ( int (*rt_out_cb)(void * cbdata, struct msg ** pmsg, struct fd_list * candidates), void * cbdata, int priority, struct fd_rt_out_hdl ** handler ); 766 766 /* 767 767 * CALLBACK: rt_out_cb … … 769 769 * PARAMETERS: 770 770 * cbdata : pointer to some data that was registered with the callback. 771 * msg : The message that must besent.771 * pmsg : pointer to the message that must be sent. upon return if *msg is NULL, the processing stops and the message is not sent. 772 772 * list : The list of peers to which the message may be sent to, as returned by fd_rtd_candidate_extract 773 773 * -
libfdcore/routing_dispatch.c
r1212 r1216 58 58 union { 59 59 int (*rt_fwd_cb)(void * cbdata, struct msg ** msg); 60 int (*rt_out_cb)(void * cbdata, struct msg * msg, struct fd_list * candidates);60 int (*rt_out_cb)(void * cbdata, struct msg ** msg, struct fd_list * candidates); 61 61 }; 62 62 }; … … 135 135 136 136 /* Register a new OUT callback */ 137 int fd_rt_out_register ( int (*rt_out_cb)(void * cbdata, struct msg * 137 int fd_rt_out_register ( int (*rt_out_cb)(void * cbdata, struct msg ** pmsg, struct fd_list * candidates), void * cbdata, int priority, struct fd_rt_out_hdl ** handler ) 138 138 { 139 139 struct rt_hdl * new; … … 189 189 190 190 /* Prevent sending to peers that do not support the message application */ 191 static int dont_send_if_no_common_app(void * cbdata, struct msg * msg, struct fd_list * candidates) 192 { 191 static int dont_send_if_no_common_app(void * cbdata, struct msg ** pmsg, struct fd_list * candidates) 192 { 193 struct msg * msg = *pmsg; 193 194 struct fd_list * li; 194 195 struct msg_hdr * hdr; … … 221 222 222 223 /* Detect if the Destination-Host and Destination-Realm match the peer */ 223 static int score_destination_avp(void * cbdata, struct msg * msg, struct fd_list * candidates) 224 { 224 static int score_destination_avp(void * cbdata, struct msg ** pmsg, struct fd_list * candidates) 225 { 226 struct msg * msg = *pmsg; 225 227 struct fd_list * li; 226 228 struct avp * avp; … … 959 961 960 962 /* We call the cb by reverse priority order */ 961 for ( li = rt_out_list.prev ; li != &rt_out_list; li = li->prev ) {963 for ( li = rt_out_list.prev ; (msgptr != NULL) && (li != &rt_out_list) ; li = li->prev ) { 962 964 struct rt_hdl * rh = (struct rt_hdl *)li; 963 965 964 966 TRACE_DEBUG(ANNOYING, "Calling next OUT callback on %p : %p (prio %d)", msgptr, rh->rt_out_cb, rh->prio); 965 CHECK_FCT_DO( ret = (*rh->rt_out_cb)(rh->cbdata, msgptr, candidates),967 CHECK_FCT_DO( ret = (*rh->rt_out_cb)(rh->cbdata, &msgptr, candidates), 966 968 { 967 969 char buf[256]; … … 971 973 fd_msg_free(msgptr); 972 974 msgptr = NULL; 973 break;974 975 } ); 975 976 } … … 978 979 CHECK_FCT( pthread_rwlock_unlock( &rt_out_lock ) ); 979 980 980 /* If an error occurred , skip to thenext message */981 /* If an error occurred or the callback disposed of the message, go to next message */ 981 982 if (! msgptr) { 982 if (rtd)983 fd_rtd_free(&rtd);984 983 return 0; 985 984 }
Note: See TracChangeset
for help on using the changeset viewer.