diff options
author | cbdev <cb@cbcdn.com> | 2019-06-20 12:44:23 +0200 |
---|---|---|
committer | cbdev <cb@cbcdn.com> | 2019-06-20 12:44:23 +0200 |
commit | 3c75202f5f4e9c1c61fead33f0f08e742d143223 (patch) | |
tree | 7f0ad4114530d8f7bf249b6a711916bc40220caa /config.c | |
parent | 76a4da3f245636b10f37b46bf3eb86ff3960461d (diff) | |
download | websocksy-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.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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; |