<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="generator" content="Osso Notes">
    <title></title></head>
<body>
<p>----- Original message -----
<br>&gt; On 11/17/2012 09:00 AM, Balazs Scheidler wrote:
<br>&gt; &gt; dbparser: support inheriting properties in a corellation action
<br>&gt; &gt; 
<br>&gt; &gt; I merged this one, although I have some doubts. It uses
<br>&gt; &gt; log_msg_clone_cow(), which does have some tricky semantics, as it
<br>&gt; &gt; assumes that the cloned message will not change, once cloned.
<br>&gt; &gt; 
<br>&gt; &gt; I was thinking about removing clone_cow() completely because of this
<br>&gt; &gt; tricky stuff, and whenever we need a clone we're about to change the
<br>&gt; &gt; LogMessage anyway, and delaying the actual change means that we have
<br>&gt; &gt; to do two malloc() calls, instead of one.
<br>&gt; &gt; 
<br>&gt; &gt; Can you test whether changing the message that triggered the action
<br>&gt; &gt; with a rewrite rule, keeps the cloned one intact? This would need a
<br>&gt; &gt; parallel path to the db-parser().
<br>&gt; It seems, that log_msg_clone_cow write protects the original log 
<br>&gt; message, so trying to do a log_msg_set_value on the original message 
<br>&gt; will result in an assertion. Sorry I didn't realize this when doing the 
<br>&gt; original patch, explicitly copying all the name-value pairs seemed 
<br>&gt; inefficient, but this behaviour is not desirable. Should I rework the 
<br>&gt; patch this way or is there a better way of doing it?
<br>&gt; 
<br>
<br>I'd drop clone_cow() now, and implement a proper clone that allocates the logmsg header and nvtable in a single block, and copies everything through.
<br>
<br>that way clone+change becomes cheaper and you got a clone call that works in this case too.</p>
</body>
</html>