Skip to content

Commit 28d87ad

Browse files
committed
Various code/doc improvements; Var renames; Fix typos
1 parent 641d4e4 commit 28d87ad

File tree

11 files changed

+24
-24
lines changed

11 files changed

+24
-24
lines changed

lib/digest_auth/digest_auth.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,24 +63,24 @@ int dauth_fixup_algorithms(void** param)
6363
str *s = (str*)*param;
6464
alg_t af;
6565
int algflags = 0;
66-
csv_record *q_csv, *q;
66+
csv_record *alg_csv, *q;
6767

68-
q_csv = parse_csv_record(s);
69-
if (!q_csv) {
68+
alg_csv = parse_csv_record(s);
69+
if (!alg_csv) {
7070
LM_ERR("Failed to parse list of algorithms\n");
7171
return -1;
7272
}
73-
for (q = q_csv; q; q = q->next) {
73+
for (q = alg_csv; q; q = q->next) {
7474
af = parse_digest_algorithm(&q->s);
7575
if (!digest_algorithm_available(af)) {
7676
LM_ERR("Unsupported algorithm type: \"%.*s\"\n",
7777
q->s.len, q->s.s);
78-
free_csv_record(q_csv);
78+
free_csv_record(alg_csv);
7979
return (-1);
8080
}
8181
algflags |= ALG2ALGFLG(af);
8282
}
83-
free_csv_record(q_csv);
83+
free_csv_record(alg_csv);
8484

8585
*(intptr_t *)param = algflags;
8686
return (0);

modules/auth/api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ static int auth_calc_HA1(const struct calc_HA1_arg *params, HASHHEX *sess_key)
349349
return -1;
350350
} else {
351351
if (params->creds.ha1->len != digest_calc->HASHHEXLEN) {
352-
LM_ERR("Incorrect length if pre-hashed credentials "
352+
LM_ERR("Incorrect length of pre-hashed credentials "
353353
"for the algorithm \"%s\": %d expected, %d provided\n",
354354
digest_calc->algorithm_val.s, digest_calc->HASHHEXLEN,
355355
params->creds.ha1->len);

modules/httpd/doc/httpd_admin.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
</para>
4141
</section>
4242

43-
<section>
43+
<section id="dependencies_libs" xreflabel="Library Dependencies">
4444
<title>External Libraries or Applications</title>
4545
<para>
4646
The following libraries or applications must be installed before

modules/httpd/httpd_proc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,7 @@ void httpd_proc(int rank)
782782
#if ( MHD_VERSION >= 0x000092800 )
783783
struct sockaddr_in6 saddr6;
784784
if (ip.s && strcmp(ip.s, "*")) {
785-
if (q_memchr(ip.s, ':', strlen(ip.s))) {
785+
if (q_memchr(ip.s, ':', ip.len)) {
786786
LM_DBG("preparing to listen on IPv6 interface '%s'\n", ip.s);
787787
memset(&saddr6, 0, sizeof saddr6);
788788

modules/mid_registrar/save.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1387,10 +1387,10 @@ static inline int save_restore_rpl_contacts(struct sip_msg *req,
13871387
if (reg_mode == MID_REG_THROTTLE_CT) {
13881388
/* populate extra ct stuff between "insert" and "replicate" */
13891389
ci->pre_replicate_cb = mid_reg_store_ct_data;
1390-
memcpy(&ct_data, &(struct mr_ct_data){
1390+
ct_data = (struct mr_ct_data){
13911391
mri, &_c->uri, ctmap->expires, e_out,
13921392
get_act_time(), ci->cseq
1393-
}, sizeof ct_data);
1393+
};
13941394
ci->pre_replicate_info = &ct_data;
13951395
}
13961396

@@ -1653,10 +1653,10 @@ static inline int save_restore_req_contacts(struct sip_msg *req,
16531653
if (reg_mode == MID_REG_THROTTLE_AOR) {
16541654
/* populate extra ct stuff between "insert" and "replicate" */
16551655
ci->pre_replicate_cb = mid_reg_store_ct_data;
1656-
memcpy(&ct_data, &(struct mr_ct_data){
1656+
ct_data = (struct mr_ct_data){
16571657
mri, &_c->uri, ctmap->expires, e_out,
16581658
mri->last_reg_ts, ci->cseq
1659-
}, sizeof ct_data);
1659+
};
16601660
ci->pre_replicate_info = &ct_data;
16611661
}
16621662

modules/stir_shaken/doc/stir_shaken_admin.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,8 @@ modparam("stir_shaken", "e164_strict_mode", 1)
192192
not required.
193193
</para>
194194
<para>
195-
If the parameter is set to not required but the header is present in the
196-
message, the Date value will be used as normally to check the freshness (as
195+
If the parameter is set to "not required" but the Date header is present in the
196+
message, the header value will be used as normally to check the freshness (as
197197
configured in the <xref linkend="param_verify_date_freshness"/>
198198
parameter). If the Date header is indeed missing, the value of the
199199
<emphasis>iat</emphasis> claim in the PASSporT will be used instead.

modules/stir_shaken/stir_shaken.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -965,7 +965,7 @@ static int fixup_auth_out(void** param)
965965

966966
if (pv_parse_spec(s, &out_p->var) == NULL) {
967967
pkg_free(out_p);
968-
LM_ERR("Failed to parese output variable spec\n");
968+
LM_ERR("Failed to parse output variable spec\n");
969969
return -1;
970970
}
971971
} else {

modules/usrloc/dlist.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -888,7 +888,7 @@ int get_domain_ucontacts(udomain_t *d, void *buf, int len, unsigned int flags,
888888
* \return 0 if everything went OK, otherwise value < 0 is returned
889889
*
890890
* \note The structure is NOT created in shared memory so the
891-
* function must be called before ser forks if it should
891+
* function must be called before the fork phase if it should
892892
* be available to all processes
893893
*/
894894
static inline int new_dlist(str* _n, dlist_t** _d)
@@ -900,7 +900,7 @@ static inline int new_dlist(str* _n, dlist_t** _d)
900900
return -1;
901901
}
902902

903-
/* Domains are created before ser forks,
903+
/* Domains are created before the fork phase,
904904
* so we can create them using pkg_malloc
905905
*/
906906
ptr = (dlist_t*)shm_malloc(sizeof(dlist_t));

time_rec.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ typedef void tmrec_expr;
3434
#define PKG_ALLOC 2
3535
#define TR_BYXXX 4
3636

37-
#define TR_NOVAL ((time_t)-1)
38-
3937
tmrec *tmrec_parse(const char *tr, char alloc_type);
4038

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

142+
#define TR_NOVAL ((time_t)-1)
143+
144144
typedef struct _tr_byxxx
145145
{
146146
int nr;

transformations.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3382,8 +3382,8 @@ int tr_parse_paramlist(str* in, trans_t *t)
33823382

33833383
return 0;
33843384

3385-
} else if(str_match(&name, _str("exist"))
3386-
|| str_match(&name, _str("exists"))) {
3385+
} else if(str_match(&name, &str_const_init("exist"))
3386+
|| str_match(&name, &str_const_init("exists"))) {
33873387
t->subtype = TR_PL_EXIST;
33883388
if(*p!=TR_PARAM_MARKER)
33893389
{

ut.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,7 @@ static inline int shm_nt_str_dup(str* dst, const str* src)
801801
return 0;
802802
}
803803

804-
dst->s = shm_malloc(src->len + 1);
804+
dst->s = shm_malloc(_src.len + 1);
805805
if (!dst->s) {
806806
LM_ERR("no shared memory left\n");
807807
dst->len = 0;
@@ -1475,7 +1475,7 @@ static inline void * l_memmem(const void *b1, const void *b2,
14751475
* Note: makes use of a single, static buffer -- use accordingly!
14761476
*/
14771477
char *db_url_escape(const str *url);
1478-
static inline char *_db_url_escape(char *url)
1478+
static inline char *_db_url_escape(const char *url)
14791479
{
14801480
return db_url_escape(_str(url));
14811481
}

0 commit comments

Comments
 (0)