syslog-ng-users November 2011 archive
Main Archive Page > Month Archives  > syslog-ng-users archives
syslog-ng-users: Re: [syslog-ng] [PATCH 0/1]: value-pairs key re

Re: [syslog-ng] [PATCH 0/1]: value-pairs key rewriting for 3.4

From: Gergely Nagy <algernon_at_nospam>
Date: Sat Nov 19 2011 - 23:26:37 GMT

Gergely Nagy <> writes:

> Gergely Nagy <> writes:
>> I don't think it's ripe for a merge yet, there's a bit of work left to
>> done still, at least in the code part. The functionality itself is - I
>> believe - solid by now.
> A couple of other notes I discovered just after hitting send:
> * The value-pairs testcase crashes. I don't yet know why, but it didn't
> do that before I made the transformations thread-safe. So I must have
> screwed something up there.

Indeed, I did! I changed the scope_set hashtable to free its keys on
destructions, but failed to ensure that all keys are copied - so the
test suite ended up trying to free the same string twice.

This is now corrected, and I pushed a new version of my branch out.

> * The ValuePairsTransformSet contains a GPatternSpec that it doesn't
> really need. It's exactly the same pattern we use for key(), so it's
> duplicated here.
> It should be value-pairs that checks whether a transformation needs to
> be applied or not, not the transformation set itself.
> This needs a bit of code-juggling to do, but is fairly
> straightforward, but I lack the time to do it tonight.

This proved to be trickier than anticipated, and I ran into a problem
with not being happy with the current implementation of value-pairs at
all. There's too much copying and magic going on for my taste.

I'm starting to see the reason why Bazsi wanted scratch buffers
implemented in another way - that way would make it easier for me to use
them in value-pairs too.

I'll see if changing scratch-buffer helps me in refactoring the key
rewrite patch into something saner.

-- |8] ______________________________________________________________________________ Member info: Documentation: FAQ: