| 288 | } |
| 289 | |
| 290 | int 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 | |
| 316 | int http_hdr_entry_replace2(HTTP_HDR *hh, const char *name, |
| 317 | const char *from, const char *to, int ignore_case) |
no test coverage detected
searching dependent graphs…