]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Preserve old registration tag when updating registration info.
authorAlex Rousskov <rousskov@measurement-factory.com>
Tue, 1 Feb 2011 08:22:59 +0000 (01:22 -0700)
committerAlex Rousskov <rousskov@measurement-factory.com>
Tue, 1 Feb 2011 08:22:59 +0000 (01:22 -0700)
Sometimes, tagless strand registers self only after its module (like
IpcIoFile) supplies a tag. We need to keep the tag for future tag searches
to succeed.

src/ipc/Coordinator.cc

index f1e6032132f64b87a1bdc87d8d671189de5ba042..afdec48cadd9c0a51508298d4d5140a2b85f5aa5 100644 (file)
@@ -48,10 +48,14 @@ void Ipc::Coordinator::registerStrand(const StrandCoord& strand)
 {
     debugs(54, 3, HERE << "registering kid" << strand.kidId <<
            ' ' << strand.tag);
-    if (StrandCoord* found = findStrand(strand.kidId))
+    if (StrandCoord* found = findStrand(strand.kidId)) {
+        const String oldTag = found->tag;
         *found = strand;
-    else
+        if (oldTag.size() && !strand.tag.size())
+            found->tag = oldTag; // keep more detailed info (XXX?)
+    } else {
         strands_.push_back(strand);
+    }
 
     // notify searchers waiting for this new strand, if any
     typedef Searchers::iterator SRI;