Small fixes and tweaks.

- Fixing tiny leak.

    - Fixing threads stat output.
This commit is contained in:
Robin Sommer 2012-03-16 09:11:31 -07:00
parent 89a3bb33c8
commit e3f5cbb670
3 changed files with 19 additions and 20 deletions

View file

@ -677,11 +677,11 @@ bool Manager::Write(EnumVal* id, RecordVal* columns)
Val* path_arg; Val* path_arg;
if ( filter->path_val ) if ( filter->path_val )
path_arg = filter->path_val; path_arg = filter->path_val->Ref();
else else
path_arg = new StringVal(""); path_arg = new StringVal("");
vl.append(path_arg->Ref()); vl.append(path_arg);
Val* rec_arg; Val* rec_arg;
BroType* rt = filter->path_func->FType()->Args()->FieldType("rec"); BroType* rt = filter->path_func->FType()->Args()->FieldType("rec");
@ -715,7 +715,6 @@ bool Manager::Write(EnumVal* id, RecordVal* columns)
if ( ! filter->path_val ) if ( ! filter->path_val )
{ {
Unref(path_arg);
filter->path = v->AsString()->CheckString(); filter->path = v->AsString()->CheckString();
filter->path_val = v->Ref(); filter->path_val = v->Ref();
} }

View file

@ -102,25 +102,25 @@ void Manager::Process()
next_beat = 0; next_beat = 0;
} }
if ( ! t->HasOut() ) while ( t->HasOut() )
continue;
Message* msg = t->RetrieveOut();
if ( msg->Process() )
{ {
if ( network_time ) Message* msg = t->RetrieveOut();
did_process = true;
if ( msg->Process() )
{
if ( network_time )
did_process = true;
}
else
{
string s = msg->Name() + " failed, terminating thread";
reporter->Error("%s", s.c_str());
t->Stop();
} }
else delete msg;
{
string s = msg->Name() + " failed, terminating thread";
reporter->Error("%s", s.c_str());
t->Stop();
} }
delete msg;
} }
// fprintf(stderr, "P %.6f %.6f do_beat=%d did_process=%d next_next=%.6f\n", network_time, timer_mgr->Time(), do_beat, (int)did_process, next_beat); // fprintf(stderr, "P %.6f %.6f do_beat=%d did_process=%d next_next=%.6f\n", network_time, timer_mgr->Time(), do_beat, (int)did_process, next_beat);

View file

@ -281,7 +281,7 @@ void MsgThread::GetStats(Stats* stats)
{ {
stats->sent_in = cnt_sent_in; stats->sent_in = cnt_sent_in;
stats->sent_out = cnt_sent_out; stats->sent_out = cnt_sent_out;
stats->pending_in = cnt_sent_in - queue_in.Size(); stats->pending_in = queue_in.Size();
stats->pending_out = cnt_sent_out - queue_out.Size(); stats->pending_out = queue_out.Size();
} }