瀏覽代碼

sctp: new config option: sctp_send_retries

- new ser.cfg option sctp_send_retries + doc
Andrei Pelinescu-Onciul 17 年之前
父節點
當前提交
e7f7a93140
共有 3 個文件被更改,包括 20 次插入0 次删除
  1. 8 0
      NEWS
  2. 3 0
      cfg.lex
  3. 9 0
      cfg.y

+ 8 - 0
NEWS

@@ -230,6 +230,14 @@ new config variables:
      assocation (default: 180 s).
      assocation (default: 180 s).
   sctp_send_ttl = milliseconds - number of milliseconds before an unsent
   sctp_send_ttl = milliseconds - number of milliseconds before an unsent
      message/chunk is dropped (default: 32000 ms or 32 s).
      message/chunk is dropped (default: 32000 ms or 32 s).
+  sctp_send_retries - how many times to attempt re-sending a message on a
+                      re-opened association, if the sctp stack did give up
+                      sending it (it's not related to sctp protocol level
+                      retransmission). Useful to improve reliability with
+                      peers that reboot/restart or fail over to another 
+                      machine. WARNING: use with care and low values (e.g.
+                      1-3) to avoid "multiplying" traffic to unresponding 
+                      hosts (default: 0).
   server_id = number - A configurable unique server id that can be used to
   server_id = number - A configurable unique server id that can be used to
                        discriminate server instances within a cluster of
                        discriminate server instances within a cluster of
                        servers when all other information, such as IP adddresses
                        servers when all other information, such as IP adddresses

+ 3 - 0
cfg.lex

@@ -330,6 +330,7 @@ SCTP_SOCKET_RCVBUF	"sctp_socket_rcvbuf"|"sctp_socket_receive_buffer"
 SCTP_SOCKET_SNDBUF	"sctp_socket_sndbuf"|"sctp_socket_send_buffer"
 SCTP_SOCKET_SNDBUF	"sctp_socket_sndbuf"|"sctp_socket_send_buffer"
 SCTP_AUTOCLOSE	"sctp_autoclose"
 SCTP_AUTOCLOSE	"sctp_autoclose"
 SCTP_SEND_TTL	"sctp_send_ttl"
 SCTP_SEND_TTL	"sctp_send_ttl"
+SCTP_SEND_RETRIES	"sctp_send_retries"
 ADVERTISED_ADDRESS	"advertised_address"
 ADVERTISED_ADDRESS	"advertised_address"
 ADVERTISED_PORT		"advertised_port"
 ADVERTISED_PORT		"advertised_port"
 DISABLE_CORE		"disable_core_dump"
 DISABLE_CORE		"disable_core_dump"
@@ -646,6 +647,8 @@ EAT_ABLE	[\ \t\b\r]
 										return SCTP_AUTOCLOSE; }
 										return SCTP_AUTOCLOSE; }
 <INITIAL>{SCTP_SEND_TTL}	{ count(); yylval.strval=yytext;
 <INITIAL>{SCTP_SEND_TTL}	{ count(); yylval.strval=yytext;
 										return SCTP_SEND_TTL; }
 										return SCTP_SEND_TTL; }
+<INITIAL>{SCTP_SEND_RETRIES}	{ count(); yylval.strval=yytext;
+										return SCTP_SEND_RETRIES; }
 <INITIAL>{SERVER_SIGNATURE}	{ count(); yylval.strval=yytext; return SERVER_SIGNATURE; }
 <INITIAL>{SERVER_SIGNATURE}	{ count(); yylval.strval=yytext; return SERVER_SIGNATURE; }
 <INITIAL>{REPLY_TO_VIA}	{ count(); yylval.strval=yytext; return REPLY_TO_VIA; }
 <INITIAL>{REPLY_TO_VIA}	{ count(); yylval.strval=yytext; return REPLY_TO_VIA; }
 <INITIAL>{ADVERTISED_ADDRESS}	{	count(); yylval.strval=yytext;
 <INITIAL>{ADVERTISED_ADDRESS}	{	count(); yylval.strval=yytext;

+ 9 - 0
cfg.y

@@ -386,6 +386,7 @@ static void free_socket_id_lst(struct socket_id* i);
 %token SCTP_SOCKET_SNDBUF
 %token SCTP_SOCKET_SNDBUF
 %token SCTP_AUTOCLOSE
 %token SCTP_AUTOCLOSE
 %token SCTP_SEND_TTL
 %token SCTP_SEND_TTL
+%token SCTP_SEND_RETRIES
 %token ADVERTISED_ADDRESS
 %token ADVERTISED_ADDRESS
 %token ADVERTISED_PORT
 %token ADVERTISED_PORT
 %token DISABLE_CORE
 %token DISABLE_CORE
@@ -1142,6 +1143,14 @@ assign_stm:
 		#endif
 		#endif
 	}
 	}
 	| SCTP_SEND_TTL EQUAL error { yyerror("number expected"); }
 	| SCTP_SEND_TTL EQUAL error { yyerror("number expected"); }
+	| SCTP_SEND_RETRIES EQUAL NUMBER {
+		#ifdef USE_SCTP
+			sctp_options.sctp_send_retries=$3;
+		#else
+			warn("sctp support not compiled in");
+		#endif
+	}
+	| SCTP_SEND_RETRIES EQUAL error { yyerror("number expected"); }
 	| SERVER_SIGNATURE EQUAL NUMBER { server_signature=$3; }
 	| SERVER_SIGNATURE EQUAL NUMBER { server_signature=$3; }
 	| SERVER_SIGNATURE EQUAL error { yyerror("boolean value expected"); }
 	| SERVER_SIGNATURE EQUAL error { yyerror("boolean value expected"); }
 	| REPLY_TO_VIA EQUAL NUMBER { reply_to_via=$3; }
 	| REPLY_TO_VIA EQUAL NUMBER { reply_to_via=$3; }