Revision: 14773
Author: adrian.chadd
Date: Tue Aug 31 20:24:45 2010
Log: Oops - sometimes pconn's are pushed/popped without the client_address (ie, when
they're not pinned.)


http://code.google.com/p/lusca-cache/source/detail?r=14773

Modified:
 /playpen/LUSCA_HEAD_ipv6/src/pconn.c

=======================================
--- /playpen/LUSCA_HEAD_ipv6/src/pconn.c        Tue Aug 31 09:23:59 2010
+++ /playpen/LUSCA_HEAD_ipv6/src/pconn.c        Tue Aug 31 20:24:45 2010
@@ -244,11 +244,14 @@
 {
        sqaddr_t a;

-       sqinet_init(&a);
-       sqinet_set_v4_inaddr(&a, client_address);
-       sqinet_set_v4_port(&a, client_port, SQADDR_ASSERT_IS_V4);
-       pconnPush6(fd, host, port, domain, &a);
-       sqinet_done(&a);
+       if (client_address) {
+               sqinet_init(&a);
+               sqinet_set_v4_inaddr(&a, client_address);
+               sqinet_set_v4_port(&a, client_port, SQADDR_ASSERT_IS_V4);
+               pconnPush6(fd, host, port, domain, &a);
+               sqinet_done(&a);
+       } else
+               pconnPush6(fd, host, port, domain, NULL);
 }

 int
@@ -278,11 +281,15 @@
        sqaddr_t a;
        int r;

-       sqinet_init(&a);
-       sqinet_set_v4_inaddr(&a, client_address);
-       sqinet_set_v4_port(&a, client_port, SQADDR_ASSERT_IS_V4);
-       r = pconnPop6(host, port, domain, &a, idle);
-       sqinet_done(&a);
+       if (client_address) {
+               sqinet_init(&a);
+               sqinet_set_v4_inaddr(&a, client_address);
+               sqinet_set_v4_port(&a, client_port, SQADDR_ASSERT_IS_V4);
+               r = pconnPop6(host, port, domain, &a, idle);
+               sqinet_done(&a);
+       } else {
+               r = pconnPop6(host, port, domain, NULL, idle);
+       }
        return r;
 }

--
You received this message because you are subscribed to the Google Groups 
"lusca-commit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/lusca-commit?hl=en.

Reply via email to