1717
1818(* * Used to ensure that we actually are talking to a thin CLI server *)
1919let major = 0
20- let minor = 1
20+ let minor = 2
2121
2222(* * A prefix string which should be unique, used to detect that we're talking to
2323 a totally different kind of server (eg a standard HTTP server) *)
@@ -42,9 +42,10 @@ type command =
4242 If the command was "Load" or "Prompt" then the client sends a list
4343 of data chunks. *)
4444type response =
45- | OK
46- | Failed
47-
45+ | OK
46+ | Wait
47+ | Failed
48+
4849(* * When streaming binary data, send in chunks with a known length and a
4950 special End marker at the end. *)
5051type blob_header =
@@ -72,8 +73,9 @@ let string_of_command = function
7273 | PrintStderr x -> " PrintStderr " ^ x
7374
7475let string_of_response = function
75- | OK -> " OK"
76- | Failed -> " Failed"
76+ | OK -> " OK"
77+ | Wait -> " Wait"
78+ | Failed -> " Failed"
7779
7880let string_of_blob_header = function
7981 | Chunk x -> " Chunk " ^ (Int32. to_string x)
@@ -182,12 +184,14 @@ let unmarshal_command pos =
182184 | n -> raise (Unknown_tag (" command" , n))
183185
184186let marshal_response = function
185- | OK -> marshal_int 5
187+ | OK -> marshal_int 5
188+ | Wait -> marshal_int 18
186189 | Failed -> marshal_int 6
187190
188191let unmarshal_response pos =
189192 let tag, pos = unmarshal_int pos in match tag with
190- | 5 -> OK , pos
193+ | 5 -> OK , pos
194+ | 18 -> Wait , pos
191195 | 6 -> Failed , pos
192196 | n -> raise (Unknown_tag (" response" , n))
193197
@@ -287,6 +291,7 @@ let examples =
287291 Command (Exit 5 );
288292 Response OK ;
289293 Response Failed ;
294+ Response Wait ;
290295 Blob (Chunk 1024l );
291296 Blob (Chunk 10240l );
292297 Blob (Chunk 102400l );
0 commit comments