Skip to content

Commit bdd0e9b

Browse files
reynirtalex5
authored andcommitted
RExec: Be future compatible
1 parent cac912e commit bdd0e9b

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

lib/rExec.ml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,13 @@ let with_flow ~ty ~domid ~port fn =
215215
Lwt.catch
216216
(fun () ->
217217
recv_hello client >>= function
218-
| version when version <> 2l -> fail (error "Unsupported qrexec version %ld" version)
219-
| _ ->
220-
send_hello client >|= fun () ->
221-
Flow.create ~ty client
218+
| version when version < 2l -> fail (error "Unsupported qrexec version %ld" version)
219+
| version ->
220+
if version > 2l
221+
then Log.debug (fun f -> f "Other end wants to use newer protocol %lu, \
222+
continuing with version 2" version);
223+
send_hello client >|= fun () ->
224+
Flow.create ~ty client
222225
)
223226
(fun ex -> QV.disconnect client >>= fun () -> fail ex)
224227
)

0 commit comments

Comments
 (0)