Use updated protocol information when parsing consecutive messages. --- src/networks/donkey/donkeyProtoCom.ml | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) e747ad87c868f54f9ce4e70c8d77804d5cbde8f4 diff --git a/src/networks/donkey/donkeyProtoCom.ml b/src/networks/donkey/donkeyProtoCom.ml index fa77551..8da29fa 100644 --- a/src/networks/donkey/donkeyProtoCom.ml +++ b/src/networks/donkey/donkeyProtoCom.ml @@ -119,10 +119,6 @@ let servers_send socks m = List.iter (fun s -> write_string s m) socks let client_handler2 c ff f = - let emule_version = match !c with - None -> emule_proto (); - | Some c -> c.client_emule_proto - in let msgs = ref 0 in fun sock nread -> @@ -130,6 +126,10 @@ let client_handler2 c ff f = let b = TcpBufferedSocket.buf sock in try while b.len >= 5 do + let emule_version = match !c with + None -> emule_proto (); + | Some c -> c.client_emule_proto + in let opcode = get_uint8 b.buf b.pos in let msg_len = get_int b.buf (b.pos+1) in if b.len >= 5 + msg_len then -- 1.0.13