After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 676776 - soup-message-body: Add a soup_buffer_get_as_bytes method
soup-message-body: Add a soup_buffer_get_as_bytes method
Status: RESOLVED FIXED
Product: libsoup
Classification: Core
Component: Misc
unspecified
Other All
: Normal normal
: ---
Assigned To: libsoup-maint@gnome.bugs
libsoup-maint@gnome.bugs
Depends on:
Blocks:
 
 
Reported: 2012-05-24 20:43 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2012-05-24 21:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
soup-message-body: Add a soup_buffer_get_as_bytes method (2.01 KB, patch)
2012-05-24 20:44 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
soup-message-body: Add a soup_buffer_get_as_bytes method (2.10 KB, patch)
2012-05-24 21:34 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review

Description Jasper St. Pierre (not reading bugmail) 2012-05-24 20:43:58 UTC
See patch. This is meant to be used with the new gio methods that act on
streams, and also greatly helps the introspection situation.
Comment 1 Jasper St. Pierre (not reading bugmail) 2012-05-24 20:44:00 UTC
Created attachment 214894 [details] [review]
soup-message-body: Add a soup_buffer_get_as_bytes method

This new method will return a GBytes instance containing the
contents of the SoupBuffer.
Comment 2 Colin Walters 2012-05-24 21:29:20 UTC
Review of attachment 214894 [details] [review]:

::: libsoup/soup-message-body.c
@@ +313,3 @@
+ * @buffer: a #SoupBuffer
+ *
+ * Returns: (transfer full) a new #GBytes which has the same content

Missing second :
Comment 3 Jasper St. Pierre (not reading bugmail) 2012-05-24 21:34:26 UTC
Created attachment 214903 [details] [review]
soup-message-body: Add a soup_buffer_get_as_bytes method

This new method will return a GBytes instance containing the
contents of the SoupBuffer.



Prevent a copy.
Comment 4 Dan Winship 2012-05-24 21:40:03 UTC
Comment on attachment 214903 [details] [review]
soup-message-body: Add a soup_buffer_get_as_bytes method

just two nitpicks:

>+ * Returns: (transfer full): a new #GBytes which has the same content
>+ * as the #SoupBuffer.

Since: 2.40

>+	SoupBuffer *copy;
>+	copy = soup_buffer_copy (buffer);

put a blank line between declarations and statements
Comment 5 Jasper St. Pierre (not reading bugmail) 2012-05-24 21:52:37 UTC
Attachment 214903 [details] pushed as 4ed116e - soup-message-body: Add a soup_buffer_get_as_bytes method