Changeset 1200:ce2b00dc86c1 in freeDiameter for libfdcore/sctp.c
- Timestamp:
- Jun 14, 2013, 11:14:11 AM (11 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libfdcore/sctp.c
r1198 r1200 1084 1084 #endif /* OLD_SCTP_SOCKET_API */ 1085 1085 ssize_t ret; 1086 int timedout = 0;1086 struct timespec ts, now; 1087 1087 1088 1088 TRACE_ENTRY("%p %hu %p %d", conn, strid, iov, iovcnt); 1089 1089 CHECK_PARAMS_DO(conn && iov && iovcnt, { errno = EINVAL; return -1; } ); 1090 CHECK_SYS_DO( clock_gettime(CLOCK_REALTIME, &ts), return -1 ); 1090 1091 1091 1092 memset(&mhdr, 0, sizeof(mhdr)); … … 1121 1122 if ((ret < 0) && ((errno == EAGAIN) || (errno == EINTR))) { 1122 1123 pthread_testcancel(); 1123 if (! fd_cnx_teststate(conn, CC_STATUS_CLOSING )) 1124 /* Check how much time we were blocked for this sending. */ 1125 CHECK_SYS_DO( clock_gettime(CLOCK_REALTIME, &now), return -1 ); 1126 if ( ((now.tv_sec - ts.tv_sec) * 1000 + ((now.tv_nsec - ts.tv_nsec) / 1000000L)) > MAX_HOTL_BLOCKING_TIME) { 1127 LOG_D("Unable to send any data for %dms, closing the connection", MAX_HOTL_BLOCKING_TIME); 1128 } else if (! fd_cnx_teststate(conn, CC_STATUS_CLOSING )) { 1124 1129 goto again; /* don't care, just ignore */ 1125 if (!timedout) { 1126 timedout ++; /* allow for one timeout while closing */ 1127 goto again; 1128 } 1130 } 1131 1132 /* propagate the error */ 1133 errno = -ret; 1134 ret = -1; 1129 1135 } 1130 1136
Note: See TracChangeset
for help on using the changeset viewer.