[Vala] LibSoup set_response with binary data?
- From: Joseph Montanez <jmontanez gorilla3d com>
- To: vala-list <vala-list gnome org>
- Subject: [Vala] LibSoup set_response with binary data?
- Date: Wed, 13 Apr 2011 08:56:15 -0700
I am having issues send binary data via libsoup server. When I read
the file, it has the correct byte length, but its getting cut off when
I send it through libsoup. I tried escaping the string as well as
flatten () on the message body, mainly setting the message body, but
it results in the same output.
Gist: https://gist.github.com/917810
var file = File.new_for_path ("." + path);
size_t length;
string etag;
var loaded = file.load_contents (null, out response_text, out length, out etag);
var msgbody = new Soup.MessageBody ();
msgbody.append(Soup.MemoryUse.TEMPORARY, response_text.data);
msg.response_body = msgbody;
unowned Soup.MessageHeaders headers = msg.response_headers;
headers.set_content_length (length);
--
Joseph Montanez
Web Developer
Gorilla3D
Design, Develop, Deploy
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]