[jira] [Created] (DISPATCH-1704) Policy fails to check vhost hostname length

2020-07-01 Thread Charles E. Rolke (Jira)
Charles E. Rolke created DISPATCH-1704:
--

 Summary: Policy fails to check vhost hostname length
 Key: DISPATCH-1704
 URL: https://issues.apache.org/jira/browse/DISPATCH-1704
 Project: Qpid Dispatch
  Issue Type: Bug
  Components: Policy Engine
Affects Versions: 1.12.0
Reporter: Charles E. Rolke
Assignee: Charles E. Rolke


C code defines host name buffers to allow a 255 character vhost name but python 
code never enforces this limit.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (PROTON-2244) [Proton-c] Encoder error for array of lists where first list in array is empty

2020-07-01 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PROTON-2244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17149551#comment-17149551
 ] 

ASF GitHub Bot commented on PROTON-2244:


astitcher commented on a change in pull request #263:
URL: https://github.com/apache/qpid-proton/pull/263#discussion_r448491607



##
File path: c/src/core/encoder.c
##
@@ -336,8 +336,10 @@ static int pni_encoder_exit(void *ctx, pn_data_t *data, 
pni_node_t *node)
   pn_encoder_t *encoder = (pn_encoder_t *) ctx;
   char *pos;
 
