]> www.infradead.org Git - users/dhowells/kafs-utils.git/commitdiff
rxgen: Reset call->need_size for each bulk element
authorDavid Howells <dhowells@redhat.com>
Sat, 10 May 2014 09:44:10 +0000 (10:44 +0100)
committerDavid Howells <dhowells@redhat.com>
Tue, 13 May 2014 16:36:35 +0000 (17:36 +0100)
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>
rxgen/emit_py_sync_funcs.pm

index dd3c609d6ace7c7ca8f381d61c04f7ca84ee6109..ba2a8a00bae1b005bbabb54ebf20a0b608979d00 100644 (file)
@@ -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 {