[sr-dev] git:master:ddcabc1b: core: parse hdr name - removed unused defines

Daniel-Constantin Mierla miconda at gmail.com
Wed Jul 22 08:22:40 CEST 2020


Module: kamailio
Branch: master
Commit: ddcabc1bfd528102c1474b7055fd6ea0c865adcf
URL: https://github.com/kamailio/kamailio/commit/ddcabc1bfd528102c1474b7055fd6ea0c865adcf

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2020-07-22T08:09:02+02:00

core: parse hdr name - removed unused defines

- comments to describe indexing arrays

---

Modified: src/core/parser/parse_hname2.c

---

Diff:  https://github.com/kamailio/kamailio/commit/ddcabc1bfd528102c1474b7055fd6ea0c865adcf.diff
Patch: https://github.com/kamailio/kamailio/commit/ddcabc1bfd528102c1474b7055fd6ea0c865adcf.patch

---

diff --git a/src/core/parser/parse_hname2.c b/src/core/parser/parse_hname2.c
index 70ed6adc57..5afae15769 100644
--- a/src/core/parser/parse_hname2.c
+++ b/src/core/parser/parse_hname2.c
@@ -145,12 +145,26 @@ typedef struct ksr_hdr_map_idx {
 } ksr_hdr_map_idx_t;
 
 #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];
 
+/**
+ * valid chars in header names
+ */
 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];
 
+
+/**
+ * init header name parsing structures and indexes
+ */
 int ksr_hname_init_index(void)
 {
 	char c;
@@ -181,10 +195,6 @@ int ksr_hname_init_index(void)
 	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'
  * - fills hdr structure (must not be null)




More information about the sr-dev mailing list