Pasted as Plain Text
Description: No description
URL: http://lumen.esilibrary.com/p/9kev0U29.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/src/perl/lib/OpenSRF/AppSession.pm b/src/perl/lib/OpenSRF/AppSession.pm
index f7b3edf..5816286 100644
--- a/src/perl/lib/OpenSRF/AppSession.pm
+++ b/src/perl/lib/OpenSRF/AppSession.pm
@@ -13,6 +13,7 @@ use Exporter;
 use Encode;
 use base qw/Exporter OpenSRF/;
 use Time::HiRes qw( time usleep );
+use POSIX;
 use warnings;
 use strict;
 
@@ -1067,7 +1068,7 @@ sub respond {
             my $chunk_size = $self->max_chunk_size;
 
             if ($escaped_length > $self->max_chunk_size) {
-                $chunk_size = ($raw_length / $escaped_length) * $self->max_chunk_size;
+                $chunk_size = POSIX::floor(($raw_length / $escaped_length) * $self->max_chunk_size);
             }
 
             if ($raw_length > $chunk_size) { # send partials ("chunking")