You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by as...@apache.org on 2018/02/08 15:50:30 UTC
qpid-proton git commit: PROTON-1174: Fix channel max decoding
iPROTON-1759: enable and skip failing test
Repository: qpid-proton
Updated Branches:
refs/heads/master ae3eaaa2e -> 1d72bdcb2
PROTON-1174: Fix channel max decoding
iPROTON-1759: enable and skip failing test
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/1d72bdcb
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/1d72bdcb
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/1d72bdcb
Branch: refs/heads/master
Commit: 1d72bdcb26fee5442e0048f7d52e107e200e5ab5
Parents: ae3eaaa
Author: Andrew Stitcher <as...@apache.org>
Authored: Fri Feb 2 14:01:06 2018 -0500
Committer: Andrew Stitcher <as...@apache.org>
Committed: Thu Feb 8 08:48:16 2018 -0500
----------------------------------------------------------------------
proton-c/src/core/engine-internal.h | 2 ++
proton-c/src/core/transport.c | 25 +++++++++++--------------
tests/python/proton_tests/engine.py | 5 ++++-
3 files changed, 17 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/1d72bdcb/proton-c/src/core/engine-internal.h
----------------------------------------------------------------------
diff --git a/proton-c/src/core/engine-internal.h b/proton-c/src/core/engine-internal.h
index ec1603d..a62b811 100644
--- a/proton-c/src/core/engine-internal.h
+++ b/proton-c/src/core/engine-internal.h
@@ -135,6 +135,7 @@ struct pn_transport_t {
pn_data_t *remote_properties;
pn_data_t *disp_data;
//#define PN_DEFAULT_MAX_FRAME_SIZE (16*1024)
+/* This is wrong and bad we should really use a sensible starting size not unlimited */
#define PN_DEFAULT_MAX_FRAME_SIZE (0) /* for now, allow unlimited size */
uint32_t local_max_frame;
uint32_t remote_max_frame;
@@ -175,6 +176,7 @@ struct pn_transport_t {
uint64_t input_frames_ct;
/* output buffered for send */
+ #define PN_TRANSPORT_INITIAL_BUFFER_SIZE (16*1024)
size_t output_size;
size_t output_pending;
char *output_buf;
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/1d72bdcb/proton-c/src/core/transport.c
----------------------------------------------------------------------
diff --git a/proton-c/src/core/transport.c b/proton-c/src/core/transport.c
index 48eddd2..86d0c2a 100644
--- a/proton-c/src/core/transport.c
+++ b/proton-c/src/core/transport.c
@@ -406,9 +406,9 @@ static void pn_transport_initialize(void *object)
pn_transport_t *transport = (pn_transport_t *)object;
transport->freed = false;
transport->output_buf = NULL;
- transport->output_size = PN_DEFAULT_MAX_FRAME_SIZE ? PN_DEFAULT_MAX_FRAME_SIZE : 16 * 1024;
+ transport->output_size = PN_TRANSPORT_INITIAL_BUFFER_SIZE;
transport->input_buf = NULL;
- transport->input_size = PN_DEFAULT_MAX_FRAME_SIZE ? PN_DEFAULT_MAX_FRAME_SIZE : 16 * 1024;
+ transport->input_size = PN_TRANSPORT_INITIAL_BUFFER_SIZE;
transport->tracer = pni_default_tracer;
transport->sasl = NULL;
transport->ssl = NULL;
@@ -442,7 +442,7 @@ static void pn_transport_initialize(void *object)
transport->remote_container = NULL;
transport->remote_hostname = NULL;
transport->local_max_frame = PN_DEFAULT_MAX_FRAME_SIZE;
- transport->remote_max_frame = (uint32_t) 0xffffffff;
+ transport->remote_max_frame = OPEN_MAX_FRAME_SIZE_DEFAULT;
/*
* We set the local limit on channels to 2^15, because
@@ -456,7 +456,7 @@ static void pn_transport_initialize(void *object)
*/
// There is no constraint yet from remote peer,
// so set to max possible.
- transport->remote_channel_max = 65535;
+ transport->remote_channel_max = OPEN_CHANNEL_MAX_DEFAULT;
transport->local_channel_max = PN_IMPL_CHANNEL_MAX;
transport->channel_max = transport->local_channel_max;
@@ -1180,13 +1180,8 @@ int pn_do_open(pn_transport_t *transport, uint8_t frame_type, uint16_t channel,
* find them in the args, so don't give the variable
* directly to the scanner.
*/
- if (remote_channel_max_q) {
- transport->remote_channel_max = remote_channel_max;
- }
-
- if (remote_max_frame_q) {
- transport->remote_max_frame = remote_max_frame;
- }
+ transport->remote_channel_max = remote_channel_max_q ? remote_channel_max : OPEN_CHANNEL_MAX_DEFAULT;
+ transport->remote_max_frame = remote_max_frame_q ? remote_max_frame : OPEN_MAX_FRAME_SIZE_DEFAULT;
if (transport->remote_max_frame > 0) {
if (transport->remote_max_frame < AMQP_MIN_MAX_FRAME_SIZE) {
@@ -1861,9 +1856,11 @@ static int pni_process_conn_setup(pn_transport_t *transport, pn_endpoint_t *endp
int err = pn_post_frame(transport, AMQP_FRAME_TYPE, 0, "DL[SS?I?H?InnCCC]", OPEN,
cid ? cid : "",
pn_string_get(connection->hostname),
- // if not zero, advertise our max frame size and idle timeout
- (bool)transport->local_max_frame, transport->local_max_frame,
- (bool)transport->channel_max, transport->channel_max,
+ // TODO: This is messy, because we also have to allow local_max_frame_ to be 0 to mean unlimited
+ // otherwise flow control goes wrong
+ transport->local_max_frame!=0 && transport->local_max_frame!=OPEN_MAX_FRAME_SIZE_DEFAULT,
+ transport->local_max_frame,
+ transport->channel_max!=OPEN_CHANNEL_MAX_DEFAULT, transport->channel_max,
(bool)idle_timeout, idle_timeout,
connection->offered_capabilities,
connection->desired_capabilities,
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/1d72bdcb/tests/python/proton_tests/engine.py
----------------------------------------------------------------------
diff --git a/tests/python/proton_tests/engine.py b/tests/python/proton_tests/engine.py
index 22b209b..38a3b4d 100644
--- a/tests/python/proton_tests/engine.py
+++ b/tests/python/proton_tests/engine.py
@@ -268,8 +268,9 @@ class ConnectionTest(Test):
assert self.c1.transport.channel_max == upper_limit
+ # TODO: Currently failing test - PROTON-1759 - skip
def test_channel_max_limits_sessions(self):
- return
+ raise Skipped('Test fails - PROTON-1759')
# This is an index -- so max number of channels should be 1.
self.c1.transport.channel_max = 0
self.c1.open()
@@ -280,6 +281,8 @@ class ConnectionTest(Test):
self.pump()
try:
ssn_1 = self.c2.session()
+ ssn_1.open()
+ self.pump()
assert False, "expected session exception"
except SessionException:
pass
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org