Changeset 688:8c3dc8584dab in freeDiameter for libfdproto/messages.c
- Timestamp:
- Jan 19, 2011, 7:05:30 PM (13 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libfdproto/messages.c
r687 r688 793 793 794 794 /* Dump a message to a specified file stream */ 795 staticvoid fd_msg_dump_fstr ( struct msg * msg, FILE * fstr )795 void fd_msg_dump_fstr ( struct msg * msg, FILE * fstr ) 796 796 { 797 797 msg_or_avp * ref = msg; … … 2263 2263 *action = DISP_ACT_ERROR; 2264 2264 } else { 2265 TRACE_DEBUG(INFO, "Received an answer to a local query with an unsupported application %d, discarding...", (*msg)->msg_public.msg_appl); 2266 fd_msg_dump_walk(INFO, *msg); 2265 fd_msg_log( FD_MSG_LOG_DROPPED, *msg, "Internal error: Received this answer to a local query with an unsupported application %d", (*msg)->msg_public.msg_appl); 2267 2266 fd_msg_free(*msg); 2268 2267 *msg = NULL; … … 2337 2336 pthread_mutex_t lock; 2338 2337 int init; 2338 struct dictionary *dict; 2339 2339 } ml_conf = { .lock = PTHREAD_MUTEX_INITIALIZER, .init = 0 }; 2340 2340 2341 static void ml_conf_init(void)2341 void ml_conf_init(struct dictionary *dict) 2342 2342 { 2343 2343 memset(&ml_conf.causes, 0, sizeof(ml_conf.causes)); 2344 2344 ml_conf.init = 1; 2345 ml_conf.dict = dict; 2345 2346 } 2346 2347 … … 2357 2358 CHECK_POSIX( pthread_mutex_lock(&ml_conf.lock) ); 2358 2359 if (!ml_conf.init) { 2359 ml_conf_init();2360 ASSERT(0); 2360 2361 } 2361 2362 … … 2406 2407 CHECK_POSIX_DO( pthread_mutex_lock(&ml_conf.lock), ); 2407 2408 if (!ml_conf.init) { 2408 ml_conf_init();2409 ASSERT(0); 2409 2410 } 2410 2411 meth = ml_conf.causes[cause].meth; … … 2420 2421 case FD_MSG_LOGTO_FILE: 2421 2422 TODO("Log to arg file"); 2423 TODO("Log a note to debug stream"); 2422 2424 break; 2423 2425 case FD_MSG_LOGTO_DIR: 2424 2426 TODO("Log to arg directory in a new file"); 2425 break; 2426 } 2427 2428 /* Then dump the prefix message to this stream */ 2427 TODO("Log a note to debug stream"); 2428 break; 2429 } 2430 2431 /* For file methods, let's parse the message so it looks better */ 2432 if ((meth != FD_MSG_LOGTO_DEBUGONLY) && ml_conf.dict) { 2433 CHECK_FCT_DO( fd_msg_parse_dict( msg, ml_conf.dict, NULL ), ); 2434 } 2435 2436 /* Then dump the prefix message to this stream, & to debug stream */ 2429 2437 (void)pthread_mutex_lock(&fd_log_lock); 2430 2438 pthread_cleanup_push(fd_cleanup_mutex_silent, &fd_log_lock);
Note: See TracChangeset
for help on using the changeset viewer.