-  // Special case 0 length list
-  if (node->atom.type==PN_LIST && node->children-encoder->null_count==0) {
+  // Special case 0 length list, but not as first element in an array
+  pni_node_t *parent = pn_data_node(data, node->parent);
+  if (node->atom.type==PN_LIST && node->children-encoder->null_count==0 &&
+  !(pn_is_in_array(data, parent, node) && pn_is_first_in_array(data, 
parent, node))) {

Review comment:
   I think this should test for *any* element of an array not just the 
first. This is because the type opcode is the array opcode for every list 
element and so shouldn't be changed for a 0 element list in any place in the 
array.
   





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> [Proton-c] Encoder error for array of lists where first list in array is empty
> --
>
> Key: PROTON-2244
> URL: https://issues.apache.org/jira/browse/PROTON-2244
> Project: Qpid Proton
>  Issue Type: Task
>  Components: proton-c
>Reporter: Kim van der Riet
>Priority: Major
>
> AMQP encodes arrays with a single element constructor which should be 
> identical for all elements in the array. However, if an array of lists is 
> constructed in which the first list is empty, then the AMQP empty list 
> constructor is used in the array, and the following lists which may be 
> non-empty, will not be decoded correctly.
> {noformat}
> >>> import proton
> >>> a = proton.Array(proton.UNDESCRIBED, proton.Data.LIST, [], [1,2,3], 
> >>> ['aaa', 'bbb', 'ccc'])
> >>> d1 = proton.Data()
> >>> d1.put_py_array(a)
> >>> d1.encode().hex()
> 'f0002a000345000a000355015502550300130003a103616161a103626262a103636363'
> {noformat}
> which, when broken down into parts, looks as follows:
> {noformat}
> f0 02a 0003 45 <-- Array constructor, size=0x2a, len=3, type=empty 
> list
> ^^--- Empty list constructor
> 000a 0003 5501 5502 5503 <- data for [1,2,3]
> 0013 0003 a103616161 a103626262 a103636363 <-- data for ['aaa', 
> 'bbb', 'ccc']
> {noformat}
> When decoded, this is being interpreted as an array of empty lists:
> {noformat}
> >>> d2 = proton.Data()
> >>> d2.decode(d1.encode())
> 10
> >>> d2.get_py_array()
> Array(UNDESCRIBED, 24, [], [], [])
> {noformat}
> When a mis-encoded array is used in the body of a message and is decoded, an 
> error results:
> {noformat}
> >>> import proton
> >>> a = proton.Array(proton.UNDESCRIBED, proton.Data.LIST, [], [1,2,3], 
> >>> ['aaa', 'bbb', 'ccc'])
> >>> m1 = proton.Message(body=a)
> >>> m1
> Message(priority=4, body=Array(UNDESCRIBED, 24, [], [1, 2, 3], ['aaa', 'bbb', 
> 'ccc']))
> >>> m2 = proton.Message()
> >>> m2.decode(m1.encode())
> Traceback (most recent call last):
>  File "", line 1, in 
>  File 
> "/home/kvdr/RedHat/install/lib64/proton/bindings/python3/proton/_message.py", 
> line 488, in decode
>  self._check(pn_message_decode(self._msg, data))
>  File 
> "/home/kvdr/RedHat/install/lib64/proton/bindings/python3/proton/_message.py", 
> line 87, in _check
>  raise exc("[%s]: %s" % (err, pn_error_text(pn_message_error(self._msg
> proton._exceptions.MessageException: [-6]: data error: (null)
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[GitHub] [qpid-proton] astitcher commented on a change in pull request #263: PROTON-2244: Fix for Array of lists with first list empty encoding

2020-07-01 Thread GitBox


astitcher commented on a change in pull request #263:
URL: https://github.com/apache/qpid-proton/pull/263#discussion_r448491607



##
File path: c/src/core/encoder.c
##
@@ -336,8 +336,10 @@ static int pni_encoder_exit(void *ctx, pn_data_t *data, 
pni_node_t *node)
   pn_encoder_t *encoder = (pn_encoder_t *) ctx;
   char *pos;
 
-  // Special case 0 length list
-  if (node->atom.type==PN_LIST && node->children-encoder->null_count==0) {
+  // Special case 0 length list, but not as first element in an array
+  pni_node_t *parent = pn_data_node(data, node->parent);
+  if (node->atom.type==PN_LIST && node->children-encoder->null_count==0 &&
+  !(pn_is_in_array(data, parent, node) && pn_is_first_in_array(data, 
parent, node))) {

Review comment:
   I think this should test for *any* element of an array not just the 
first. This is because the type opcode is the array opcode for every list 
element and so shouldn't be changed for a 0 element list in any place in the 
array.
   





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (PROTON-2237) [python] Non-string message property keys not handled correctly

2020-07-01 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PROTON-2237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17149546#comment-17149546
 ] 

ASF GitHub Bot commented on PROTON-2237:


kpvdr commented on a change in pull request #256:
URL: https://github.com/apache/qpid-proton/pull/256#discussion_r448484945



##
File path: python/proton/_message.py
##
@@ -90,13 +90,16 @@ def _check(self, err):
 
 def _check_property_keys(self):
 for k in self.properties.keys():
-if isinstance(k, unicode):
-# py2 unicode, py3 str (via hack definition)
+# Check for string type. (py2: unicode, py3: str via type hack 
above)
+# String subclasses symbol and char are excluded
+# (But so are other string subclasses that would be encoded as 
type string!)
+if type(k) == unicode:

Review comment:
   I did it this way on the understanding that we convert ALL unicode 
subclasses, including symbol and char, and that this would add to an easier 
user experience. Certainly it would be more "technically correct" to exclude 
symbol and char though.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> [python] Non-string message property keys not handled correctly
> ---
>
> Key: PROTON-2237
> URL: https://issues.apache.org/jira/browse/PROTON-2237
> Project: Qpid Proton
>  Issue Type: Bug
>  Components: python-binding
>Reporter: Kim van der Riet
>Priority: Major
>
> The AMQP 1.0 spec allows only string keys for message properties.
> Proton's Python binding has a method (_message.py:91 _check_property_keys()) 
> for checking message property keys, but it does not handle all cases 
> correctly:
>  # Proton types Symbol and Char are derived from string, and are allowed in 
> the test. This results in an illegal encoding.
>  # Because in Python 2, many coders carelessly use string literals without 
> the required u'' prefix (and thus results in a bytes type), bytes types are 
> converted to unicode string types. However, the encode() function is being 
> used, which simply returns a binary type in Python 2 and raises an error in 
> Python 3. This should probably be the decode() method, which returns a string 
> and works for both Python 2 and 3.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[GitHub] [qpid-proton] kpvdr commented on a change in pull request #256: PROTON-2237: Correct checking of Proton message property keys

2020-07-01 Thread GitBox


kpvdr commented on a change in pull request #256:
URL: https://github.com/apache/qpid-proton/pull/256#discussion_r448484945



##
File path: python/proton/_message.py
##
@@ -90,13 +90,16 @@ def _check(self, err):
 
 def _check_property_keys(self):
 for k in self.properties.keys():
-if isinstance(k, unicode):
-# py2 unicode, py3 str (via hack definition)
+# Check for string type. (py2: unicode, py3: str via type hack 
above)
+# String subclasses symbol and char are excluded
+# (But so are other string subclasses that would be encoded as 
type string!)
+if type(k) == unicode:

Review comment:
   I did it this way on the understanding that we convert ALL unicode 
subclasses, including symbol and char, and that this would add to an easier 
user experience. Certainly it would be more "technically correct" to exclude 
symbol and char though.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (PROTON-2237) [python] Non-string message property keys not handled correctly

2020-07-01 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PROTON-2237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17149544#comment-17149544
 ] 

ASF GitHub Bot commented on PROTON-2237:


kpvdr commented on a change in pull request #256:
URL: https://github.com/apache/qpid-proton/pull/256#discussion_r448482190



##
File path: python/proton/_message.py
##
@@ -90,10 +90,12 @@ def _check(self, err):
 
 def _check_property_keys(self):
 for k in self.properties.keys():
-# Check for string type. (py2: unicode, py3: str via type hack 
above)
-# String subclasses symbol and char are excluded
-# (But so are other string subclasses that would be encoded as 
type string!)
-if type(k) == unicode:
+# Check for string types. (py2: unicode, py3: str via type hack 
above)
+# or string subclasses
+if isinstance(k, unicode):
+# Convert string subclasses (including proton char and symbol 
types) to string
+if not type(k) == unicode:

