LP#1612771: set Perl / C max_chunk_size default sizes
authorBill Erickson <berick@esilibrary.com>
Thu, 27 Feb 2014 20:18:15 +0000 (15:18 -0500)
committerGalen Charlton <gmc@esilibrary.com>
Tue, 1 Nov 2016 21:13:30 +0000 (17:13 -0400)
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 <berick@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

include/opensrf/osrf_app_session.h
src/libopensrf/osrf_application.c
src/perl/lib/OpenSRF/Application.pm

index 9c9efad..d635323 100644 (file)
@@ -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.
index 03eb7a3..b79a778 100644 (file)
 /*@}*/
 
 /**
-       @brief Default size of output buffer.
-*/
-#define OSRF_MSG_BUNDLE_SIZE     10240
-
-/**
        @brief Represent an Application.
 */
 typedef struct {
index 8aec164..9a958e0 100644 (file)
@@ -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 {