From: David Howells <dhowells@redhat.com> Date: Sat, 10 May 2014 09:44:10 +0000 (+0100) Subject: rxgen: Reset call->need_size for each bulk element X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=405a5e47d00e52cc25af7593991624bde70db644;p=users%2Fdhowells%2Fkafs-utils.git rxgen: Reset call->need_size for each bulk element We need to reset call->need_size each time the decode phase for a bulk item repeats as the value is now whittled down by rxrpc_post_dec(). Signed-off-by: David Howells <dhowells@redhat.com> --- diff --git a/rxgen/emit_py_sync_funcs.pm b/rxgen/emit_py_sync_funcs.pm index dd3c609..ba2a8a0 100644 --- a/rxgen/emit_py_sync_funcs.pm +++ b/rxgen/emit_py_sync_funcs.pm @@ -641,9 +641,7 @@ sub emit_py_func_decode($$$$) } # Entry point for a phase - if ($phase->{type} ne "split") { - print PYOUT "\t\tcall->need_size = ", $phase->{size}, ";\n"; - } else { + if ($phase->{type} eq "split") { print PYOUT "\t\tif (py_rxgen_split_receive(call, 1) < 0)\n"; print PYOUT "\t\t\treturn -1;\n"; print PYOUT "\t\tif (call->need_size == 0)\n"; @@ -654,6 +652,7 @@ sub emit_py_func_decode($$$$) print PYOUT "\tcase ", $phix, ":\n"; if ($phase->{type} ne "split") { + print PYOUT "\t\tcall->need_size = ", $phase->{size}, ";\n"; print PYOUT "\t\tif (count < call->need_size)\n"; print PYOUT "\t\t\treturn 1;\n"; } else {