[libsoup] soup_message_headers_get_content_length: recheck encoding
- From: Carlos Garcia Campos <carlosgc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsoup] soup_message_headers_get_content_length: recheck encoding
- Date: Mon, 16 Jul 2012 17:07:43 +0000 (UTC)
commit 511291dbe3fb2ecb7bc106678e073c85169bc3d0
Author: Dan Winship <danw gnome org>
Date: Mon Jul 16 12:58:40 2012 -0400
soup_message_headers_get_content_length: recheck encoding
Use soup_message_headers_get_encoding() rather than looking at
hdrs->encoding directly, so that it gets recomputed if it's stale (eg,
from another header having been removed).
https://bugzilla.gnome.org/show_bug.cgi?id=680029
libsoup/soup-message-headers.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/libsoup/soup-message-headers.c b/libsoup/soup-message-headers.c
index 6e396d1..b9bab23 100644
--- a/libsoup/soup-message-headers.c
+++ b/libsoup/soup-message-headers.c
@@ -724,8 +724,13 @@ soup_message_headers_set_encoding (SoupMessageHeaders *hdrs,
goffset
soup_message_headers_get_content_length (SoupMessageHeaders *hdrs)
{
- return (hdrs->encoding == SOUP_ENCODING_CONTENT_LENGTH) ?
- hdrs->content_length : 0;
+ SoupEncoding encoding;
+
+ encoding = soup_message_headers_get_encoding (hdrs);
+ if (encoding == SOUP_ENCODING_CONTENT_LENGTH)
+ return hdrs->content_length;
+ else
+ return 0;
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]