1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

[http] enum blacklist_flags -> blacklist_flags_T

This commit is contained in:
Witold Filipczyk 2022-01-28 17:12:27 +01:00
parent fd1ba62f1b
commit ef044a5a62
4 changed files with 12 additions and 10 deletions

View File

@ -260,7 +260,7 @@ make_connection(struct socket *socket, struct uri *uri,
char *host = get_uri_string(uri, URI_DNS_HOST); char *host = get_uri_string(uri, URI_DNS_HOST);
struct connect_info *connect_info; struct connect_info *connect_info;
enum dns_result result; enum dns_result result;
enum blacklist_flags verify; blacklist_flags_T verify;
socket->ops->set_timeout(socket, connection_state(0)); socket->ops->set_timeout(socket, connection_state(0));
@ -281,7 +281,7 @@ make_connection(struct socket *socket, struct uri *uri,
* complete_connect_socket() work from the HTTP implementation. */ * complete_connect_socket() work from the HTTP implementation. */
socket->need_ssl = get_protocol_need_ssl(uri->protocol); socket->need_ssl = get_protocol_need_ssl(uri->protocol);
if (!socket->set_no_tls) { if (!socket->set_no_tls) {
enum blacklist_flags flags = get_blacklist_flags(uri); blacklist_flags_T flags = get_blacklist_flags(uri);
socket->no_tls = ((flags & SERVER_BLACKLIST_NO_TLS) != 0); socket->no_tls = ((flags & SERVER_BLACKLIST_NO_TLS) != 0);
socket->set_no_tls = 1; socket->set_no_tls = 1;
} }

View File

@ -19,7 +19,7 @@
struct blacklist_entry { struct blacklist_entry {
LIST_HEAD(struct blacklist_entry); LIST_HEAD(struct blacklist_entry);
enum blacklist_flags flags; blacklist_flags_T flags;
char host[1]; /* Must be last. */ char host[1]; /* Must be last. */
}; };
@ -44,7 +44,7 @@ get_blacklist_entry(struct uri *uri)
} }
void void
add_blacklist_entry(struct uri *uri, enum blacklist_flags flags) add_blacklist_entry(struct uri *uri, blacklist_flags_T flags)
{ {
struct blacklist_entry *entry = get_blacklist_entry(uri); struct blacklist_entry *entry = get_blacklist_entry(uri);
@ -62,7 +62,7 @@ add_blacklist_entry(struct uri *uri, enum blacklist_flags flags)
} }
void void
del_blacklist_entry(struct uri *uri, enum blacklist_flags flags) del_blacklist_entry(struct uri *uri, blacklist_flags_T flags)
{ {
struct blacklist_entry *entry = get_blacklist_entry(uri); struct blacklist_entry *entry = get_blacklist_entry(uri);
@ -75,7 +75,7 @@ del_blacklist_entry(struct uri *uri, enum blacklist_flags flags)
mem_free(entry); mem_free(entry);
} }
enum blacklist_flags blacklist_flags_T
get_blacklist_flags(struct uri *uri) get_blacklist_flags(struct uri *uri)
{ {
struct blacklist_entry *entry = get_blacklist_entry(uri); struct blacklist_entry *entry = get_blacklist_entry(uri);

View File

@ -16,9 +16,11 @@ enum blacklist_flags {
SERVER_BLACKLIST_NO_CERT_VERIFY = 8, SERVER_BLACKLIST_NO_CERT_VERIFY = 8,
}; };
void add_blacklist_entry(struct uri *, enum blacklist_flags); typedef unsigned char blacklist_flags_T;
void del_blacklist_entry(struct uri *, enum blacklist_flags);
enum blacklist_flags get_blacklist_flags(struct uri *); void add_blacklist_entry(struct uri *, blacklist_flags_T);
void del_blacklist_entry(struct uri *, blacklist_flags_T);
blacklist_flags_T get_blacklist_flags(struct uri *);
void free_blacklist(void); void free_blacklist(void);
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -23,7 +23,7 @@ struct http_version {
/** connection.info points to this in HTTP and local CGI connections. */ /** connection.info points to this in HTTP and local CGI connections. */
struct http_connection_info { struct http_connection_info {
enum blacklist_flags bl_flags; blacklist_flags_T bl_flags;
struct http_version recv_version; struct http_version recv_version;
struct http_version sent_version; struct http_version sent_version;