|
@@ -145,12 +145,26 @@ typedef struct ksr_hdr_map_idx {
|
|
} ksr_hdr_map_idx_t;
|
|
} ksr_hdr_map_idx_t;
|
|
|
|
|
|
#define KSR_HDR_MAP_IDX_SIZE 256
|
|
#define KSR_HDR_MAP_IDX_SIZE 256
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * array to keep start and end indexes of header names groupped by first char
|
|
|
|
+ */
|
|
static ksr_hdr_map_idx_t _ksr_hdr_map_idx[KSR_HDR_MAP_IDX_SIZE];
|
|
static ksr_hdr_map_idx_t _ksr_hdr_map_idx[KSR_HDR_MAP_IDX_SIZE];
|
|
|
|
|
|
|
|
+/**
|
|
|
|
+ * valid chars in header names
|
|
|
|
+ */
|
|
static char *_ksr_hname_chars_list = "0123456789AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz-._+~";
|
|
static char *_ksr_hname_chars_list = "0123456789AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz-._+~";
|
|
|
|
|
|
|
|
+/**
|
|
|
|
+ * indexed valid chars in 256-array for 1-byte-index access check
|
|
|
|
+ */
|
|
static char _ksr_hname_chars_idx[KSR_HDR_MAP_IDX_SIZE];
|
|
static char _ksr_hname_chars_idx[KSR_HDR_MAP_IDX_SIZE];
|
|
|
|
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * init header name parsing structures and indexes
|
|
|
|
+ */
|
|
int ksr_hname_init_index(void)
|
|
int ksr_hname_init_index(void)
|
|
{
|
|
{
|
|
char c;
|
|
char c;
|
|
@@ -181,10 +195,6 @@ int ksr_hname_init_index(void)
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
-#define LOWER_BYTE(b) ((b) | 0x20)
|
|
|
|
-#define LOWER_DWORD(d) ((d) | 0x20202020)
|
|
|
|
-
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* parse the sip header name in the buffer starting at 'begin' till before 'end'
|
|
* parse the sip header name in the buffer starting at 'begin' till before 'end'
|
|
* - fills hdr structure (must not be null)
|
|
* - fills hdr structure (must not be null)
|