Logo Search packages:      
Sourcecode: sofia-sip version File versions  Download package

SOFIAPUBFUN issize_t sip_header_field_d ( su_home_t home,
sip_header_t h,
char *  s,
isize_t  slen 

Decode the string containing header field

Decode a string containg header field.

The header object is initialized with the contents of the string. The string is modified when parsing. The home is used to allocate extra memory required when parsing, e.g., for parameter list or when there string contains multiple header fields.

Use msg_header_make() or header-specific make functions, e.g., sip_via_make().
Return values:
0 when successful
-1 upon an error.

Definition at line 364 of file sip_util.c.

References IS_LWS, and span_lws().


  if (h && s && s[slen] == '\0') {
    size_t n = span_lws(s);
    s += n; slen -= n;
    for (n = slen; n >= 1 && IS_LWS(s[n - 1]); n--)
    s[n] = '\0';
    return h->sh_class->hc_parse(home, h, s, slen);
    return -1;

Generated by  Doxygen 1.6.0   Back to index