X-Git-Url: http://www.dolda2000.com/gitweb/?a=blobdiff_plain;f=lib%2Freq.c;h=64944bf56b1c93a949526615faf01f4c14047144;hb=d341283f757e188a52aedae7d715e201f2a430c2;hp=b3d92140d4f0ce3e153eea58abbe1ea57d50c6fd;hpb=a39d9e16527a796bdf15bf4bb8fab81aac24ffa1;p=ashd.git diff --git a/lib/req.c b/lib/req.c index b3d9214..64944bf 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, sizeof(head->headers) * (--head->noheaders - i)); + return; + } + } +} + int writeresp(FILE *out, struct hthead *resp) { int i;