Changeset 229:965f5971dc23 in freeDiameter for freeDiameter/p_out.c
- Timestamp:
- Mar 2, 2010, 3:55:26 PM (14 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
freeDiameter/p_out.c
r208 r229 37 37 38 38 /* Alloc a new hbh for requests, bufferize the message and send on the connection, save in sentreq if provided */ 39 static int do_send(struct msg ** msg, struct cnxctx * cnx, uint32_t * hbh, struct sr_list * srl)39 static int do_send(struct msg ** msg, uint32_t flags, struct cnxctx * cnx, uint32_t * hbh, struct sr_list * srl) 40 40 { 41 41 struct msg_hdr * hdr; 42 int msg_is_a_req , msg_is_appl;42 int msg_is_a_req; 43 43 uint8_t * buf; 44 44 size_t sz; … … 46 46 uint32_t bkp_hbh = 0; 47 47 48 TRACE_ENTRY("%p % p %p %p", msg, cnx, hbh, srl);48 TRACE_ENTRY("%p %x %p %p %p", msg, flags, cnx, hbh, srl); 49 49 50 50 /* Retrieve the message header */ … … 59 59 *hbh = hdr->msg_hbhid + 1; 60 60 } 61 62 msg_is_appl = fd_msg_is_routable(*msg);63 61 64 62 /* Log the message */ … … 79 77 80 78 /* Send the message */ 81 CHECK_FCT_DO( ret = fd_cnx_send(cnx, buf, sz, !msg_is_appl), { free(buf); return ret; } );79 CHECK_FCT_DO( ret = fd_cnx_send(cnx, buf, sz, flags), { free(buf); return ret; } ); 82 80 pthread_cleanup_pop(1); 83 81 … … 122 120 123 121 /* Send the message, log any error */ 124 CHECK_FCT_DO( do_send(&msg, peer->p_cnxctx, &peer->p_hbh, &peer->p_sr),122 CHECK_FCT_DO( do_send(&msg, 0, peer->p_cnxctx, &peer->p_hbh, &peer->p_sr), 125 123 { 126 124 fd_log_debug("An error occurred while sending this message, it is lost:\n"); … … 139 137 } 140 138 141 /* Wrapper to sending a message either by out thread (peer in OPEN state) or directly; cnx or peer must be provided */142 int fd_out_send(struct msg ** msg, struct cnxctx * cnx, struct fd_peer * peer )139 /* Wrapper to sending a message either by out thread (peer in OPEN state) or directly; cnx or peer must be provided. Flags are valid only for direct sending, not through thread (unused) */ 140 int fd_out_send(struct msg ** msg, struct cnxctx * cnx, struct fd_peer * peer, uint32_t flags) 143 141 { 144 TRACE_ENTRY("%p %p %p ", msg, cnx, peer);142 TRACE_ENTRY("%p %p %p %x", msg, cnx, peer, flags); 145 143 CHECK_PARAMS( msg && *msg && (cnx || (peer && peer->p_cnxctx))); 146 144 … … 160 158 161 159 /* Do send the message */ 162 CHECK_FCT_DO( do_send(msg, cnx, hbh, peer ? &peer->p_sr : NULL),160 CHECK_FCT_DO( do_send(msg, flags, cnx, hbh, peer ? &peer->p_sr : NULL), 163 161 { 164 162 fd_log_debug("An error occurred while sending this message, it is lost:\n");
Note: See TracChangeset
for help on using the changeset viewer.