lib: Allow reception of mtstdopen info structure.
[ashd.git] / src / accesslog.c
index 536f118..a3894bf 100644 (file)
@@ -249,10 +249,10 @@ static void filterreq(struct muth *mt, va_list args)
     data = defdata;
     data.req = req;
     gettimeofday(&data.start, NULL);
-    cl = mtstdopen(fd, 1, 600, "r+");
+    cl = mtstdopen(fd, 1, 600, "r+", NULL);
     if(socketpair(PF_UNIX, SOCK_STREAM, 0, pfds))
        goto out;
-    hd = mtstdopen(pfds[1], 1, 600, "r+");
+    hd = mtstdopen(pfds[1], 1, 600, "r+", NULL);
     if(sendreq(ch, req, pfds[0])) {
        close(pfds[0]);
        goto out;
@@ -261,6 +261,8 @@ static void filterreq(struct muth *mt, va_list args)
     
     if(passdata(cl, hd, &data.bytesin))
        goto out;
+    if(fflush(hd))
+       goto out;
     shutdown(pfds[1], SHUT_WR);
     if((resp = parseresponse(hd)) == NULL)
        goto out;