Review comment:
   Agreed.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> [python] Non-string message property keys not handled correctly
> ---
>
> Key: PROTON-2237
> URL: https://issues.apache.org/jira/browse/PROTON-2237
> Project: Qpid Proton
>  Issue Type: Bug
>  Components: python-binding
>Reporter: Kim van der Riet
>Priority: Major
>
> The AMQP 1.0 spec allows only string keys for message properties.
> Proton's Python binding has a method (_message.py:91 _check_property_keys()) 
> for checking message property keys, but it does not handle all cases 
> correctly:
>  # Proton types Symbol and Char are derived from string, and are allowed in 
> the test. This results in an illegal encoding.
>  # Because in Python 2, many coders carelessly use string literals without 
> the required u'' prefix (and thus results in a bytes type), bytes types are 
> converted to unicode string types. However, the encode() function is being 
> used, which simply returns a binary type in Python 2 and raises an error in 
> Python 3. This should probably be the decode() method, which returns a string 
> and works for both Python 2 and 3.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[GitHub] [qpid-proton] kpvdr commented on a change in pull request #256: PROTON-2237: Correct checking of Proton message property keys

2020-07-01 Thread GitBox


kpvdr commented on a change in pull request #256:
URL: https://github.com/apache/qpid-proton/pull/256#discussion_r448482190



##
File path: python/proton/_message.py
##
@@ -90,10 +90,12 @@ def _check(self, err):
 
 def _check_property_keys(self):
 for k in self.properties.keys():
-# Check for string type. (py2: unicode, py3: str via type hack 
above)
-# String subclasses symbol and char are excluded
-# (But so are other string subclasses that would be encoded as 
type string!)
-if type(k) == unicode:
+# Check for string types. (py2: unicode, py3: str via type hack 
above)
+# or string subclasses
+if isinstance(k, unicode):
+# Convert string subclasses (including proton char and symbol 
types) to string
+if not type(k) == unicode:

Review comment:
   Agreed.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[GitHub] [qpid-proton] kpvdr commented on a change in pull request #256: PROTON-2237: Correct checking of Proton message property keys

2020-07-01 Thread GitBox


kpvdr commented on a change in pull request #256:
URL: https://github.com/apache/qpid-proton/pull/256#discussion_r448481904



##
File path: python/proton/_message.py
##
@@ -90,10 +90,12 @@ def _check(self, err):
 
 def _check_property_keys(self):
 for k in self.properties.keys():
-# Check for string type. (py2: unicode, py3: str via type hack 
above)
-# String subclasses symbol and char are excluded
-# (But so are other string subclasses that would be encoded as 
type string!)
-if type(k) == unicode:
+# Check for string types. (py2: unicode, py3: str via type hack 
above)
+# or string subclasses
+if isinstance(k, unicode):
+# Convert string subclasses (including proton char and symbol 
types) to string

