Changeset 706:4ffbc9f1e922 in freeDiameter for libfdcore/sctp.c
- Timestamp:
- Feb 9, 2011, 3:26:58 PM (13 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libfdcore/sctp.c
r691 r706 999 999 1000 1000 /* Send a buffer over a specified stream */ 1001 int fd_sctp_sendstr( int sock, uint16_t strid, uint8_t * buf, size_t len, uint32_t * cc_status)1001 int fd_sctp_sendstr(struct cnxctx * conn, uint16_t strid, uint8_t * buf, size_t len) 1002 1002 { 1003 1003 struct msghdr mhdr; … … 1009 1009 int timedout = 0; 1010 1010 1011 TRACE_ENTRY("% d %hu %p %zd %p", sock, strid, buf, len, cc_status);1012 CHECK_PARAMS(c c_status);1011 TRACE_ENTRY("%p %hu %p %zd", conn, strid, buf, len); 1012 CHECK_PARAMS(conn && buf && len); 1013 1013 1014 1014 memset(&mhdr, 0, sizeof(mhdr)); … … 1037 1037 mhdr.msg_controllen = sizeof(anci); 1038 1038 1039 TRACE_DEBUG(FULL, "Sending %db data on stream %hu of socket %d", len, strid, sock);1039 TRACE_DEBUG(FULL, "Sending %db data on stream %hu of socket %d", len, strid, conn->cc_socket); 1040 1040 again: 1041 ret = sendmsg( sock, &mhdr, 0);1041 ret = sendmsg(conn->cc_socket, &mhdr, 0); 1042 1042 /* Handle special case of timeout */ 1043 1043 if ((ret < 0) && (errno == EAGAIN)) { 1044 if (! (*cc_status & CC_STATUS_CLOSING))1044 if (! fd_cnx_teststate(conn, CC_STATUS_CLOSING )) 1045 1045 goto again; /* don't care, just ignore */ 1046 1046 if (!timedout) { … … 1057 1057 1058 1058 /* Receive the next data from the socket, or next notification */ 1059 int fd_sctp_recvmeta( int sock, uint16_t * strid, uint8_t ** buf, size_t * len, int *event, uint32_t * cc_status)1059 int fd_sctp_recvmeta(struct cnxctx * conn, uint16_t * strid, uint8_t ** buf, size_t * len, int *event) 1060 1060 { 1061 1061 ssize_t ret = 0; … … 1068 1068 int timedout = 0; 1069 1069 1070 TRACE_ENTRY("% d %p %p %p %p %p", sock, strid, buf, len, event, cc_status);1071 CHECK_PARAMS( (sock > 0) && buf && len && event && cc_status);1070 TRACE_ENTRY("%p %p %p %p %p", conn, strid, buf, len, event); 1071 CHECK_PARAMS( conn && buf && len && event ); 1072 1072 1073 1073 /* Cleanup out parameters */ … … 1098 1098 again: 1099 1099 pthread_cleanup_push(free, data); 1100 ret = recvmsg( sock, &mhdr, 0);1100 ret = recvmsg(conn->cc_socket, &mhdr, 0); 1101 1101 pthread_cleanup_pop(0); 1102 1102 1103 1103 /* First, handle timeouts (same as fd_cnx_s_recv) */ 1104 1104 if ((ret < 0) && (errno == EAGAIN)) { 1105 if (! (*cc_status & CC_STATUS_CLOSING))1105 if (! fd_cnx_teststate(conn, CC_STATUS_CLOSING )) 1106 1106 goto again; /* don't care, just ignore */ 1107 1107 if (!timedout) { … … 1132 1132 union sctp_notification * notif = (union sctp_notification *) data; 1133 1133 1134 TRACE_DEBUG(FULL, "Received %db data of notification on socket %d", datasize, sock);1134 TRACE_DEBUG(FULL, "Received %db data of notification on socket %d", datasize, conn->cc_socket); 1135 1135 1136 1136 switch (notif->sn_header.sn_type) { … … 1226 1226 *strid = sndrcv->sinfo_stream; 1227 1227 } 1228 TRACE_DEBUG(FULL, "Received %db data on socket %d, stream %hu", datasize, sock, *strid);1228 TRACE_DEBUG(FULL, "Received %db data on socket %d, stream %hu", datasize, conn->cc_socket, *strid); 1229 1229 } else { 1230 TRACE_DEBUG(FULL, "Received %db data on socket %d (stream ignored)", datasize, sock);1230 TRACE_DEBUG(FULL, "Received %db data on socket %d (stream ignored)", datasize, conn->cc_socket); 1231 1231 } 1232 1232
Note: See TracChangeset
for help on using the changeset viewer.