[sr-dev] git:master: core: aliased http_reply_hack to http_reply_parse

Daniel-Constantin Mierla miconda at gmail.com
Mon Sep 23 19:01:51 CEST 2013


Module: sip-router
Branch: master
Commit: adf32ec8b3e6329d1c75f158a11395a077fc54ea
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=adf32ec8b3e6329d1c75f158a11395a077fc54ea

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Mon Sep 23 18:42:54 2013 +0200

core: aliased http_reply_hack to http_reply_parse

- a more relevant name for the core parameter that enables parsing http
  replies

---

 cfg.lex              |    6 +++---
 cfg.y                |    6 +++---
 globals.h            |    2 +-
 parser/parse_fline.c |    4 ++--
 4 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/cfg.lex b/cfg.lex
index 053fa2e..127fce5 100644
--- a/cfg.lex
+++ b/cfg.lex
@@ -476,7 +476,7 @@ KILL_TIMEOUT	"exit_timeout"|"ser_kill_timeout"
 MAX_WLOOPS		"max_while_loops"
 PVBUFSIZE		"pv_buffer_size"
 PVBUFSLOTS		"pv_buffer_slots"
-HTTP_REPLY_HACK		"http_reply_hack"
+HTTP_REPLY_PARSE		"http_reply_hack"|"http_reply_parse"
 VERSION_TABLE_CFG		"version_table"
 
 SERVER_ID     "server_id"
@@ -910,8 +910,8 @@ IMPORTFILE      "import_file"
 									return PVBUFSIZE; }
 <INITIAL>{PVBUFSLOTS}			{	count(); yylval.strval=yytext;
 									return PVBUFSLOTS; }
-<INITIAL>{HTTP_REPLY_HACK}		{	count(); yylval.strval=yytext;
-									return HTTP_REPLY_HACK; }
+<INITIAL>{HTTP_REPLY_PARSE}		{	count(); yylval.strval=yytext;
+									return HTTP_REPLY_PARSE; }
 <INITIAL>{VERSION_TABLE_CFG}  { count(); yylval.strval=yytext; return VERSION_TABLE_CFG;}
 <INITIAL>{SERVER_ID}  { count(); yylval.strval=yytext; return SERVER_ID;}
 <INITIAL>{LATENCY_LOG}  { count(); yylval.strval=yytext; return LATENCY_LOG;}
diff --git a/cfg.y b/cfg.y
index 5f88d13..3b7fbdd 100644
--- a/cfg.y
+++ b/cfg.y
@@ -531,7 +531,7 @@ extern char *finame;
 %token MAX_WLOOPS
 %token PVBUFSIZE
 %token PVBUFSLOTS
-%token HTTP_REPLY_HACK
+%token HTTP_REPLY_PARSE
 %token VERSION_TABLE_CFG
 %token CFG_DESCRIPTION
 %token SERVER_ID
@@ -1553,8 +1553,8 @@ assign_stm:
 	| PVBUFSIZE EQUAL error { yyerror("number expected"); }
 	| PVBUFSLOTS EQUAL NUMBER { pv_set_buffer_slots($3); }
 	| PVBUFSLOTS EQUAL error { yyerror("number expected"); }
-	| HTTP_REPLY_HACK EQUAL NUMBER { http_reply_hack=$3; }
-	| HTTP_REPLY_HACK EQUAL error { yyerror("boolean value expected"); }
+	| HTTP_REPLY_PARSE EQUAL NUMBER { http_reply_parse=$3; }
+	| HTTP_REPLY_PARSE EQUAL error { yyerror("boolean value expected"); }
     | SERVER_ID EQUAL NUMBER { server_id=$3; }
     | LATENCY_LOG EQUAL NUMBER { default_core_cfg.latency_log=$3; }
 	| LATENCY_LOG EQUAL error  { yyerror("number  expected"); }
diff --git a/globals.h b/globals.h
index a16f581..b535ca8 100644
--- a/globals.h
+++ b/globals.h
@@ -206,7 +206,7 @@ extern int rt_timer2_prio;  /* "slow" timer */
 extern int rt_timer1_policy; /* "fast" timer, SCHED_OTHER */
 extern int rt_timer2_policy; /* "slow" timer, SCHED_OTHER */
 
-extern int http_reply_hack;
+extern int http_reply_parse;
 
 #ifdef USE_DNS_CACHE
 extern int dns_cache_init; /* if 0, the DNS cache is not initialized at startup */
diff --git a/parser/parse_fline.c b/parser/parse_fline.c
index 54da8c5..8dacfe5 100644
--- a/parser/parse_fline.c
+++ b/parser/parse_fline.c
@@ -45,7 +45,7 @@
 #include "../mem/mem.h"
 #include "../ut.h"
 
-int http_reply_hack = 0;
+int http_reply_parse = 0;
 
 /* grammar:
 	request  =  method SP uri SP version CRLF
@@ -98,7 +98,7 @@ char* parse_first_line(char* buffer, unsigned int len, struct msg_start * fl)
 			fl->type=SIP_REPLY;
 			fl->u.reply.version.len=SIP_VERSION_LEN;
 			tmp=buffer+SIP_VERSION_LEN;
-	} else if (http_reply_hack != 0 && 
+	} else if (http_reply_parse != 0 &&
 		 	(*tmp=='H' || *tmp=='h') &&
 			/* 'HTTP/1.' */
 			strncasecmp( tmp+1, HTTP_VERSION+1, HTTP_VERSION_LEN-1)==0 &&




More information about the sr-dev mailing list