Changeset 1103:d8591b1c56cd in freeDiameter for libfdcore/p_out.c
- Timestamp:
- May 10, 2013, 7:48:57 PM (11 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libfdcore/p_out.c
r1084 r1103 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, uint32_t flags, 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 fd_peer * peer) 40 40 { 41 41 struct msg_hdr * hdr; … … 45 45 int ret; 46 46 uint32_t bkp_hbh = 0; 47 48 TRACE_ENTRY("%p %x %p %p %p", msg, flags, cnx, hbh, srl); 47 struct msg *cpy_for_logs_only; 48 49 TRACE_ENTRY("%p %x %p %p %p", msg, flags, cnx, hbh, peer); 49 50 50 51 /* Retrieve the message header */ … … 53 54 msg_is_a_req = (hdr->msg_flags & CMD_FLAG_REQUEST); 54 55 if (msg_is_a_req) { 55 CHECK_PARAMS(hbh && srl);56 CHECK_PARAMS(hbh && peer); 56 57 /* Alloc the hop-by-hop id and increment the value for next message */ 57 58 bkp_hbh = hdr->msg_hbhid; … … 64 65 pthread_cleanup_push( free, buf ); 65 66 66 //cpy_for_logs_only = *msg;67 cpy_for_logs_only = *msg; 67 68 68 69 /* Save a request before sending so that there is no race condition with the answer */ 69 70 if (msg_is_a_req) { 70 CHECK_FCT_DO( ret = fd_p_sr_store( srl, msg, &hdr->msg_hbhid, bkp_hbh), goto out );71 CHECK_FCT_DO( ret = fd_p_sr_store(&peer->p_sr, msg, &hdr->msg_hbhid, bkp_hbh), goto out ); 71 72 } 72 73 73 74 /* Log the message */ 74 // fd_msg_log( FD_MSG_LOG_SENT, cpy_for_logs_only, "Sent to '%s'", fd_cnx_getid(cnx));75 fd_hook_call(HOOK_MESSAGE_SENT, cpy_for_logs_only, peer, NULL, fd_msg_pmdl_get(cpy_for_logs_only)); 75 76 76 77 /* Send the message */ … … 127 128 128 129 /* Send the message, log any error */ 129 CHECK_FCT_DO( ret = do_send(&msg, 0, peer->p_cnxctx, &peer->p_hbh, &peer->p_sr),130 CHECK_FCT_DO( ret = do_send(&msg, 0, peer->p_cnxctx, &peer->p_hbh, peer), 130 131 { 131 132 if (msg) { … … 179 180 180 181 /* Do send the message */ 181 CHECK_FCT_DO( ret = do_send(msg, flags, cnx, hbh, peer ? &peer->p_sr : NULL),182 CHECK_FCT_DO( ret = do_send(msg, flags, cnx, hbh, peer), 182 183 { 183 184 if (msg) {
Note: See TracChangeset
for help on using the changeset viewer.