[SR-Users] $(hdr(name)[N]) question

Juha Heinanen jh at tutpro.com
Mon Apr 28 10:51:40 CEST 2014


Daniel-Constantin Mierla writes:

> >> I guess the $hdr(X[*]) uses comma-space for separation (haven't checked
> >> the sources). In your example, the second header test has two values in
> >> one line and $hdr(...) is simply returning all of them.
> > since there is no need for space, it should not be there.
> It can be removed.

i looked at the source and found in pv_core.c/pv_get_hdr() this:

				memcpy(p, PV_FIELD_DELIM, PV_FIELD_DELIM_LEN);

the constants:

#define PV_FIELD_DELIM ", "
#define PV_FIELD_DELIM_LEN (sizeof(PV_FIELD_DELIM) - 1)

are used all over the place and it would thus not be a good idea to edit
them.  perhaps adding a new ones:

#define PV_HDR_DELIM ", "
#define PV_HDR_DELIM_LEN (sizeof(PV_HDR_DELIM) - 1)

would be ok.

-- juha



More information about the sr-users mailing list