Here's a branch that looks at the to-be-escaped partial response string to see how much extra space the chunk will need, base on how many XML-ish characters are present, and scales the chunk size for that message appropriately:
http://git.evergreen-ils.org/?p=working/OpenSRF.git;a=shortlog;h=refs/heads/user/miker/lp-1709710-smarter-chunk-length
Here's a branch that looks at the to-be-escaped partial response string to see how much extra space the chunk will need, base on how many XML-ish characters are present, and scales the chunk size for that message appropriately:
http:// git.evergreen- ils.org/ ?p=working/ OpenSRF. git;a=shortlog; h=refs/ heads/user/ miker/lp- 1709710- smarter- chunk-length