aboutsummaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorcbdev <cb@cbcdn.com>2019-06-20 12:44:23 +0200
committercbdev <cb@cbcdn.com>2019-06-20 12:44:23 +0200
commit3c75202f5f4e9c1c61fead33f0f08e742d143223 (patch)
tree7f0ad4114530d8f7bf249b6a711916bc40220caa /config.c
parent76a4da3f245636b10f37b46bf3eb86ff3960461d (diff)
downloadwebsocksy-3c75202f5f4e9c1c61fead33f0f08e742d143223.tar.gz
websocksy-3c75202f5f4e9c1c61fead33f0f08e742d143223.tar.bz2
websocksy-3c75202f5f4e9c1c61fead33f0f08e742d143223.zip
Implement keep-alive pings (Fixes #4)
Diffstat (limited to 'config.c')
-rw-r--r--config.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/config.c b/config.c
index 2d50f3e..6998cc7 100644
--- a/config.c
+++ b/config.c
@@ -22,6 +22,9 @@ static int config_file_line(ws_config* config, char* key, char* value, size_t li
free(config->host);
config->host = strdup(value);
}
+ else if(!strcmp(key, "ping")){
+ config->ping_interval = strtoul(value, NULL, 10);
+ }
else if(!strcmp(key, "backend")){
//clean up the previously registered backend
if(config->backend.cleanup){
@@ -136,6 +139,9 @@ int config_parse_arguments(ws_config* config, int argc, char** argv){
case 'b':
config_file_line(config, "backend", argv[u + 1], 0);
break;
+ case 'k':
+ config_file_line(config, "ping", argv[u + 1], 0);
+ break;
case 'c':
if(!strchr(argv[u + 1], '=')){
return 1;