X-Git-Url: http://dolda2000.com/gitweb/?a=blobdiff_plain;f=lib%2Freq.c;h=7bb37b443ccb9ce17798175801cd85169801bf3f;hb=1755d287f3cd52e739bf5b2e7392f894ee82d469;hp=b3d92140d4f0ce3e153eea58abbe1ea57d50c6fd;hpb=a39d9e16527a796bdf15bf4bb8fab81aac24ffa1;p=ashd.git diff --git a/lib/req.c b/lib/req.c index b3d9214..7bb37b4 100644 --- a/lib/req.c +++ b/lib/req.c @@ -191,6 +191,21 @@ void headappheader(struct hthead *head, const char *name, const char *val) head->headers[i][1] = sstrdup(val); } +void headrmheader(struct hthead *head, const char *name) +{ + int i; + + for(i = 0; i < head->noheaders; i++) { + if(!strcasecmp(head->headers[i][0], name)) { + free(head->headers[i][0]); + free(head->headers[i][1]); + free(head->headers[i]); + memmove(head->headers + i, head->headers + i + 1, --head->noheaders - i); + return; + } + } +} + int writeresp(FILE *out, struct hthead *resp) { int i;