[OpenSRF-GIT] OpenSRF branch rel_2_5 updated. osrf_rel_2_5_0-15-ge7eee4b

Evergreen Git git at git.evergreen-ils.org
Thu Sep 14 20:33:57 EDT 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "OpenSRF".

The branch, rel_2_5 has been updated
       via  e7eee4bd383797c3cf7f99ec4da1b9bdcf4c94e0 (commit)
      from  6a8a4c696d21598e5198bcefcb753cf9e3b63646 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit e7eee4bd383797c3cf7f99ec4da1b9bdcf4c94e0
Author: Galen Charlton <gmc at equinoxinitiative.org>
Date:   Thu Sep 14 17:36:40 2017 -0400

    LP#1717350: fix chunking messages sent from Perl services
    
    The chunk size adjustments introduced by the patches for bug 1709710
    could result in calculating non-integral chunk sizes for Perl services.
    This in turn led to fractional offsets and lengths being passed to
    Perl's substr() function; rounding in turn can lead to characters
    in the response getting silently dropped, which in turn broke
    parsing the reconstituted response.
    
    To test
    -------
    The problem can be reproduced by invoking
    
      open-ils.storage open-ils.storage.actor.org_unit.descendants.atomic 1, 0
    
    in Evergreen databases with org unit trees large enough that the
    response gets chunked.
    
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
    Signed-off-by: Jason Stephenson <jason at sigio.com>

diff --git a/src/perl/lib/OpenSRF/AppSession.pm b/src/perl/lib/OpenSRF/AppSession.pm
index f7b3edf..b90e52c 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")

-----------------------------------------------------------------------

Summary of changes:
 src/perl/lib/OpenSRF/AppSession.pm |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
OpenSRF


More information about the opensrf-commits mailing list