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 7cc1135 commit dedcc68d32c25646715ef4062fd549d50689aa0e @johnelse johnelse committed Jun 20, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 http-svr/xmlrpc_client.ml
@@ -293,8 +293,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 dedcc68

Please sign in to comment.