#include "DelayIdComposite.h"
#include "DelayPools.h"
#include "ip/Address.h"
-#include "SquidString.h"
+#include "sbuf/SBuf.h"
class StoreEntry;
{
public:
- CompositeSelectionDetails() {}
+ CompositeSelectionDetails(const Ip::Address& aSrcAddr, const SBuf &aTag) :
+ src_addr(aSrcAddr), tag(aTag)
+ {}
Ip::Address src_addr;
#if USE_AUTH
Auth::UserRequest::Pointer user;
#endif
- String tag;
+ const SBuf tag;
};
protected:
#include "DelayPools.h"
#include "http/Stream.h"
#include "HttpRequest.h"
+#include "sbuf/StringConvert.h"
#include "SquidConfig.h"
DelayId::DelayId () : pool_ (0), compositeId(nullptr), markedAsNoDelay(false)
if (DelayPools::delay_data[pool].theComposite().getRaw() && ch.fastCheck().allowed()) {
DelayId result (pool + 1);
- CompositePoolNode::CompositeSelectionDetails details;
- details.src_addr = ch.src_addr;
+ CompositePoolNode::CompositeSelectionDetails details(ch.src_addr, StringToSBuf(r->tag));
#if USE_AUTH
details.user = r->auth_user_request;
#endif
- details.tag = r->tag;
result.compositePosition(DelayPools::delay_data[pool].theComposite()->id(details));
return result;
}
DelayTagged::id(CompositePoolNode::CompositeSelectionDetails &details)
{
- if (!details.tag.size())
+ if (!details.tag.length())
return new NullDelayId;
return new Id(this, details.tag);
}
-DelayTaggedBucket::DelayTaggedBucket(String &aTag) : tag (aTag)
+DelayTaggedBucket::DelayTaggedBucket(const SBuf &aTag): tag(aTag)
{
debugs(77, 3, "DelayTaggedBucket::DelayTaggedBucket");
}
void
DelayTaggedBucket::stats(StoreEntry *entry) const
{
- storeAppendPrintf(entry, " " SQUIDSTRINGPH ":", SQUIDSTRINGPRINT(tag));
+ storeAppendPrintf(entry, " " SQUIDSBUFPH ":", SQUIDSBUFPRINT(tag));
theBucket.stats(entry);
}
-DelayTagged::Id::Id(DelayTagged::Pointer aDelayTagged, String &aTag) : theTagged(aDelayTagged)
+DelayTagged::Id::Id(const DelayTagged::Pointer &aDelayTagged, const SBuf &aTag): theTagged(aDelayTagged)
{
theBucket = new DelayTaggedBucket(aTag);
DelayTaggedBucket::Pointer const *existing = theTagged->buckets.find(theBucket, DelayTaggedCmp);
#include "DelayBucket.h"
#include "DelayIdComposite.h"
#include "DelaySpec.h"
+#include "sbuf/SBuf.h"
#include "splay.h"
/// \ingroup DelayPoolsAPI
typedef RefCount<DelayTaggedBucket> Pointer;
void stats(StoreEntry *)const;
- DelayTaggedBucket(String &aTag);
+ explicit DelayTaggedBucket(const SBuf &aTag);
~DelayTaggedBucket() override;
DelayBucket theBucket;
- String tag;
+ const SBuf tag;
};
/// \ingroup DelayPoolsAPI
MEMPROXY_CLASS(DelayTagged::Id);
public:
- Id (RefCount<DelayTagged>, String &);
+ Id(const RefCount<DelayTagged> &, const SBuf &);
~Id() override;
int bytesWanted (int min, int max) const override;
void bytesIn(int qty) override;