Permalink
Browse files

CA-79715: Allow API XMLRPC client to handle responses larger than 16MB.

This is very similar to CA-75708, which was the same fix for the
database RPC client. Maybe in the long run we should look at whether
the two can share more code than they do at present.

Signed-off-by: John Else <john.else@citrix.com>
  • Loading branch information...
1 parent ef96be1 commit c644677b966aa9723f10deae87d892ac9cd9606e @johnelse committed Jul 13, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 ocaml/idl/ocaml_backend/xmlrpcclient.ml
@@ -270,8 +270,9 @@ module Protocol = functor(F: FORMAT) -> struct
let read_response r s =
try
match r.Http.Response.content_length with
- | Some l -> F.response_of_string (Unixext.really_read_string s (Int64.to_int l))
- | None -> F.response_of_file_descr s
+ | Some l when (Int64.to_int l) <= Sys.max_string_length ->
+ F.response_of_string (Unixext.really_read_string s (Int64.to_int l))
+ | Some _ | None -> F.response_of_file_descr s
with
| Unix.Unix_error(Unix.ECONNRESET, _, _) -> raise Connection_reset

0 comments on commit c644677

Please sign in to comment.