Issue with PyAMF client and gateway strict mode

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Issue with PyAMF client and gateway strict mode

David Wolever-4
Hey,
Someone using django-amf-gateway has pointed out a problem which comes  
up when 'strict' is enabled on the gateway and the Python client is  
used.

To recreate:
- Start a gateway running in 'strict' mode (for example, the echo  
service in examples/echo/python/)
- Make a request from a Python client (for example, the echo client in  
the same directory)

The client will report 'bad request', and if you take a packet dump,  
you'll see that the server sends this back:

400 Bad Request

The request body was unable to be successfully decoded.

Traceback:

Traceback (most recent call last):
  File "/Library/Python/2.5/site-packages/PyAMF-0.5.1dev-py2.5-
macosx-10.5-i386.egg/pyamf/remoting/gateway/django.py", line 106, in  
__call__
    timezone_offset=timezone_offset)
  File "/Library/Python/2.5/site-packages/PyAMF-0.5.1dev-py2.5-
macosx-10.5-i386.egg/pyamf/remoting/__init__.py", line 663, in decode
  File "/Library/Python/2.5/site-packages/PyAMF-0.5.1dev-py2.5-
macosx-10.5-i386.egg/pyamf/remoting/__init__.py", line 481, in  
_read_body
DecodeError: Data read from stream does not match body length (25 != 37)

David
_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Issue with PyAMF client and gateway strict mode

Nick Joyce
On 4 Dec 2009, at 04:22, David Wolever wrote:

> Hey,
> Someone using django-amf-gateway has pointed out a problem which comes up when 'strict' is enabled on the gateway and the Python client is used.
>
> To recreate:
> - Start a gateway running in 'strict' mode (for example, the echo service in examples/echo/python/)
> - Make a request from a Python client (for example, the echo client in the same directory)
>
> The client will report 'bad request', and if you take a packet dump, you'll see that the server sends this back:
>
> 400 Bad Request
>
> The request body was unable to be successfully decoded.
>
> Traceback:
>
> Traceback (most recent call last):
> File "/Library/Python/2.5/site-packages/PyAMF-0.5.1dev-py2.5-macosx-10.5-i386.egg/pyamf/remoting/gateway/django.py", line 106, in __call__
>   timezone_offset=timezone_offset)
> File "/Library/Python/2.5/site-packages/PyAMF-0.5.1dev-py2.5-macosx-10.5-i386.egg/pyamf/remoting/__init__.py", line 663, in decode
> File "/Library/Python/2.5/site-packages/PyAMF-0.5.1dev-py2.5-macosx-10.5-i386.egg/pyamf/remoting/__init__.py", line 481, in _read_body
> DecodeError: Data read from stream does not match body length (25 != 37)
>
> David
> _______________________________________________
> PyAMF users mailing list - [hidden email]
> http://lists.pyamf.org/mailman/listinfo/users


AMF remoting packet headers have a body length which in strict mode PyAMF will ensure that it has read that amount - most AMF implementations ignore this length and just put in some default value (which one of the reason for 'strict' in the first place).

Does decoding the remoting packet work where strict = False?

Can you supply the packet dump? I would like to investigate this further.

Cheers,

Nick
_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users