MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / get_compact_form

Function get_compact_form

modules/compression/compression_helpers.c:50–91  ·  view source on GitHub ↗

* Function that receives header type and returns the * compact form character if exists or '\0' instead */

Source from the content-addressed store, hash-verified

48 * compact form character if exists or '\0' instead
49 */
50unsigned char get_compact_form(struct hdr_field* hf)
51{
52
53// str content_encoding = str_init(CONTENT_ENCODING);
54
55 /* Less comparations*/
56 if (!(compact_form_mask[hf->type/MC_BYTE_SIZE] &
57 (1 << (hf->type%MC_BYTE_SIZE))))
58 return NO_FORM;
59
60 switch (hf->type) {
61 case HDR_CONTENTTYPE_T :
62 return 0;
63 case HDR_FROM_T :
64 return 1;
65 case HDR_CALLID_T :
66 return 2;
67 case HDR_SUPPORTED_T :
68 return 3;
69 case HDR_CONTENTLENGTH_T :
70 return 4;
71 case HDR_CONTACT_T :
72 return 5;
73 case HDR_SUBJECT_T :
74 return 6;
75 case HDR_TO_T :
76 return 7;
77 case HDR_VIA_T :
78 return 8;
79 case HDR_SESSION_EXPIRES_T :
80 return 9;
81/* case HDR_OTHER_T :
82 if (strncasecmp(hf->name.s, content_encoding.s,
83 content_encoding.len))
84 break;
85 return 'e';*/
86 default :
87 return NO_FORM;
88 }
89
90 return 255;
91}
92
93int append_hdr(mc_whitelist_p wh_list, str* hdr_name)
94{

Callers 1

mc_compact_cbFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected