X-Git-Url: http://dolda2000.com/gitweb/?a=blobdiff_plain;f=src%2Fhtparser.c;h=5d7a9324cfeef4aa909a366124a0ce6bb4435477;hb=992ce9ef8adb25fdcc47264187450a3edb287167;hp=4924b981c01019c7a9c3f32d3629dff2ad3eb67c;hpb=46c3d4304f2846f05f1c44f39b67563f9f1f3acb;p=ashd.git diff --git a/src/htparser.c b/src/htparser.c index 4924b98..5d7a932 100644 --- a/src/htparser.c +++ b/src/htparser.c @@ -300,6 +300,7 @@ static void serve(struct muth *muth, va_list args) vavar(int, fd); vavar(struct sockaddr_storage, name); int cfd; + int pfds[2]; char old; char *hd, *p; struct charbuf inbuf, outbuf; @@ -352,8 +353,12 @@ static void serve(struct muth *muth, va_list args) } if(block(plex, EV_WRITE, 60) <= 0) goto out; - if((cfd = sendreq(plex, req)) < 0) + if(socketpair(PF_UNIX, SOCK_STREAM, 0, pfds)) goto out; + if(sendreq(plex, req, pfds[0])) + goto out; + close(pfds[0]); + cfd = pfds[1]; /* * If there is message data, pass it: