Browse code

core: parse hdr name - removed unused defines

- comments to describe indexing arrays

Daniel-Constantin Mierla authored on 22/07/2020 06:09:02
Showing 1 changed files
... ...
@@ -145,12 +145,26 @@ typedef struct ksr_hdr_map_idx {
145 145
 } ksr_hdr_map_idx_t;
146 146
 
147 147
 #define KSR_HDR_MAP_IDX_SIZE 256
148
+
149
+/**
150
+ * array to keep start and end indexes of header names groupped by first char
151
+ */
148 152
 static ksr_hdr_map_idx_t _ksr_hdr_map_idx[KSR_HDR_MAP_IDX_SIZE];
149 153
 
154
+/**
155
+ * valid chars in header names
156
+ */
150 157
 static char *_ksr_hname_chars_list = "0123456789AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz-._+~";
151 158
 
159
+/**
160
+ * indexed valid chars in 256-array for 1-byte-index access check
161
+ */
152 162
 static char _ksr_hname_chars_idx[KSR_HDR_MAP_IDX_SIZE];
153 163
 
164
+
165
+/**
166
+ * init header name parsing structures and indexes
167
+ */
154 168
 int ksr_hname_init_index(void)
155 169
 {
156 170
 	char c;
... ...
@@ -181,10 +195,6 @@ int ksr_hname_init_index(void)
181 195
 	return 0;
182 196
 }
183 197
 
184
-#define LOWER_BYTE(b) ((b) | 0x20)
185
-#define LOWER_DWORD(d) ((d) | 0x20202020)
186
-
187
-
188 198
 /**
189 199
  * parse the sip header name in the buffer starting at 'begin' till before 'end'
190 200
  * - fills hdr structure (must not be null)