Review comment:
   It is not logically identical.
   We want the continue to be reached for all unicode. However, only for 
subclasses of unicode, we make the conversion.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (PROTON-2237) [python] Non-string message property keys not handled correctly

2020-07-01 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PROTON-2237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17149543#comment-17149543
 ] 

ASF GitHub Bot commented on PROTON-2237:


kpvdr commented on a change in pull request #256:
URL: https://github.com/apache/qpid-proton/pull/256#discussion_r448481904



##
File path: python/proton/_message.py
##
@@ -90,10 +90,12 @@ def _check(self, err):
 
 def _check_property_keys(self):
 for k in self.properties.keys():
-# Check for string type. (py2: unicode, py3: str via type hack 
above)
-# String subclasses symbol and char are excluded
-# (But so are other string subclasses that would be encoded as 
type string!)
-if type(k) == unicode:
+# Check for string types. (py2: unicode, py3: str via type hack 
above)
+# or string subclasses
+if isinstance(k, unicode):
+# Convert string subclasses (including proton char and symbol 
types) to string

Review comment:
   It is not logically identical.
   We want the continue to be reached for all unicode. However, only for 
subclasses of unicode, we make the conversion.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> [python] Non-string message property keys not handled correctly
> ---
>
> Key: PROTON-2237
> URL: https://issues.apache.org/jira/browse/PROTON-2237
> Project: Qpid Proton
>  Issue Type: Bug
>  Components: python-binding
>Reporter: Kim van der Riet
>Priority: Major
>
> The AMQP 1.0 spec allows only string keys for message properties.
> Proton's Python binding has a method (_message.py:91 _check_property_keys()) 
> for checking message property keys, but it does not handle all cases 
> correctly:
>  # Proton types Symbol and Char are derived from string, and are allowed in 
> the test. This results in an illegal encoding.
>  # Because in Python 2, many coders carelessly use string literals without 
> the required u'' prefix (and thus results in a bytes type), bytes types are 
> converted to unicode string types. However, the encode() function is being 
> used, which simply returns a binary type in Python 2 and raises an error in 
> Python 3. This should probably be the decode() method, which returns a string 
> and works for both Python 2 and 3.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[GitHub] [qpid-proton] kpvdr opened a new pull request #263: PROTON-2244: Fix for Array of lists with first list empty encoding

2020-07-01 Thread GitBox


kpvdr opened a new pull request #263:
URL: https://github.com/apache/qpid-proton/pull/263


   All tests pass.
   It appears necessary to test for both pn_is_in_array() && 
pn_is_first_in_array(), using only the latter causes failures in the list tests.



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (PROTON-2244) [Proton-c] Encoder error for array of lists where first list in array is empty

2020-07-01 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PROTON-2244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17149539#comment-17149539
 ] 

ASF GitHub Bot commented on PROTON-2244:


kpvdr opened a new pull request #263:
URL: https://github.com/apache/qpid-proton/pull/263


   All tests pass.
   It appears necessary to test for both pn_is_in_array() && 
