Skip to content

Commit

Permalink
ruxc: added parameters for connection, read and write timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
miconda committed Aug 24, 2021
1 parent e979508 commit 121b7ff
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions src/modules/ruxc/ruxc_mod.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
MODULE_VERSION

static int _ruxc_http_timeout = 5000;
static int _ruxc_http_timeout_connect = 5000;
static int _ruxc_http_timeout_read = 5000;
static int _ruxc_http_timeout_write = 5000;
static int _ruxc_http_tlsmode = 0;
static int _ruxc_http_reuse = 0;
static int _ruxc_http_retry = 0;
Expand Down Expand Up @@ -75,12 +78,15 @@ static cmd_export_t cmds[]={
};

static param_export_t params[]={
{"http_timeout", PARAM_INT, &_ruxc_http_timeout},
{"http_tlsmode", PARAM_INT, &_ruxc_http_tlsmode},
{"http_reuse", PARAM_INT, &_ruxc_http_reuse},
{"http_retry", PARAM_INT, &_ruxc_http_retry},
{"http_logtype", PARAM_INT, &_ruxc_http_logtype},
{"http_debug", PARAM_INT, &_ruxc_http_debug},
{"http_timeout", PARAM_INT, &_ruxc_http_timeout},
{"http_timeout_connect", PARAM_INT, &_ruxc_http_timeout_connect},
{"http_timeout_read", PARAM_INT, &_ruxc_http_timeout_read},
{"http_timeout_write", PARAM_INT, &_ruxc_http_timeout_write},
{"http_tlsmode", PARAM_INT, &_ruxc_http_tlsmode},
{"http_reuse", PARAM_INT, &_ruxc_http_reuse},
{"http_retry", PARAM_INT, &_ruxc_http_retry},
{"http_logtype", PARAM_INT, &_ruxc_http_logtype},
{"http_debug", PARAM_INT, &_ruxc_http_debug},

{0, 0, 0}
};
Expand Down Expand Up @@ -136,10 +142,10 @@ static void mod_destroy(void)
*/
static void ruxc_request_params_init(RuxcHTTPRequest *v_http_request)
{
v_http_request->timeout = _ruxc_http_timeout;
v_http_request->timeout_connect = _ruxc_http_timeout;
v_http_request->timeout_read = _ruxc_http_timeout;
v_http_request->timeout_write = _ruxc_http_timeout;
v_http_request->timeout = _ruxc_http_timeout;
v_http_request->timeout_connect = _ruxc_http_timeout_connect;
v_http_request->timeout_read = _ruxc_http_timeout_read;
v_http_request->timeout_write = _ruxc_http_timeout_write;
v_http_request->tlsmode = _ruxc_http_tlsmode;
v_http_request->reuse = _ruxc_http_reuse;
v_http_request->retry = _ruxc_http_retry;
Expand Down

0 comments on commit 121b7ff

Please sign in to comment.