comparison libfdcore/hooks.c @ 1301:50fb308e84f7

Added a new hook to allow extensions act on the error messages being returned in case of parsing error (e.g. if some mandatory AVP are expected in error messages)
author Sebastien Decugis <sdecugis@freediameter.net>
date Sun, 30 Aug 2015 01:58:21 +0800
parents 035f489b845b
children 84a3c9c4b834
comparison
equal deleted inserted replaced
1300:3f1e79e1273e 1301:50fb308e84f7
380 LOG_E("Parsing error: cannot parse %zdB buffer from '%s': %s", rcv_data->length, peer ? peer->p_hdr.info.pi_diamid : "<unknown>", hook_default_buf); 380 LOG_E("Parsing error: cannot parse %zdB buffer from '%s': %s", rcv_data->length, peer ? peer->p_hdr.info.pi_diamid : "<unknown>", hook_default_buf);
381 } 381 }
382 break; 382 break;
383 } 383 }
384 384
385 case HOOK_MESSAGE_PARSING_ERROR2: {
386 CHECK_MALLOC_DO(fd_msg_dump_treeview(&hook_default_buf, &hook_default_len, NULL, msg, NULL, 0, 1), break);
387
388 LOG_E("Returning following message after parsing error:");
389 LOG_SPLIT(FD_LOG_ERROR, " ", hook_default_buf, NULL);
390 break;
391 }
392
385 case HOOK_MESSAGE_ROUTING_ERROR: { 393 case HOOK_MESSAGE_ROUTING_ERROR: {
386 CHECK_MALLOC_DO(fd_msg_dump_treeview(&hook_default_buf, &hook_default_len, NULL, msg, NULL, 0, 1), break); 394 CHECK_MALLOC_DO(fd_msg_dump_treeview(&hook_default_buf, &hook_default_len, NULL, msg, NULL, 0, 1), break);
387 LOG_E("Routing error: '%s' for the following message:", (char *)other); 395 LOG_E("Routing error: '%s' for the following message:", (char *)other);
388 LOG_SPLIT(FD_LOG_ERROR, " ", hook_default_buf, NULL); 396 LOG_SPLIT(FD_LOG_ERROR, " ", hook_default_buf, NULL);
389 break; 397 break;
"Welcome to our mercurial repository"