Changeset 710:e60376cb15e8 in freeDiameter
- Timestamp:
- Feb 10, 2011, 4:00:53 PM (13 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
libfdcore/cnxctx.c
r709 r710 622 622 again: 623 623 ret = recv(conn->cc_socket, buffer, length, 0); 624 /* Handle special case of timeout */ 625 if ((ret < 0) && (errno == EAGAIN)) { 624 /* Handle special case of timeout / interrupts */ 625 if ((ret < 0) && ((errno == EAGAIN) || (errno == EINTR))) { 626 pthread_testcancel(); 626 627 if (! fd_cnx_teststate(conn, CC_STATUS_CLOSING )) 627 628 goto again; /* don't care, just ignore */ … … 649 650 ret = send(conn->cc_socket, buffer, length, 0); 650 651 /* Handle special case of timeout */ 651 if ((ret < 0) && (errno == EAGAIN)) { 652 if ((ret < 0) && ((errno == EAGAIN) || (errno == EINTR))) { 653 pthread_testcancel(); 652 654 if (! fd_cnx_teststate(conn, CC_STATUS_CLOSING )) 653 655 goto again; /* don't care, just ignore */ -
libfdcore/sctp.c
r706 r710 1041 1041 ret = sendmsg(conn->cc_socket, &mhdr, 0); 1042 1042 /* Handle special case of timeout */ 1043 if ((ret < 0) && (errno == EAGAIN)) { 1043 if ((ret < 0) && ((errno == EAGAIN) || (errno == EINTR))) { 1044 pthread_testcancel(); 1044 1045 if (! fd_cnx_teststate(conn, CC_STATUS_CLOSING )) 1045 1046 goto again; /* don't care, just ignore */ … … 1099 1100 pthread_cleanup_push(free, data); 1100 1101 ret = recvmsg(conn->cc_socket, &mhdr, 0); 1102 pthread_testcancel(); 1101 1103 pthread_cleanup_pop(0); 1102 1104 1103 1105 /* First, handle timeouts (same as fd_cnx_s_recv) */ 1104 if ((ret < 0) && ( errno == EAGAIN)) {1106 if ((ret < 0) && ((errno == EAGAIN) || (errno == EINTR))) { 1105 1107 if (! fd_cnx_teststate(conn, CC_STATUS_CLOSING )) 1106 1108 goto again; /* don't care, just ignore */ -
libfdproto/fdproto-internal.h
r706 r710 52 52 53 53 /* Special message dump function */ 54 void fd_msg_dump_fstr_one ( struct msg * msg, FILE * fstr ); 54 55 void fd_msg_dump_fstr ( struct msg * msg, FILE * fstr ); 55 56 -
libfdproto/messages.c
r706 r710 808 808 } while (ref); 809 809 } 810 void fd_msg_dump_fstr_one ( struct msg * msg, FILE * fstr ) /* just the header */ 811 { 812 msg_dump_intern ( NONE, msg, 2, fstr ); 813 } 810 814 811 815 /* Dump a message content -- for debug mostly */ -
libfdproto/msg_log.c
r689 r710 109 109 FILE * fstr; 110 110 111 char buftime[256]; 112 size_t offset = 0; 113 struct timespec ts; 114 struct tm tm; 115 111 116 TRACE_ENTRY("%d %p %p", cause, msg, prefix_format); 112 117 CHECK_PARAMS_DO( (cause >= 0) && (cause <= FD_MSG_LOG_MAX), … … 125 130 CHECK_POSIX_DO( pthread_mutex_unlock(&ml_conf.lock), ); 126 131 132 /* Get current time */ 133 CHECK_SYS_DO( clock_gettime(CLOCK_REALTIME, &ts), /* continue */); 134 offset += strftime(buftime + offset, sizeof(buftime) - offset, "%D,%T", localtime_r( &ts.tv_sec , &tm )); 135 offset += snprintf(buftime + offset, sizeof(buftime) - offset, ".%6.6ld", ts.tv_nsec / 1000); 136 137 127 138 /* Okay, now we will create the file descriptor */ 128 139 switch (meth) { … … 142 153 143 154 /* For file methods, let's parse the message so it looks better */ 144 if (( meth != FD_MSG_LOGTO_DEBUGONLY) && ml_conf.dict) {155 if (((meth != FD_MSG_LOGTO_DEBUGONLY) || (fd_g_debug_lvl > FULL)) && ml_conf.dict) { 145 156 CHECK_FCT_DO( fd_msg_parse_dict( msg, ml_conf.dict, NULL ), ); 146 157 } … … 155 166 pthread_cleanup_pop(0); 156 167 (void)pthread_mutex_unlock(&fd_log_lock); 157 fd_log_debug_fstr(fstr, "\n\n"); 168 169 fd_log_debug_fstr(fstr, "\nLogged: %s\n\n", buftime); 158 170 159 171 /* And now the message itself */ 160 fd_msg_dump_fstr(msg, fstr); 172 if ((meth == FD_MSG_LOGTO_DEBUGONLY) && (fd_g_debug_lvl <= INFO)) { 173 /* dump only the header */ 174 fd_msg_dump_fstr_one(msg, fstr); 175 } else { 176 /* dump the full content */ 177 fd_msg_dump_fstr(msg, fstr); 178 } 161 179 162 180 /* And finally close the stream if needed */ 163 TODO("close?"); 181 switch (meth) { 182 case FD_MSG_LOGTO_DEBUGONLY: 183 break; 184 185 case FD_MSG_LOGTO_FILE: 186 TODO("close?"); 187 break; 188 case FD_MSG_LOGTO_DIR: 189 TODO("close?"); 190 break; 191 } 164 192 } 165 193
Note: See TracChangeset
for help on using the changeset viewer.