View | Details | Raw Unified | Return to bug 212432
Collapse All | Expand All

(-)www/squid/files/patch-src_adaptation_icap_Xaction.cc (+11 lines)
Line 0 Link Here
1
--- src/adaptation/icap/Xaction.cc.orig	2016-09-06 21:04:51 UTC
2
+++ src/adaptation/icap/Xaction.cc
3
@@ -599,7 +599,7 @@ const char *Adaptation::Icap::Xaction::s
4
     buf.append("/", 1);
5
     fillDoneStatus(buf);
6
 
7
-    buf.Printf(" %s%u]", id.Prefix, id.value);
8
+    buf.Printf(" %s%u]", id.prefix(), id.value);
9
 
10
     buf.terminate();
11
 
(-)www/squid/files/patch-src_base_AsyncJob.cc (+11 lines)
Line 0 Link Here
1
--- src/base/AsyncJob.cc.orig	2016-09-06 21:04:51 UTC
2
+++ src/base/AsyncJob.cc
3
@@ -164,7 +164,7 @@ const char *AsyncJob::status() const
4
         buf.Printf("Stopped, reason:");
5
         buf.Printf("%s",stopReason);
6
     }
7
-    buf.Printf(" %s%u]", id.Prefix, id.value);
8
+    buf.Printf(" %s%u]", id.prefix(), id.value);
9
     buf.terminate();
10
 
11
     return buf.content();
(-)www/squid/files/patch-src_base_InstanceId.h (+55 lines)
Line 0 Link Here
1
--- src/base/InstanceId.h.orig	2016-07-01 11:37:50 UTC
2
+++ src/base/InstanceId.h
3
@@ -25,35 +25,41 @@ class InstanceId
4
 public:
5
     typedef unsigned int Value; ///< id storage type; \todo: parameterize?
6
 
7
-    InstanceId(): value(++Last ? Last : ++Last) {}
8
+    InstanceId(): value(0) {change();}
9
 
10
     operator Value() const { return value; }
11
     bool operator ==(const InstanceId &o) const { return value == o.value; }
12
     bool operator !=(const InstanceId &o) const { return !(*this == o); }
13
-    void change() {value = ++Last ? Last : ++Last;}
14
+    void change();
15
 
16
-    /// prints Prefix followed by ID value; \todo: use HEX for value printing?
17
+    /// prints class-pecific prefix followed by ID value; \todo: use HEX for value printing?
18
     std::ostream &print(std::ostream &os) const;
19
 
20
+    /// returns the class-pecific prefix
21
+    const char * const prefix() const;
22
+
23
 public:
24
-    static const char *Prefix; ///< Class shorthand string for debugging
25
     Value value; ///< instance identifier
26
 
27
 private:
28
     InstanceId(const InstanceId& right); ///< not implemented; IDs are unique
29
     InstanceId& operator=(const InstanceId &right); ///< not implemented
30
-
31
-private:
32
-    static Value Last; ///< the last used ID value
33
 };
34
 
35
 /// convenience macro to instantiate Class-specific stuff in .cc files
36
-#define InstanceIdDefinitions(Class, prefix) \
37
-    template<> const char *InstanceId<Class>::Prefix = prefix; \
38
-    template<> InstanceId<Class>::Value InstanceId<Class>::Last = 0; \
39
+#define InstanceIdDefinitions(Class, pfx) \
40
+    template<> const char * const \
41
+    InstanceId<Class>::prefix() const { \
42
+        return pfx; \
43
+    } \
44
     template<> std::ostream & \
45
     InstanceId<Class>::print(std::ostream &os) const { \
46
-        return os << Prefix << value; \
47
+        return os << pfx << value; \
48
+    } \
49
+    template<> void \
50
+    InstanceId<Class>::change() { \
51
+        static InstanceId<Class>::Value Last = 0; \
52
+        value = ++Last ? Last : ++Last; \
53
     }
54
 
55
 /// print the id
(-)www/squid/files/patch-src_ssl_PeerConnector.cc (+11 lines)
Line 0 Link Here
1
--- src/ssl/PeerConnector.cc.orig	2016-07-01 11:37:50 UTC
2
+++ src/ssl/PeerConnector.cc
3
@@ -771,7 +771,7 @@ Ssl::PeerConnector::status() const
4
     }
5
     if (serverConn != NULL)
6
         buf.Printf(" FD %d", serverConn->fd);
7
-    buf.Printf(" %s%u]", id.Prefix, id.value);
8
+    buf.Printf(" %s%u]", id.prefix(), id.value);
9
     buf.terminate();
10
 
11
     return buf.content();

Return to bug 212432