+void z_HTTP_header_set(ODR o, Z_HTTP_Header **hp, const char *n,
+ const char *v)
+{
+ while (*hp)
+ {
+ if (!yaz_strcasecmp((*hp)->name, n))
+ {
+ (*hp)->value = odr_strdup(o, v);
+ return;
+ }
+ hp = &(*hp)->next;
+ }
+ *hp = (Z_HTTP_Header *) odr_malloc(o, sizeof(**hp));
+ (*hp)->name = odr_strdup(o, n);
+ (*hp)->value = odr_strdup(o, v);
+ (*hp)->next = 0;
+}
+
+const char *z_HTTP_header_remove(Z_HTTP_Header **hp, const char *n)
+{
+ while (*hp)
+ {
+ if (!yaz_strcasecmp((*hp)->name, n))
+ {
+ const char *v = (*hp)->value;
+ *hp = (*hp)->next;
+ return v;
+ }
+ hp = &(*hp)->next;
+ }
+ return 0;
+}
+