Uploaded image for project: 'AMQ Clients'
  1. AMQ Clients
  2. ENTMQCL-455

[python] Enforce max frame size

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • None
    • amqp-python-client
    • None

      Although the setting of max-frame-size is currently not possible with the python reactive API (ENTMQCL-454), there is _set_max_frame_size(size) method available on the Transport object. I tried to play with the values a bit using following code:

        def on_session_init(self, event):
           event.transport._set_max_frame_size(VALUE)
           print (event.transport.max_frame_size)
      

      Following maximum frame size values are set on the transport wrt to given value (are being printed out by the print call above):

      • default: 0
      • 0: 0
      • 1-512: 512
      • 512-*: according to the value given mod 2^32 (if not less than 512)
        • 0 if the result after modulo is 0 /ie.: 2^32, 2^62../
        • 512 if the result after modulo is in range 1-512

      From the results observed it looks that there is no checking of the value and the value wraps around the fixed width int used in the under underlying c code. I believe there should be a check and it should raise an error if a value larger than 2^32 is set (or indeed smaller than 512 bytes).

      Note: This is not a good use case as setting the max-frame-size in on_session_init is really too late. Anyway, I believe the check of the value should be present

            jross@redhat.com Justin Ross
            pematous Petr Matousek
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: