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));
void headappheader(struct hthead *head, const char *name, const char *val);
int sendreq(int sock, struct hthead *req);
int recvreq(int sock, struct hthead **reqp);
+void replrest(struct hthead *head, char *rest);
#endif
goto out;
inbuf.b[headoff] = old;
bufeat(inbuf, headoff);
+ /* We strip off the leading slash from the rest string, so
+ * that multiplexers can parse coherently. */
+ if(req->rest[0] == '/')
+ replrest(req, req->rest + 1);
/*
* Add metainformation and then send the request to the root