From 18be4a4cf242a274cf5a3143c2063d75331ec7c0 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 27 Feb 2014 15:18:15 -0500 Subject: [PATCH] LP#1612771: set Perl / C max_chunk_size default sizes default max bundle size == 25K default max chunk size == 50K Note with Ejabberd using 65536 as the default max stanza size, these new OpenSRF defaults mean that all messages will fit the default message size constraints -- i.e. no more need to raise the max_stanza_size. Signed-off-by: Bill Erickson Signed-off-by: Galen Charlton --- include/opensrf/osrf_app_session.h | 7 ++++++- src/libopensrf/osrf_application.c | 5 ----- src/perl/lib/OpenSRF/Application.pm | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/opensrf/osrf_app_session.h b/include/opensrf/osrf_app_session.h index 9c9efad..d635323 100644 --- a/include/opensrf/osrf_app_session.h +++ b/include/opensrf/osrf_app_session.h @@ -34,7 +34,12 @@ struct osrf_app_request_struct; typedef struct osrf_app_request_struct osrfAppRequest; #define OSRF_REQUEST_HASH_SIZE 64 -#define OSRF_MSG_CHUNK_SIZE 104858 /* 0.1 MB */ + +/** + @brief Default size of output buffer. +*/ +#define OSRF_MSG_BUNDLE_SIZE 25600 /* 25K */ +#define OSRF_MSG_CHUNK_SIZE (OSRF_MSG_BUNDLE_SIZE * 2) /** @brief Representation of a session with another application. diff --git a/src/libopensrf/osrf_application.c b/src/libopensrf/osrf_application.c index 03eb7a3..b79a778 100644 --- a/src/libopensrf/osrf_application.c +++ b/src/libopensrf/osrf_application.c @@ -87,11 +87,6 @@ /*@}*/ /** - @brief Default size of output buffer. -*/ -#define OSRF_MSG_BUNDLE_SIZE 10240 - -/** @brief Represent an Application. */ typedef struct { diff --git a/src/perl/lib/OpenSRF/Application.pm b/src/perl/lib/OpenSRF/Application.pm index 8aec164..9a958e0 100644 --- a/src/perl/lib/OpenSRF/Application.pm +++ b/src/perl/lib/OpenSRF/Application.pm @@ -52,7 +52,7 @@ sub max_bundle_size { my $self = shift; return 0 unless ref($self); return $self->{max_bundle_size} if (defined($self->{max_bundle_size})); - return 10240; + return 25600; # 25K } sub max_bundle_count { @@ -65,7 +65,7 @@ sub max_chunk_size { my $self = shift; return 0 unless ref($self); return $self->{max_chunk_size} if (defined($self->{max_chunk_size})); - return 104858; # 1/10 MB + return $self->max_bundle_size * 2; } sub api_name { -- 2.11.0