mirror of
https://github.com/zeek/zeek.git
synced 2025-10-14 20:48:21 +00:00
binpac: Apply bits of nadi-bittorrent patch that aren't applied
This commit is contained in:
parent
090325df40
commit
dd3737b5c8
3 changed files with 9 additions and 184 deletions
|
@ -217,7 +217,7 @@ void FlowDecl::GenProcessFunc(Output* out_h, Output* out_cc)
|
|||
{
|
||||
out_cc->println("%s->DiscardData();", env_->LValue(flow_buffer_id));
|
||||
}
|
||||
out_cc->println("throw;");
|
||||
out_cc->println("throw e;");
|
||||
out_cc->println("}");
|
||||
out_cc->dec_indent();
|
||||
|
||||
|
|
|
@ -393,12 +393,10 @@ void Type::GenBufferConfiguration(Output* out_cc, Env* env)
|
|||
if ( ! NeedsBufferingStateVar() )
|
||||
break;
|
||||
|
||||
if ( buffering_state_var_field_ )
|
||||
{
|
||||
out_cc->println("if ( %s == 0 )", env->RValue(buffering_state_id));
|
||||
out_cc->inc_indent();
|
||||
out_cc->println("{");
|
||||
}
|
||||
ASSERT(env->GetDataType(buffering_state_id));
|
||||
out_cc->println("if ( %s == 0 )", env->RValue(buffering_state_id));
|
||||
out_cc->inc_indent();
|
||||
out_cc->println("{");
|
||||
|
||||
if ( attr_length_expr_ )
|
||||
{
|
||||
|
@ -418,15 +416,13 @@ void Type::GenBufferConfiguration(Output* out_cc, Env* env)
|
|||
out_cc->println("%s->NewFrame(%s, %s);", env->LValue(flow_buffer_id),
|
||||
frame_buffer_arg.c_str(), attr_chunked() ? "true" : "false");
|
||||
|
||||
if ( buffering_state_var_field_ )
|
||||
{
|
||||
out_cc->println("%s = 1;", env->LValue(buffering_state_id));
|
||||
out_cc->println("}");
|
||||
out_cc->dec_indent();
|
||||
}
|
||||
out_cc->println("%s = 1;", env->LValue(buffering_state_id));
|
||||
out_cc->println("}");
|
||||
out_cc->dec_indent();
|
||||
break;
|
||||
|
||||
case BUFFER_BY_LINE:
|
||||
ASSERT(env->GetDataType(buffering_state_id));
|
||||
out_cc->println("if ( %s == 0 )", env->RValue(buffering_state_id));
|
||||
out_cc->inc_indent();
|
||||
out_cc->println("{");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue