Skip to content

Commit

Permalink
Various code/doc improvements; Var renames; Fix typos
Browse files Browse the repository at this point in the history
(cherry picked from commit 28d87ad)
(cherry picked from commit 2aa0caf)
  • Loading branch information
liviuchircu committed Aug 16, 2022
1 parent e032562 commit aaaae0d
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 20 deletions.
12 changes: 6 additions & 6 deletions lib/digest_auth/digest_auth.c
Expand Up @@ -63,24 +63,24 @@ int dauth_fixup_algorithms(void** param)
str *s = (str*)*param;
alg_t af;
int algflags = 0;
csv_record *q_csv, *q;
csv_record *alg_csv, *q;

q_csv = parse_csv_record(s);
if (!q_csv) {
alg_csv = parse_csv_record(s);
if (!alg_csv) {
LM_ERR("Failed to parse list of algorithms\n");
return -1;
}
for (q = q_csv; q; q = q->next) {
for (q = alg_csv; q; q = q->next) {
af = parse_digest_algorithm(&q->s);
if (!digest_algorithm_available(af)) {
LM_ERR("Unsupported algorithm type: \"%.*s\"\n",
q->s.len, q->s.s);
free_csv_record(q_csv);
free_csv_record(alg_csv);
return (-1);
}
algflags |= ALG2ALGFLG(af);
}
free_csv_record(q_csv);
free_csv_record(alg_csv);

*(intptr_t *)param = algflags;
return (0);
Expand Down
2 changes: 1 addition & 1 deletion modules/auth/api.c
Expand Up @@ -342,7 +342,7 @@ static int auth_calc_HA1(const struct calc_HA1_arg *params, HASHHEX *sess_key)
return -1;
} else {
if (params->creds.ha1->len != digest_calc->HASHHEXLEN) {
LM_ERR("Incorrect length if pre-hashed credentials "
LM_ERR("Incorrect length of pre-hashed credentials "
"for the algorithm \"%s\": %d expected, %d provided\n",
digest_calc->algorithm_val.s, digest_calc->HASHHEXLEN,
params->creds.ha1->len);
Expand Down
2 changes: 1 addition & 1 deletion modules/httpd/doc/httpd_admin.xml
Expand Up @@ -40,7 +40,7 @@
</para>
</section>

<section>
<section id="dependencies_libs" xreflabel="Library Dependencies">
<title>External Libraries or Applications</title>
<para>
The following libraries or applications must be installed before
Expand Down
8 changes: 4 additions & 4 deletions modules/mid_registrar/save.c
Expand Up @@ -1387,10 +1387,10 @@ static inline int save_restore_rpl_contacts(struct sip_msg *req,
if (reg_mode == MID_REG_THROTTLE_CT) {
/* populate extra ct stuff between "insert" and "replicate" */
ci->pre_replicate_cb = mid_reg_store_ct_data;
memcpy(&ct_data, &(struct mr_ct_data){
ct_data = (struct mr_ct_data){
mri, &_c->uri, ctmap->expires, e_out,
get_act_time(), ci->cseq
}, sizeof ct_data);
};
ci->pre_replicate_info = &ct_data;
}

Expand Down Expand Up @@ -1653,10 +1653,10 @@ static inline int save_restore_req_contacts(struct sip_msg *req,
if (reg_mode == MID_REG_THROTTLE_AOR) {
/* populate extra ct stuff between "insert" and "replicate" */
ci->pre_replicate_cb = mid_reg_store_ct_data;
memcpy(&ct_data, &(struct mr_ct_data){
ct_data = (struct mr_ct_data){
mri, &_c->uri, ctmap->expires, e_out,
mri->last_reg_ts, ci->cseq
}, sizeof ct_data);
};
ci->pre_replicate_info = &ct_data;
}

Expand Down
4 changes: 2 additions & 2 deletions modules/stir_shaken/doc/stir_shaken_admin.xml
Expand Up @@ -192,8 +192,8 @@ modparam("stir_shaken", "e164_strict_mode", 1)
not required.
</para>
<para>
If the parameter is set to not required but the header is present in the
message, the Date value will be used as normally to check the freshness (as
If the parameter is set to "not required" but the Date header is present in the
message, the header value will be used as normally to check the freshness (as
configured in the <xref linkend="param_verify_date_freshness"/>
parameter). If the Date header is indeed missing, the value of the
<emphasis>iat</emphasis> claim in the PASSporT will be used instead.
Expand Down
4 changes: 2 additions & 2 deletions modules/usrloc/dlist.c
Expand Up @@ -888,7 +888,7 @@ int get_domain_ucontacts(udomain_t *d, void *buf, int len, unsigned int flags,
* \return 0 if everything went OK, otherwise value < 0 is returned
*
* \note The structure is NOT created in shared memory so the
* function must be called before ser forks if it should
* function must be called before the fork phase if it should
* be available to all processes
*/
static inline int new_dlist(str* _n, dlist_t** _d)
Expand All @@ -900,7 +900,7 @@ static inline int new_dlist(str* _n, dlist_t** _d)
return -1;
}

/* Domains are created before ser forks,
/* Domains are created before the fork phase,
* so we can create them using pkg_malloc
*/
ptr = (dlist_t*)shm_malloc(sizeof(dlist_t));
Expand Down
4 changes: 2 additions & 2 deletions time_rec.h
Expand Up @@ -34,8 +34,6 @@ typedef void tmrec_expr;
#define PKG_ALLOC 2
#define TR_BYXXX 4

#define TR_NOVAL ((time_t)-1)

tmrec *tmrec_parse(const char *tr, char alloc_type);

int _tmrec_check(const tmrec *tr, time_t check_time);
Expand Down Expand Up @@ -141,6 +139,8 @@ static inline int tz_offset(const char *tz)
#define FREQ_WEEKLY 3
#define FREQ_DAILY 4

#define TR_NOVAL ((time_t)-1)

typedef struct _tr_byxxx
{
int nr;
Expand Down
4 changes: 2 additions & 2 deletions ut.h
Expand Up @@ -789,7 +789,7 @@ static inline int shm_nt_str_dup(str* dst, const str* src)
return 0;
}

dst->s = shm_malloc(src->len + 1);
dst->s = shm_malloc(_src.len + 1);
if (!dst->s) {
LM_ERR("no shared memory left\n");
dst->len = 0;
Expand Down Expand Up @@ -1438,7 +1438,7 @@ static inline void * l_memmem(const void *b1, const void *b2,
* Note: makes use of a single, static buffer -- use accordingly!
*/
char *db_url_escape(const str *url);
static inline char *_db_url_escape(char *url)
static inline char *_db_url_escape(const char *url)
{
return db_url_escape(_str(url));
}
Expand Down

0 comments on commit aaaae0d

Please sign in to comment.