On Thu, Dec 05, 2002 at 07:16:02AM +0000, Joe Orton wrote:
> On Wed, Dec 04, 2002 at 11:38:06PM +0000, Colm MacCárthaigh wrote:
> > On Wed, Dec 04, 2002 at 11:05:21PM +0000, Joe Orton wrote:
> > > Colm, can you try running the apr/test/sendfile binary with your
> > > machines?
> > 
> > It was one of the first things I tried when I was debugging,
> > unfortunately, it doesnt seem to support IPv6 from the client side
> > at all, I get:
> >
> > colmmacc@byron:~/apr/test$ ./sendfile client blocking orion.ipv6.heanet.ie
> > Creating a test file...
> > apr_sockaddr_info_get()->670005/No address associated with hostname
> 
> Oh, sorry, I forgot to mention, you have to change the "family =
> APR_INET" line to "family = APR_INET6" to make it work over IPv6.

O.k., I've done that, and yes it works for me. sendfile.c
creates and deletes the file it sends though, it also only
serves it once, and the bug only appears when you do it twice.

In order to see the bug sendfile.c would have to try and
send the same file down two different sockets. One after
another, and monitor the second one. I patched it to fix
this (patch is below), but it isnt displaying the problem.

There are a few slight differences in what it's doing compared
to httpd though. Firstly, it's the client end that's sending
the file here, which might be relevant. 

The way I can reliably reproduce the bug, is :

./configure
make
make install
dd bs=1 count=256 if=/dev/zero of=/usr/local/apache2/htdocs/index.html
/usr/local/apache2/bin/apachectl start

[ go to other machine ]

telnet [v6addr] 80
GET / HTTP/1.1
Host: madeup.tld

<observe response>

telnet [v6addr] 80
GET / HTTP/1.1
Host: madeup.tld

<observe lack of response>

Index: sendfile.c
===================================================================
RCS file: /home/cvspublic/apr/test/sendfile.c,v
retrieving revision 1.23
diff -u -r1.23 sendfile.c
--- sendfile.c  20 Nov 2002 03:50:22 -0000      1.23
+++ sendfile.c  5 Dec 2002 10:40:39 -0000
@@ -222,9 +222,9 @@
     int family;
     apr_sockaddr_t *destsa;
 
-    family = APR_INET;
+    family = APR_INET6;
     apr_setup(&p, &sock, &family);
-    create_testfile(p, TESTFILE);
+    /* create_testfile(p, TESTFILE); */
 
     rv = apr_file_open(&f, TESTFILE, APR_READ, 0, p);
     if (rv != APR_SUCCESS) {
@@ -492,13 +492,13 @@
 
     printf("client: apr_socket_sendfile() worked as expected!\n");
 
-    rv = apr_file_remove(TESTFILE, p);
+/*    rv = apr_file_remove(TESTFILE, p);
     if (rv != APR_SUCCESS) {
         fprintf(stderr, "apr_file_remove()->%d/%s\n",
                 rv,
                apr_strerror(rv, buf, sizeof buf));
         exit(1);
-    }
+    } */
 
     return 0;
 }
@@ -752,6 +752,8 @@
             host = argv[3];
         }      
         if (!strcmp(argv[2], "blocking")) {
+           client(BLK, host);
+           sleep(10);
             return client(BLK, host);
         }
         else if (!strcmp(argv[2], "timeout")) {
-- 
[EMAIL PROTECTED]        PubKey: [EMAIL PROTECTED]  
Web:                                 http://devnull.redbrick.dcu.ie/ 

Reply via email to