Module: sip-router
Branch: hpw/branch_failure_route
Commit: 054af083489cba1d7072768734abdc5cf8ef916b
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=054af08…
Author: Hugh Waite <hugh.waite(a)crocodile-rcs.com>
Committer: Hugh Waite <hugh.waite(a)crocodile-rcs.com>
Date: Tue Mar 26 11:22:31 2013 +0000
Revert "core: Initial revision of branch_failure_route"
Remove new branch_failure_route in favour of an event_route
This reverts commit a5946574cb9917f0a9a90ea547c9357f3f6477bd.
---
cfg.lex | 3 ---
cfg.y | 24 ------------------------
route.c | 4 ----
route.h | 2 --
script_cb.c | 2 +-
script_cb.h | 5 ++---
6 files changed, 3 insertions(+), 37 deletions(-)
diff --git a/cfg.lex b/cfg.lex
index bafab4b..5a7ce8a 100644
--- a/cfg.lex
+++ b/cfg.lex
@@ -200,7 +200,6 @@ ERROR error
ROUTE route
ROUTE_REQUEST request_route
ROUTE_FAILURE failure_route
-ROUTE_BRANCH_FAILURE branch_failure_route
ROUTE_REPLY reply_route
ROUTE_ONREPLY onreply_route
ROUTE_BRANCH branch_route
@@ -624,8 +623,6 @@ IMPORTFILE "import_file"
<INITIAL>{ROUTE_REPLY} { count(); yylval.strval=yytext; return ROUTE_REPLY; }
<INITIAL>{ROUTE_FAILURE} { count(); yylval.strval=yytext;
return ROUTE_FAILURE; }
-<INITIAL>{ROUTE_BRANCH_FAILURE} { count(); yylval.strval=yytext;
- return ROUTE_BRANCH_FAILURE; }
<INITIAL>{ROUTE_BRANCH} { count(); yylval.strval=yytext; return ROUTE_BRANCH; }
<INITIAL>{ROUTE_SEND} { count(); yylval.strval=yytext; return ROUTE_SEND; }
<INITIAL>{ROUTE_EVENT} { count(); yylval.strval=yytext; return ROUTE_EVENT; }
diff --git a/cfg.y b/cfg.y
index 477991f..0c4fb5d 100644
--- a/cfg.y
+++ b/cfg.y
@@ -314,7 +314,6 @@ extern char *finame;
%token ROUTE
%token ROUTE_REQUEST
%token ROUTE_FAILURE
-%token ROUTE_BRANCH_FAILURE
%token ROUTE_ONREPLY
%token ROUTE_REPLY
%token ROUTE_BRANCH
@@ -706,7 +705,6 @@ statement:
| module_stm
| {rt=REQUEST_ROUTE;} route_stm
| {rt=FAILURE_ROUTE;} failure_route_stm
- | {rt=BRANCH_FAILURE_ROUTE;} branch_failure_route_stm
| onreply_route_stm
| {rt=BRANCH_ROUTE;} branch_route_stm
| {rt=ONSEND_ROUTE;} send_route_stm
@@ -1972,28 +1970,6 @@ failure_route_stm:
| ROUTE_FAILURE error { yyerror("invalid failure_route statement"); }
;
-branch_failure_route_stm:
- ROUTE_BRANCH_FAILURE LBRACK route_name RBRACK LBRACE actions RBRACE {
- #ifdef SHM_MEM
- if (!shm_initialized() && init_shm()<0) {
- yyerror("Can't initialize shared memory");
- YYABORT;
- }
- #endif /* SHM_MEM */
- i_tmp=route_get(&branch_failure_rt, $3);
- if (i_tmp==-1){
- yyerror("internal error");
- YYABORT;
- }
- if (branch_failure_rt.rlist[i_tmp]){
- yyerror("duplicate route");
- YYABORT;
- }
- push($6, &branch_failure_rt.rlist[i_tmp]);
- }
- | ROUTE_BRANCH_FAILURE error { yyerror("invalid branch_failure_route
statement"); }
- ;
-
route_reply_main: ROUTE_ONREPLY { ; }
| ROUTE_REPLY { ; }
diff --git a/route.c b/route.c
index 42fc496..17c1b56 100644
--- a/route.c
+++ b/route.c
@@ -102,7 +102,6 @@
struct route_list main_rt;
struct route_list onreply_rt;
struct route_list failure_rt;
-struct route_list branch_failure_rt;
struct route_list branch_rt;
struct route_list onsend_rt;
struct route_list event_rt;
@@ -143,7 +142,6 @@ void destroy_routes()
destroy_rlist(&main_rt);
destroy_rlist(&onreply_rt);
destroy_rlist(&failure_rt);
- destroy_rlist(&branch_failure_rt);
destroy_rlist(&branch_rt);
destroy_rlist(&event_rt);
}
@@ -212,8 +210,6 @@ int init_routes()
goto error;
if (init_rlist("failure", &failure_rt, FAILURE_RT_NO, RT_HASH_SIZE)<0)
goto error;
- if (init_rlist("branch_failure", &branch_failure_rt, FAILURE_RT_NO,
RT_HASH_SIZE)<0)
- goto error;
if (init_rlist("branch", &branch_rt, BRANCH_RT_NO, RT_HASH_SIZE)<0)
goto error;
if (init_rlist("on_send", &onsend_rt, ONSEND_RT_NO, RT_HASH_SIZE)<0)
diff --git a/route.h b/route.h
index f824c0e..8f25fe3 100644
--- a/route.h
+++ b/route.h
@@ -53,7 +53,6 @@
#define ERROR_ROUTE (1 << 5)
#define LOCAL_ROUTE (1 << 6)
#define CORE_ONREPLY_ROUTE (1 << 7)
-#define BRANCH_FAILURE_ROUTE (1 << 8)
#define ONREPLY_ROUTE (TM_ONREPLY_ROUTE|CORE_ONREPLY_ROUTE)
#define EVENT_ROUTE REQUEST_ROUTE
#define ANY_ROUTE (0xFFFFFFFF)
@@ -86,7 +85,6 @@ extern struct route_list main_rt;
/* main reply route table */
extern struct route_list onreply_rt;
extern struct route_list failure_rt;
-extern struct route_list branch_failure_rt;
extern struct route_list branch_rt;
extern struct route_list onsend_rt;
extern struct route_list event_rt;
diff --git a/script_cb.c b/script_cb.c
index 27156e2..a10df7d 100644
--- a/script_cb.c
+++ b/script_cb.c
@@ -53,7 +53,7 @@
#include "mem/mem.h"
/* Number of cb types = last cb type */
-#define SCRIPT_CB_NUM (CB_TYPE_MAX-1)
+#define SCRIPT_CB_NUM EVENT_CB_TYPE
static struct script_cb *pre_script_cb[SCRIPT_CB_NUM];
static struct script_cb *post_script_cb[SCRIPT_CB_NUM];
diff --git a/script_cb.h b/script_cb.h
index 596a503..af557c7 100644
--- a/script_cb.h
+++ b/script_cb.h
@@ -49,15 +49,14 @@ typedef int (cb_function)(struct sip_msg *msg, unsigned int flags,
void *param);
*/
enum script_cb_flag { REQUEST_CB=1, FAILURE_CB=2, ONREPLY_CB=4,
BRANCH_CB=8, ONSEND_CB=16, ERROR_CB=32,
- LOCAL_CB=64, EVENT_CB=128, BRANCH_FAILURE_CB=256 };
+ LOCAL_CB=64, EVENT_CB=128 };
/* Callback types used for executing the callbacks.
* Keep in sync with script_cb_flag!!!
*/
enum script_cb_type { REQUEST_CB_TYPE=1, FAILURE_CB_TYPE, ONREPLY_CB_TYPE,
BRANCH_CB_TYPE, ONSEND_CB_TYPE, ERROR_CB_TYPE,
- LOCAL_CB_TYPE, EVENT_CB_TYPE, BRANCH_FAILURE_CB_TYPE,
- CB_TYPE_MAX};
+ LOCAL_CB_TYPE, EVENT_CB_TYPE };
struct script_cb{
cb_function *cbf;