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

Function http_hdr_entry_replace

lib_protocol/src/http/http_hdr.c:290–314  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

288}
289
290int http_hdr_entry_replace(HTTP_HDR *hh, const char *name,
291 const char *value, int force)
292{
293 HTTP_HDR_ENTRY *entry;
294
295 if (hh == NULL || name == NULL || value == NULL) {
296 acl_msg_error("%s, %s(%d): input invalid",
297 __FILE__, __FUNCTION__, __LINE__);
298 return -1;
299 }
300
301 entry = __get_hdr_entry(hh, name);
302 if (entry == NULL) {
303 if (force == 0)
304 return -1;
305 entry = http_hdr_entry_build(name, value);
306 } else {
307 acl_array_delete_obj(hh->entry_lnk, entry, NULL);
308 acl_myfree(entry);
309 entry = http_hdr_entry_build(name, value);
310 }
311
312 http_hdr_append_entry(hh, entry);
313 return 0;
314}
315
316int http_hdr_entry_replace2(HTTP_HDR *hh, const char *name,
317 const char *from, const char *to, int ignore_case)

Callers 12

on_connectFunction · 0.85
header_updateMethod · 0.85
DoRequestThreadMethod · 0.85
on_connectFunction · 0.85
http_util_set_req_entryFunction · 0.85
http_util_set_req_referFunction · 0.85
http_util_set_res_entryFunction · 0.85
run_cgiFunction · 0.85
start_forward_respondFunction · 0.85

Calls 5

acl_msg_errorFunction · 0.85
__get_hdr_entryFunction · 0.85
http_hdr_entry_buildFunction · 0.85
acl_array_delete_objFunction · 0.85
http_hdr_append_entryFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…