Changeset 1103:d8591b1c56cd in freeDiameter for libfdcore/messages.c
- Timestamp:
- May 10, 2013, 7:48:57 PM (11 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libfdcore/messages.c
r1078 r1103 346 346 347 347 /* Parse a message against our dictionary, and in case of error log and eventually build the error reply -- returns the parsing status */ 348 int fd_msg_parse_or_error( struct msg ** msg 348 int fd_msg_parse_or_error( struct msg ** msg, struct msg **error) 349 349 { 350 350 int ret = 0; … … 355 355 TRACE_ENTRY("%p", msg); 356 356 357 CHECK_PARAMS(msg && *msg );357 CHECK_PARAMS(msg && *msg && error); 358 358 m = *msg; 359 *error = NULL; 359 360 360 361 /* Parse the message against our dictionary */ … … 364 365 return ret; /* 0 or another error */ 365 366 366 TRACE_DEBUG(INFO, "A message does not comply to the dictionary and/or rules (%s)", pei.pei_errcode);367 fd_ msg_dump_walk(FULL, m);367 /* Log */ 368 fd_hook_call(HOOK_MESSAGE_PARSING_ERROR, m, NULL, pei.pei_message ?: pei.pei_errcode, fd_msg_pmdl_get(m)); 368 369 369 370 CHECK_FCT( fd_msg_hdr(m, &hdr) ); … … 373 374 374 375 /* Create the error message */ 375 CHECK_FCT( fd_msg_new_answer_from_req ( fd_g_config->cnf_dict, msg, pei.pei_protoerr ? MSGFL_ANSW_ERROR : 0 ) );376 CHECK_FCT( fd_msg_new_answer_from_req ( fd_g_config->cnf_dict, &m, pei.pei_protoerr ? MSGFL_ANSW_ERROR : 0 ) ); 376 377 377 378 /* Set the error code */ 378 CHECK_FCT( fd_msg_rescode_set(*msg, pei.pei_errcode, pei.pei_message, pei.pei_avp, 1 ) ); 379 CHECK_FCT( fd_msg_rescode_set(m, pei.pei_errcode, pei.pei_message, pei.pei_avp, 1 ) ); 380 381 *msg = NULL; 382 *error = m; 379 383 380 384 } else { … … 409 413 default: /* Other errors */ 410 414 /* We let the application decide what to do with the message, we rescue it */ 411 return 0;415 *error = m; 412 416 } 413 417 } 414 418 } while (0); 415 416 /* Just discard */417 //fd_msg_log( FD_MSG_LOG_DROPPED, m, "Answer not compliant to dictionary's ABNF (%s)", pei.pei_errcode );418 CHECK_FCT( fd_msg_free( m ) );419 *msg = NULL;420 419 } 421 420
Note: See TracChangeset
for help on using the changeset viewer.