Revision: 14441
Author: adrian.chadd
Date: Tue Mar  2 18:55:27 2010
Log: Migrate the "don't do PMTU" hack out into libiapp/ so it can be used elsewhere.


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

Modified:
 /branches/LUSCA_HEAD/libiapp/comm.c
 /branches/LUSCA_HEAD/libiapp/comm.h
 /branches/LUSCA_HEAD/src/client_side.c

=======================================
--- /branches/LUSCA_HEAD/libiapp/comm.c Fri Feb 19 23:53:43 2010
+++ /branches/LUSCA_HEAD/libiapp/comm.c Tue Mar  2 18:55:27 2010
@@ -1029,6 +1029,21 @@
        debug(5, 0) ("commSetNoLinger: FD %d: %s\n", fd, xstrerror());
     fd_table[fd].flags.nolinger = 1;
 }
+
+void
+commSetNoPmtuDiscover(int fd)
+{
+#if defined(IP_MTU_DISCOVER) && defined(IP_PMTUDISC_DONT)
+       int i = IP_PMTUDISC_DONT;
+       (void) setsockopt(fd, SOL_IP, IP_MTU_DISCOVER, &i, sizeof i);
+#else
+       static int reported = 0;
+       if (!reported) {
+ debug(33, 1) ("Notice: httpd_accel_no_pmtu_disc not supported on your platform\n");
+               reported = 1;
+       }
+#endif
+}

 static void
 commSetReuseAddr(int fd)
=======================================
--- /branches/LUSCA_HEAD/libiapp/comm.h Fri Feb 19 23:53:43 2010
+++ /branches/LUSCA_HEAD/libiapp/comm.h Tue Mar  2 18:55:27 2010
@@ -193,6 +193,8 @@
 #if LINGERING_CLOSE
 extern void comm_lingering_close(int fd);
 #endif
+extern void commSetNoPmtuDiscover(int fd);
+
 extern int comm_connect_addr(int sock, const sqaddr_t *addr);
extern void comm_connect_begin(int fd, const sqaddr_t *addr, CNCB *cb, void *cbdata);
 extern void comm_init(void);
=======================================
--- /branches/LUSCA_HEAD/src/client_side.c      Mon Mar  1 19:53:25 2010
+++ /branches/LUSCA_HEAD/src/client_side.c      Tue Mar  2 18:55:27 2010
@@ -2532,18 +2532,10 @@
            port = atoi(portstr);
        }
        http->flags.transparent = 1;
-       if (Config.onoff.accel_no_pmtu_disc) {
-#if defined(IP_MTU_DISCOVER) && defined(IP_PMTUDISC_DONT)
-           int i = IP_PMTUDISC_DONT;
-           setsockopt(conn->fd, SOL_IP, IP_MTU_DISCOVER, &i, sizeof i);
-#else
-           static int reported = 0;
-           if (!reported) {
- debug(33, 1) ("Notice: httpd_accel_no_pmtu_disc not supported on your platform\n");
-               reported = 1;
-           }
-#endif
-       }
+
+       if (Config.onoff.accel_no_pmtu_disc)
+           commSetNoPmtuDiscover(conn->fd);
+
        if (conn->port->transparent && clientNatLookup(conn) == 0)
            conn->transparent = 1;
        if (!host && conn->transparent) {

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