|
@@ -64,6 +64,7 @@
|
|
#include "tcp_server.h" /* for tcpconn_add_alias */
|
|
#include "tcp_server.h" /* for tcpconn_add_alias */
|
|
#include "tcp_options.h" /* for access to tcp_accept_aliases*/
|
|
#include "tcp_options.h" /* for access to tcp_accept_aliases*/
|
|
#include "cfg/cfg.h"
|
|
#include "cfg/cfg.h"
|
|
|
|
+#include "core_stats.h"
|
|
|
|
|
|
#ifdef DEBUG_DMALLOC
|
|
#ifdef DEBUG_DMALLOC
|
|
#include <mem/dmalloc.h>
|
|
#include <mem/dmalloc.h>
|
|
@@ -149,6 +150,7 @@ int receive_msg(char* buf, unsigned int len, struct receive_info* rcv_info)
|
|
if ((msg->via1==0) || (msg->via1->error!=PARSE_OK)){
|
|
if ((msg->via1==0) || (msg->via1->error!=PARSE_OK)){
|
|
/* no via, send back error ? */
|
|
/* no via, send back error ? */
|
|
LOG(L_ERR, "ERROR: receive_msg: no via found in request\n");
|
|
LOG(L_ERR, "ERROR: receive_msg: no via found in request\n");
|
|
|
|
+ STATS_BAD_MSG();
|
|
goto error02;
|
|
goto error02;
|
|
}
|
|
}
|
|
/* check if necessary to add receive?->moved to forward_req */
|
|
/* check if necessary to add receive?->moved to forward_req */
|
|
@@ -182,7 +184,10 @@ int receive_msg(char* buf, unsigned int len, struct receive_info* rcv_info)
|
|
on via1 being parsed in a pre-script callback --andrei
|
|
on via1 being parsed in a pre-script callback --andrei
|
|
*/
|
|
*/
|
|
if (exec_pre_script_cb(msg, REQUEST_CB_TYPE)==0 )
|
|
if (exec_pre_script_cb(msg, REQUEST_CB_TYPE)==0 )
|
|
|
|
+ {
|
|
|
|
+ STATS_REQ_FWD_DROP();
|
|
goto end; /* drop the request */
|
|
goto end; /* drop the request */
|
|
|
|
+ }
|
|
|
|
|
|
set_route_type(REQUEST_ROUTE);
|
|
set_route_type(REQUEST_ROUTE);
|
|
/* exec the routing script */
|
|
/* exec the routing script */
|
|
@@ -208,6 +213,7 @@ int receive_msg(char* buf, unsigned int len, struct receive_info* rcv_info)
|
|
if ((msg->via1==0) || (msg->via1->error!=PARSE_OK)){
|
|
if ((msg->via1==0) || (msg->via1->error!=PARSE_OK)){
|
|
/* no via, send back error ? */
|
|
/* no via, send back error ? */
|
|
LOG(L_ERR, "ERROR: receive_msg: no via found in reply\n");
|
|
LOG(L_ERR, "ERROR: receive_msg: no via found in reply\n");
|
|
|
|
+ STATS_BAD_RPL();
|
|
goto error02;
|
|
goto error02;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -224,7 +230,10 @@ int receive_msg(char* buf, unsigned int len, struct receive_info* rcv_info)
|
|
on via1 being parsed in a pre-script callback --andrei
|
|
on via1 being parsed in a pre-script callback --andrei
|
|
*/
|
|
*/
|
|
if (exec_pre_script_cb(msg, ONREPLY_CB_TYPE)==0 )
|
|
if (exec_pre_script_cb(msg, ONREPLY_CB_TYPE)==0 )
|
|
- goto end; /* drop the request */
|
|
|
|
|
|
+ {
|
|
|
|
+ STATS_RPL_FWD_DROP();
|
|
|
|
+ goto end; /* drop the reply */
|
|
|
|
+ }
|
|
|
|
|
|
/* exec the onreply routing script */
|
|
/* exec the onreply routing script */
|
|
if (onreply_rt.rlist[DEFAULT_RT]){
|
|
if (onreply_rt.rlist[DEFAULT_RT]){
|
|
@@ -238,6 +247,7 @@ int receive_msg(char* buf, unsigned int len, struct receive_info* rcv_info)
|
|
}else
|
|
}else
|
|
#endif /* NO_ONREPLY_ROUTE_ERROR */
|
|
#endif /* NO_ONREPLY_ROUTE_ERROR */
|
|
if (unlikely(ret==0 || (ctx.run_flags&DROP_R_F))){
|
|
if (unlikely(ret==0 || (ctx.run_flags&DROP_R_F))){
|
|
|
|
+ STATS_RPL_FWD_DROP();
|
|
goto skip_send_reply; /* drop the message, no error */
|
|
goto skip_send_reply; /* drop the message, no error */
|
|
}
|
|
}
|
|
}
|
|
}
|