MCPcopy Create free account
hub / github.com/acl-dev/acl / header_opts_find

Function header_opts_find

lib_acl_cpp/src/mime/internal/header_opts.cpp:153–195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

151/* header_opts_find - look up header options */
152
153const HEADER_OPTS *header_opts_find(const char *string, ACL_VSTRING *key_buffer)
154{
155 const char *myname = "header_opts_find";
156 const char *cp;
157 HEADER_OPTS *header_info;
158 ACL_VSTRING *header_key;
159
160 acl_pthread_once(&__header_once, header_opts_once);
161
162 if (header_ctx == NULL)
163 acl_msg_fatal("%s(%d): header_ctx!", myname, __LINE__);
164
165 if (key_buffer == NULL)
166 header_key = acl_vstring_alloc(128);
167 else
168 header_key = key_buffer;
169
170 /*
171 * Look up the lower-cased version of the header name.
172 */
173 ACL_VSTRING_RESET(header_key);
174 for (cp = string; *cp != ':'; cp++) {
175 if (*cp == 0) {
176 acl_msg_error("%s: no colon in header: %.30s",
177 myname, string);
178 if (key_buffer == NULL)
179 acl_vstring_free(header_key);
180 return (NULL);
181 }
182 ACL_VSTRING_ADDCH(header_key, ACL_TOLOWER(*cp));
183 }
184 acl_vstring_truncate(header_key,
185 trimblanks(STR(header_key), (int) (cp - string))
186 - STR(header_key));
187 ACL_VSTRING_TERMINATE(header_key);
188
189 header_info = (HEADER_OPTS*) acl_htable_find(header_ctx->header_hash,
190 STR(header_key));
191 if (key_buffer == NULL)
192 acl_vstring_free(header_key);
193
194 return (header_info);
195}
196
197HEADER_NV *header_split(const char *s)
198{

Callers 1

mime_header_lineFunction · 0.85

Calls 8

acl_pthread_onceFunction · 0.85
acl_msg_fatalFunction · 0.85
acl_vstring_allocFunction · 0.85
acl_msg_errorFunction · 0.85
acl_vstring_freeFunction · 0.85
acl_vstring_truncateFunction · 0.85
trimblanksFunction · 0.85
acl_htable_findFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…