Re: Data in the response_body using the GIR bindings from Python



Am 26. März 2012 18:01 schrieb Dan Winship <danw gnome org>:
>> I was under the impression
>> that after a successful request, the full message body is contained in
>> message.request_body.data.
>
> That's correct, unless you did message.request_body.set_accumulate(False).
No, I only create the message and send it (see
http://paste.ubuntu.com/876804/ ) -- I tried explicitly setting
set_accumulate(True) but that does not make any difference. About my
problem that the buffer object returned by the flatten() function
leads to segmentation faults: I found a comment in the documentation
about the get_data() function having been added for language bindings
and indeed using buffer.get_data() instead of buffer.data works. This
means I now have a working solution, even though it is slightly more
complicated than it should be (as you confirmed). However, I just
found out I need another workaround to avoid crashes: When my code
calls message.response_headers.get_content_type() I get another
segmentation fault -- I'm now using
message.response_headers.get_one('content-type').split(';')[0]
instead...

> I'd ask the pygobject people... they may know more about these issues,
> or if there are any unimplemented things in their gobject-introspection
> support that might cause this.
Ok, I'll do that.

Cheers
  Marcel


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]