Update to 2.6 changeset 10924

From: Pawel Worach <pawel.worach@dont-contact.us>
Date: Tue, 15 Aug 2006 20:12:53 +0200

Hi folks,

Henrik pointed out on IRC that the changeset at
http://www.squid-cache.org/Versions/v2/2.6/changesets/10924.patch
doesn't actually work, that is because debug() can't be used that early.

Here is a suggested workaround.
This also adds information about the IO loop method used to mgr:info.

Index: src/comm_epoll.c
===================================================================
RCS file: /squid/squid/src/comm_epoll.c,v
retrieving revision 1.25
diff -u -u -r1.25 comm_epoll.c
--- src/comm_epoll.c 15 Aug 2006 14:32:26 -0000 1.25
+++ src/comm_epoll.c 15 Aug 2006 17:58:37 -0000
@@ -68,7 +68,6 @@
  void
  comm_select_init()
  {
- debug(5, 1) ("comm_select_init: using epoll\n");
      kdpfd = epoll_create(Squid_MaxFD);
      if (kdpfd < 0)
          fatalf("comm_select_init: epoll_create(): %s\n", xstrerror());
@@ -79,6 +78,12 @@
  }

  void
+comm_select_postinit()
+{
+ debug(5, 1) ("Using epoll for the IO loop\n");
+}
+
+void
  comm_select_shutdown()
  {
      fd_close(kdpfd);
@@ -88,6 +93,12 @@
  }

  void
+comm_select_status(StoreEntry * sentry)
+{
+ storeAppendPrintf(sentry, "\tIO loop method:
epoll\n");
+}
+
+void
  commSetEvents(int fd, int need_read, int need_write)
  {
      int epoll_ctl_type = 0;
Index: src/comm_kqueue.c
===================================================================
RCS file: /squid/squid/src/comm_kqueue.c,v
retrieving revision 1.8
diff -u -u -r1.8 comm_kqueue.c
--- src/comm_kqueue.c 15 Aug 2006 14:32:26 -0000 1.8
+++ src/comm_kqueue.c 15 Aug 2006 17:58:37 -0000
@@ -53,7 +53,6 @@
  void
  comm_select_init()
  {
- debug(5, 1) ("comm_select_init: using kqueue\n");
      kq = kqueue();
      if (kq < 0)
          fatalf("comm_select_init: kqueue(): %s\n", xstrerror());
@@ -67,6 +66,12 @@
  }

  void
+comm_select_postinit()
+{
+ debug(5, 1) ("Using kqueue for the IO loop\n");
+}
+
+void
  comm_select_shutdown()
  {
      fd_close(kq);
@@ -76,6 +81,12 @@
  }

  void
+comm_select_status(StoreEntry * sentry)
+{
+ storeAppendPrintf(sentry, "\tIO loop method:
kqueue\n");
+}
+
+void
  commSetEvents(int fd, int need_read, int need_write)
  {
      struct kevent *kep;
Index: src/comm_poll.c
===================================================================
RCS file: /squid/squid/src/comm_poll.c,v
retrieving revision 1.20
diff -u -u -r1.20 comm_poll.c
--- src/comm_poll.c 15 Aug 2006 14:32:26 -0000 1.20
+++ src/comm_poll.c 15 Aug 2006 17:58:37 -0000
@@ -570,17 +570,28 @@
  void
  comm_select_init(void)
  {
- debug(5, 1) ("comm_select_init: using poll\n");
      cachemgrRegister("comm_incoming",
          "comm_incoming() stats",
          commIncomingStats, 0, 1);
  }

  void
+comm_select_postinit()
+{
+ debug(5, 1) ("Using poll for the IO loop\n");
+}
+
+void
  comm_select_shutdown(void)
  {
  }

+void
+comm_select_status(StoreEntry * sentry)
+{
+ storeAppendPrintf(sentry, "\tIO loop method:
poll\n");
+}
+
  static void
  commIncomingStats(StoreEntry * sentry)
  {
Index: src/comm_select.c
===================================================================
RCS file: /squid/squid/src/comm_select.c,v
retrieving revision 1.76
diff -u -u -r1.76 comm_select.c
--- src/comm_select.c 15 Aug 2006 14:32:26 -0000 1.76
+++ src/comm_select.c 15 Aug 2006 17:58:37 -0000
@@ -558,7 +558,6 @@
  void
  comm_select_init(void)
  {
- debug(5, 1) ("comm_select_init: using select\n");
      zero_tv.tv_sec = 0;
      zero_tv.tv_usec = 0;
      cachemgrRegister("comm_incoming",
@@ -570,10 +569,22 @@
  }

  void
+comm_select_postinit()
+{
+ debug(5, 1) ("Using select for the IO loop\n");
+}
+
+void
  comm_select_shutdown(void)
  {
  }

+void
+comm_select_status(StoreEntry * sentry)
+{
+ storeAppendPrintf(sentry, "\tIO loop method:
select\n");
+}
+
  /*
   * examine_select - debug routine.
   *
Index: src/main.c
===================================================================
RCS file: /squid/squid/src/main.c,v
retrieving revision 1.387
diff -u -u -r1.387 main.c
--- src/main.c 30 Jul 2006 23:27:03 -0000 1.387
+++ src/main.c 15 Aug 2006 17:58:38 -0000
@@ -552,6 +552,7 @@
          debug(1, 1) ("Windows sockets initialized\n");
  #endif

+ comm_select_postinit();
      if (!configured_once)
          disk_init(); /* disk_init must go before ipcache_init() */
      ipcache_init();
Index: src/stat.c
===================================================================
RCS file: /squid/squid/src/stat.c,v
retrieving revision 1.373
diff -u -u -r1.373 stat.c
--- src/stat.c 29 Jul 2006 17:35:31 -0000 1.373
+++ src/stat.c 15 Aug 2006 17:58:39 -0000
@@ -659,6 +659,7 @@
          RESERVED_FD);
      storeAppendPrintf(sentry, "\tStore Disk files open:
  %4d\n",
          store_open_disk_fd);
+ comm_select_status(sentry);

      storeAppendPrintf(sentry, "Internal Data Structures:\n");
      storeAppendPrintf(sentry, "\t%6d StoreEntries\n",

-- 
Pawel
Received on Tue Aug 15 2006 - 12:13:12 MDT

This archive was generated by hypermail pre-2.1.9 : Fri Sep 01 2006 - 12:00:03 MDT