From: Fredrik Tolf Date: Wed, 17 Dec 2008 02:29:09 +0000 (+0100) Subject: Send request data to multiplexer. X-Git-Tag: 0.1~131 X-Git-Url: http://git.dolda2000.com/gitweb/?a=commitdiff_plain;ds=sidebyside;h=a0327573bb6032e02e988a0d0aed709b4be7a422;hp=fe8e38f3d5864c4db892ea6bd59ad74653b255e7;p=ashd.git Send request data to multiplexer. --- diff --git a/src/htparser.c b/src/htparser.c index 57b7a26..c78f064 100644 --- a/src/htparser.c +++ b/src/htparser.c @@ -342,7 +342,7 @@ static void serve(struct muth *muth, va_list args) char *hd; struct charbuf inbuf, outbuf; struct hthead *req, *resp; - off_t sent; + off_t dlen, sent; size_t headoff; char nmbuf[256]; @@ -382,6 +382,15 @@ static void serve(struct muth *muth, va_list args) headappheader(req, "X-Ash-Port", sprintf3("%i", ntohs(((struct sockaddr_in6 *)&name)->sin6_port))); } cfd = sendreq(plex, req); + + /* + * If there is message data, pass it: + */ + if((hd = getheader(req, "content-length")) != NULL) { + dlen = atoo(hd); + if(dlen > 0) + passdata(fd, cfd, &inbuf, dlen); + } /* * Find and decode the response header: