X-Git-Url: http://www.dolda2000.com/gitweb/?a=blobdiff_plain;f=lib%2Freq.c;h=0ede22906869c55d308fd9f3e5e4d9632ce35fe4;hb=9e9eca797684e57318dde54f5a89a3029181590e;hp=26711599a3879eec1697fbba7582b78522ee4a69;hpb=8f55ddd74fadb637a400e0ec4d0f2714dfb41804;p=ashd.git diff --git a/lib/req.c b/lib/req.c index 2671159..0ede229 100644 --- a/lib/req.c +++ b/lib/req.c @@ -89,6 +89,17 @@ char *getheader(struct hthead *head, char *name) return(NULL); } +void replrest(struct hthead *head, char *rest) +{ + char *tmp; + + /* Do not free the current rest string yet, so that the new one + * can a subpart of the old one. */ + tmp = head->rest; + head->rest = sstrdup(rest); + free(tmp); +} + void headpreheader(struct hthead *head, const char *name, const char *val) { head->headers = srealloc(head->headers, sizeof(*head->headers) * (head->noheaders + 1));