pn_is_first_in_array(), using only the latter causes failures in the list tests.



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> [Proton-c] Encoder error for array of lists where first list in array is empty
> --
>
> Key: PROTON-2244
> URL: https://issues.apache.org/jira/browse/PROTON-2244
> Project: Qpid Proton
>  Issue Type: Task
>  Components: proton-c
>Reporter: Kim van der Riet
>Priority: Major
>
> AMQP encodes arrays with a single element constructor which should be 
> identical for all elements in the array. However, if an array of lists is 
> constructed in which the first list is empty, then the AMQP empty list 
> constructor is used in the array, and the following lists which may be 
> non-empty, will not be decoded correctly.
> {noformat}
> >>> import proton
> >>> a = proton.Array(proton.UNDESCRIBED, proton.Data.LIST, [], [1,2,3], 
> >>> ['aaa', 'bbb', 'ccc'])
> >>> d1 = proton.Data()
> >>> d1.put_py_array(a)
> >>> d1.encode().hex()
> 'f0002a000345000a000355015502550300130003a103616161a103626262a103636363'
> {noformat}
> which, when broken down into parts, looks as follows:
> {noformat}
> f0 02a 0003 45 <-- Array constructor, size=0x2a, len=3, type=empty 
> list
> ^^--- Empty list constructor
> 000a 0003 5501 5502 5503 <- data for [1,2,3]
> 0013 0003 a103616161 a103626262 a103636363 <-- data for ['aaa', 
> 'bbb', 'ccc']
> {noformat}
> When decoded, this is being interpreted as an array of empty lists:
> {noformat}
> >>> d2 = proton.Data()
> >>> d2.decode(d1.encode())
> 10
> >>> d2.get_py_array()
> Array(UNDESCRIBED, 24, [], [], [])
> {noformat}
> When a mis-encoded array is used in the body of a message and is decoded, an 
> error results:
> {noformat}
> >>> import proton
> >>> a = proton.Array(proton.UNDESCRIBED, proton.Data.LIST, [], [1,2,3], 
> >>> ['aaa', 'bbb', 'ccc'])
> >>> m1 = proton.Message(body=a)
> >>> m1
> Message(priority=4, body=Array(UNDESCRIBED, 24, [], [1, 2, 3], ['aaa', 'bbb', 
> 'ccc']))
> >>> m2 = proton.Message()
> >>> m2.decode(m1.encode())
> Traceback (most recent call last):
>  File "", line 1, in 
>  File 
> "/home/kvdr/RedHat/install/lib64/proton/bindings/python3/proton/_message.py", 
> line 488, in decode
>  self._check(pn_message_decode(self._msg, data))
>  File 
> "/home/kvdr/RedHat/install/lib64/proton/bindings/python3/proton/_message.py", 
> line 87, in _check
>  raise exc("[%s]: %s" % (err, pn_error_text(pn_message_error(self._msg
> proton._exceptions.MessageException: [-6]: data error: (null)
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (PROTON-2244) [Proton-c] Encoder error for array of lists where first list in array is empty

2020-07-01 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/PROTON-2244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17149537#comment-17149537
 ] 

ASF subversion and git services commented on PROTON-2244:
-

Commit a19cace4db2c9ab8beceae00328620aee22ff168 in qpid-proton's branch 
refs/heads/array-of-lists-first-list-empty from Kim van der Riet
[ https://gitbox.apache.org/repos/asf?p=qpid-proton.git;h=a19cace ]

PROTON-2244: Fix for Array of lists with first list empty encoding


> [Proton-c] Encoder error for array of lists where first list in array is empty
> --
>
> Key: PROTON-2244
> URL: https://issues.apache.org/jira/browse/PROTON-2244
> Project: Qpid Proton
>  Issue Type: Task
>  Components: proton-c
>Reporter: Kim van der Riet
>Priority: Major
>
> AMQP encodes arrays with a single element constructor which should be 
> identical for all elements in the array. However, if an array of lists is 
> constructed in which the first list is empty, then the AMQP empty list 
> constructor is used in the array, and the following lists which may be 
> non-empty, will not be decoded correctly.
> {noformat}
> >>> import proton
> >>> a = proton.Array(proton.UNDESCRIBED, proton.Data.LIST, [], [1,2,3], 
> >>> ['aaa', 'bbb', 'ccc'])
> >>> d1 = proton.Data()
> >>> d1.put_py_array(a)
> >>> d1.encode().hex()
> 'f0002a000345000a000355015502550300130003a103616161a103626262a103636363'
> {noformat}
> which, when broken down into parts, looks as follows:
> {noformat}
> f0 02a 0003 45 <-- Array constructor, size=0x2a, len=3, type=empty 
> list
> ^^--- Empty list constructor
> 000a 0003 5501 5502 5503 <- data for [1,2,3]
> 0013 0003 a103616161 a103626262 a103636363 <-- data for ['aaa', 
> 'bbb', 'ccc']
> {noformat}
> When decoded, this is being interpreted as an array of empty lists:
> {noformat}
> >>> d2 = proton.Data()
> >>> d2.decode(d1.encode())
> 10
> >>> d2.get_py_array()
> Array(UNDESCRIBED, 24, [], [], [])
> {noformat}
> When a mis-encoded array is used in the body of a message and is decoded, an 
> error results:
> {noformat}
> >>> import proton
> >>> a = proton.Array(proton.UNDESCRIBED, proton.Data.LIST, [], [1,2,3], 
> >>> ['aaa', 'bbb', 'ccc'])
> >>> m1 = proton.Message(body=a)
> >>> m1
> Message(priority=4, body=Array(UNDESCRIBED, 24, [], [1, 2, 3], ['aaa', 'bbb', 
> 'ccc']))
> >>> m2 = proton.Message()
> >>> m2.decode(m1.encode())
> Traceback (most recent call last):
>  File "", line 1, in 
>  File 
> "/home/kvdr/RedHat/install/lib64/proton/bindings/python3/proton/_message.py", 
> line 488, in decode
>  self._check(pn_message_decode(self._msg, data))
>  File 
> "/home/kvdr/RedHat/install/lib64/proton/bindings/python3/proton/_message.py", 
> line 87, in _check
>  raise exc("[%s]: %s" % (err, pn_error_text(pn_message_error(self._msg
> proton._exceptions.MessageException: [-6]: data error: (null)
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Created] (PROTON-2244) [Proton-c] Encoder error for array of lists where first list in array is empty

2020-07-01 Thread Kim van der Riet (Jira)
Kim van der Riet created PROTON-2244:


 Summary: [Proton-c] Encoder error for array of lists where first 
list in array is empty
 Key: PROTON-2244
 URL: https://issues.apache.org/jira/browse/PROTON-2244
 Project: Qpid Proton
  Issue Type: Task
  Components: proton-c
Reporter: Kim van der Riet


AMQP encodes arrays with a single element constructor which should be identical 
for all elements in the array. However, if an array of lists is constructed in 
which the first list is empty, then the AMQP empty list constructor is used in 
the array, and the following lists which may be non-empty, will not be decoded 
correctly.
{noformat}
>>> import proton
>>> a = proton.Array(proton.UNDESCRIBED, proton.Data.LIST, [], [1,2,3], ['aaa', 
>>> 'bbb', 'ccc'])
>>> d1 = proton.Data()
>>> d1.put_py_array(a)
>>> d1.encode().hex()
'f0002a000345000a000355015502550300130003a103616161a103626262a103636363'
{noformat}
which, when broken down into parts, looks as follows:
{noformat}
f0 02a 0003 45 <-- Array constructor, size=0x2a, len=3, type=empty list
^^--- Empty list constructor
000a 0003 5501 5502 5503 <- data for [1,2,3]
0013 0003 a103616161 a103626262 a103636363 <-- data for ['aaa', 'bbb', 
'ccc']
{noformat}
When decoded, this is being interpreted as an array of empty lists:
{noformat}
>>> d2 = proton.Data()
>>> d2.decode(d1.encode())
10
>>> d2.get_py_array()
Array(UNDESCRIBED, 24, [], [], [])
{noformat}
When a mis-encoded array is used in the body of a message and is decoded, an 
error results:
{noformat}
>>> import proton
>>> a = proton.Array(proton.UNDESCRIBED, proton.Data.LIST, [], [1,2,3], ['aaa', 
>>> 'bbb', 'ccc'])
>>> m1 = proton.Message(body=a)
>>> m1
Message(priority=4, body=Array(UNDESCRIBED, 24, [], [1, 2, 3], ['aaa', 'bbb', 
'ccc']))
>>> m2 = proton.Message()
>>> m2.decode(m1.encode())
Traceback (most recent call last):
 File "", line 1, in 
 File 
"/home/kvdr/RedHat/install/lib64/proton/bindings/python3/proton/_message.py", 
line 488, in decode
 self._check(pn_message_decode(self._msg, data))
 File 
"/home/kvdr/RedHat/install/lib64/proton/bindings/python3/proton/_message.py", 
line 87, in _check
 raise exc("[%s]: %s" % (err, pn_error_text(pn_message_error(self._msg
proton._exceptions.MessageException: [-6]: data error: (null)
{noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[GitHub] [qpid-dispatch] ctron opened a new pull request #771: Add a short note about the multi-tenancy flag

2020-07-01 Thread GitBox


ctron opened a new pull request #771:
URL: https://github.com/apache/qpid-dispatch/pull/771


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org