mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
http encoding: Moved the accept_encoding_header to the http.c.
This commit is contained in:
parent
8bb0f20471
commit
d8a062cffc
@ -344,30 +344,3 @@ read_encoded_file(struct string *filename, struct string *page)
|
||||
close(fd);
|
||||
return state;
|
||||
}
|
||||
|
||||
void
|
||||
accept_encoding_header(struct string *header)
|
||||
{
|
||||
#if defined(CONFIG_GZIP) || defined(CONFIG_BZIP2) || defined(CONFIG_LZMA)
|
||||
int comma = 0;
|
||||
|
||||
add_to_string(header, "Accept-Encoding: ");
|
||||
|
||||
#ifdef CONFIG_BZIP2
|
||||
add_to_string(header, "bzip2");
|
||||
comma = 1;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_GZIP
|
||||
if (comma) add_to_string(header, ", ");
|
||||
add_to_string(header, "deflate, gzip");
|
||||
comma = 1;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LZMA
|
||||
if (comma) add_to_string(header, ", ");
|
||||
add_to_string(header, "lzma");
|
||||
#endif
|
||||
add_crlf_to_string(header);
|
||||
#endif
|
||||
}
|
||||
|
@ -45,6 +45,4 @@ read_file(struct stream_encoded *stream, int readsize, struct string *page);
|
||||
/* Reads the file with the given @filename into the string @source. */
|
||||
enum connection_state read_encoded_file(struct string *filename, struct string *source);
|
||||
|
||||
void accept_encoding_header(struct string *header);
|
||||
|
||||
#endif
|
||||
|
@ -23,7 +23,6 @@
|
||||
#include "cache/cache.h"
|
||||
#include "config/options.h"
|
||||
#include "cookies/cookies.h"
|
||||
#include "encoding/encoding.h"
|
||||
#include "intl/charsets.h"
|
||||
#include "intl/gettext/libintl.h"
|
||||
#include "main/module.h"
|
||||
@ -546,6 +545,33 @@ init_http_connection_info(struct connection *conn, int major, int minor, int clo
|
||||
return http;
|
||||
}
|
||||
|
||||
static void
|
||||
accept_encoding_header(struct string *header)
|
||||
{
|
||||
#if defined(CONFIG_GZIP) || defined(CONFIG_BZIP2) || defined(CONFIG_LZMA)
|
||||
int comma = 0;
|
||||
|
||||
add_to_string(header, "Accept-Encoding: ");
|
||||
|
||||
#ifdef CONFIG_BZIP2
|
||||
add_to_string(header, "bzip2");
|
||||
comma = 1;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_GZIP
|
||||
if (comma) add_to_string(header, ", ");
|
||||
add_to_string(header, "deflate, gzip");
|
||||
comma = 1;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LZMA
|
||||
if (comma) add_to_string(header, ", ");
|
||||
add_to_string(header, "lzma");
|
||||
#endif
|
||||
add_crlf_to_string(header);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
http_send_header(struct socket *socket)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user