X-Git-Url: http://www.dolda2000.com/gitweb/?p=ashd.git;a=blobdiff_plain;f=lib%2Freq.c;h=0ede22906869c55d308fd9f3e5e4d9632ce35fe4;hp=26711599a3879eec1697fbba7582b78522ee4a69;hb=9e9eca797684e57318dde54f5a89a3029181590e;hpb=a0327573bb6032e02e988a0d0aed709b4be7a422 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));