Revision: 14853
Author:   adrian.chadd
Date:     Fri Jul  1 23:10:25 2011
Log:
Convert commConnectStart() to take a sqaddr_t, rather than a v4 only
local address.

The rest of commConnect* is v4-only for now however.


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

Modified:
 /playpen/LUSCA_HEAD_ipv6/src/comm.c
 /playpen/LUSCA_HEAD_ipv6/src/forward.c
 /playpen/LUSCA_HEAD_ipv6/src/protos.h

=======================================
--- /playpen/LUSCA_HEAD_ipv6/src/comm.c Tue Jan 11 21:34:35 2011
+++ /playpen/LUSCA_HEAD_ipv6/src/comm.c Fri Jul  1 23:10:25 2011
@@ -68,7 +68,8 @@
 CBDATA_TYPE(ConnectStateData);

 void
-commConnectStart(int fd, const char *host, u_short port, CNCB * callback, void *data, struct in_addr *addr)
+commConnectStart(int fd, const char *host, u_short port, CNCB * callback,
+    void *data, sqaddr_t *addr6)
 {
     ConnectStateData *cs;
     debug(5, 3) ("commConnectStart: FD %d, %s:%d\n", fd, host, (int) port);
@@ -86,8 +87,9 @@
     cs->callback = callback;
     cs->data = data;
     sqinet_init(&cs->in_addr6);
-    if (addr != NULL) {
-        sqinet_set_v4_inaddr(&cs->in_addr6, addr);
+    if (addr6 != NULL) {
+        sqinet_init(&cs->in_addr6);
+       sqinet_copy(&cs->in_addr6, addr6);
        cs->addrcount = 1;
     } else {
        cs->addrcount = 0;
=======================================
--- /playpen/LUSCA_HEAD_ipv6/src/forward.c      Tue Sep  7 00:31:56 2010
+++ /playpen/LUSCA_HEAD_ipv6/src/forward.c      Fri Jul  1 23:10:25 2011
@@ -727,12 +727,11 @@
      * peer, then don't cache, and use the IP that the client's DNS lookup
      * returned
      */
- if (fwdState->request->flags.transparent && (fwdState->n_tries > 1) && (NULL == fs->peer)) {
-#warning This needs to be made ipv6-aware
-       struct in_addr addr;
- addr = sqinet_get_v4_inaddr(&fwdState->request->my_address, SQADDR_ASSERT_IS_V4);
+    if (fwdState->request->flags.transparent && (fwdState->n_tries > 1)
+      && (NULL == fs->peer)) {
        storeRelease(fwdState->entry);
-       commConnectStart(fd, host, port, fwdConnectDone, fwdState, &addr);
+       commConnectStart(fd, host, port, fwdConnectDone, fwdState,
+          &fwdState->request->my_address);
     } else {
        commConnectStart(fd, host, port, fwdConnectDone, fwdState, NULL);
     }
=======================================
--- /playpen/LUSCA_HEAD_ipv6/src/protos.h       Tue Jan 11 17:18:58 2011
+++ /playpen/LUSCA_HEAD_ipv6/src/protos.h       Fri Jul  1 23:10:25 2011
@@ -1059,7 +1059,8 @@
 extern void statIappStats(StoreEntry *sentry);

 /* comm.c */
-extern void commConnectStart(int fd, const char *, u_short, CNCB *, void *, struct in_addr *addr);
+extern void commConnectStart(int fd, const char *, u_short, CNCB *, void *,
+    sqaddr_t *addr6);

 /* client_side_location_rewrite.c */
 extern void clientHttpLocationRewriteCheck(clientHttpRequest * http);

--
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