Skip to content

Commit

Permalink
ruxc: added http_retry modparam
Browse files Browse the repository at this point in the history
  • Loading branch information
miconda committed Aug 17, 2021
1 parent fb2eee3 commit 6da06e2
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/modules/ruxc/doc/ruxc_admin.xml
Expand Up @@ -121,6 +121,25 @@ modparam("ruxc", "http_tlsmode", 1)
...
modparam("ruxc", "http_reuse", 1)
...
</programlisting>
</example>
</section>
<section id="ruxc.p.http_retry">
<title><varname>http_retry</varname> (int)</title>
<para>
How many times to retry if the HTTP request does not get a 200ok response.
</para>
<para>
<emphasis>
Default value is 0 (no retry).
</emphasis>
</para>
<example>
<title>Set <varname>http_retry</varname> parameter</title>
<programlisting format="linespecific">
...
modparam("ruxc", "http_retry", 2)
...
</programlisting>
</example>
</section>
Expand Down
4 changes: 4 additions & 0 deletions src/modules/ruxc/ruxc_mod.c
Expand Up @@ -41,6 +41,7 @@ MODULE_VERSION
static int _ruxc_http_timeout = 5000;
static int _ruxc_http_tlsmode = 0;
static int _ruxc_http_reuse = 0;
static int _ruxc_http_retry = 0;

static int mod_init(void);
static int child_init(int);
Expand Down Expand Up @@ -75,6 +76,7 @@ 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},

{0, 0, 0}
};
Expand Down Expand Up @@ -135,6 +137,7 @@ static int ki_ruxc_http_get_helper(sip_msg_t *_msg, str *url, str *hdrs,
v_http_request.timeout_write = _ruxc_http_timeout;
v_http_request.tlsmode = _ruxc_http_tlsmode;
v_http_request.reuse = _ruxc_http_reuse;
v_http_request.retry = _ruxc_http_retry;

v_http_request.url = url->s;
v_http_request.url_len = url->len;
Expand Down Expand Up @@ -233,6 +236,7 @@ static int ki_ruxc_http_post_helper(sip_msg_t *_msg, str *url, str *body, str *h
v_http_request.timeout_write = _ruxc_http_timeout;
v_http_request.tlsmode = _ruxc_http_tlsmode;
v_http_request.reuse = _ruxc_http_reuse;
v_http_request.retry = _ruxc_http_retry;

v_http_request.url = url->s;
v_http_request.url_len = url->len;
Expand Down

0 comments on commit 6da06e2

Please sign in to comment.