diff options
| author | Dan Winship <danw@gnome.org> | 2012-07-16 12:58:40 -0400 |
|---|---|---|
| committer | Carlos Garcia Campos <carlosgc@gnome.org> | 2012-07-16 19:07:28 +0200 |
| commit | 511291dbe3fb2ecb7bc106678e073c85169bc3d0 (patch) | |
| tree | 59165551657d909223c7fec7408d3d2ebb3d2032 /libsoup/soup-message-headers.c | |
| parent | 19a0f9a0f018b13028c9c860342ce62c4d83d1b6 (diff) | |
| download | libsoup-511291dbe3fb2ecb7bc106678e073c85169bc3d0.tar.gz | |
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
Diffstat (limited to 'libsoup/soup-message-headers.c')
| -rw-r--r-- | 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 6e396d18..b9bab238 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; } /** |
