diff --git a/src/client.c b/src/client.c index 9608145..c0d01b0 100644 --- a/src/client.c +++ b/src/client.c @@ -574,7 +574,7 @@ int client_request_handler(sock *client, unsigned long client_num, unsigned int if (res.status->code >= 300 && res.status->code < 400) { const char *location = http_get_header_field(&res.hdr, "Location"); if (location != NULL) { - snprintf(msg_content, sizeof(msg_content), "\n", location); + snprintf(msg_content, sizeof(msg_content), "\n", location, location); } } } else if (strncmp(msg_content, "", 15) == 0 || strncmp(msg_content, "version[0] == 0) { - pos1 = memchr(ptr, ' ', rcv_len - (ptr - buf)) + 1; + pos1 = (char *) memchr(ptr, ' ', rcv_len - (ptr - buf)) + 1; if (pos1 == NULL) goto err_hdr_fmt; if (pos1 - ptr - 1 >= sizeof(req->method)) { @@ -192,7 +192,7 @@ int http_receive_request(sock *client, http_req *req) { } snprintf(req->method, sizeof(req->method), "%.*s", (int) (pos1 - ptr - 1), ptr); - pos2 = memchr(pos1, ' ', rcv_len - (pos1 - buf)) + 1; + pos2 = (char *) memchr(pos1, ' ', rcv_len - (pos1 - buf)) + 1; if (pos2 == NULL) { err_hdr_fmt: error("Unable to parse http header: Invalid header format"); diff --git a/src/lib/rev_proxy.c b/src/lib/rev_proxy.c index 57a3a29..f7c5836 100644 --- a/src/lib/rev_proxy.c +++ b/src/lib/rev_proxy.c @@ -511,7 +511,7 @@ int rev_proxy_send(sock *client, unsigned long len_to_send, int flags) { ptr = buffer; out: avail_in = len; - void *next_in = ptr; + char *next_in = ptr; do { long buf_len = len; if (flags & REV_PROXY_COMPRESS) { diff --git a/src/server.c b/src/server.c index 284924a..78c76e0 100644 --- a/src/server.c +++ b/src/server.c @@ -42,13 +42,6 @@ pid_t children[MAX_CHILDREN]; MMDB_s mmdbs[MAX_MMDB]; SSL_CTX *contexts[CONFIG_MAX_CERT_CONFIG]; -void openssl_init(void) { - SSL_library_init(); - SSL_load_error_strings(); - ERR_load_BIO_strings(); - OpenSSL_add_all_algorithms(); -} - static int ssl_servername_cb(SSL *ssl, int *ad, void *arg) { const char *servername = SSL_get_servername(ssl, TLSEXT_NAMETYPE_host_name); if (servername != NULL) { @@ -88,6 +81,7 @@ void destroy(int _) { } void terminate(int _) { + fprintf(stderr, "\n"); notice("Terminating gracefully..."); active = 0; @@ -289,8 +283,6 @@ int main(int argc, const char *argv[]) { return 0; } - openssl_init(); - for (int i = 0; i < CONFIG_MAX_CERT_CONFIG; i++) { const cert_config *conf = &config->certs[i]; if (conf->name[0] == 0) break; @@ -339,7 +331,7 @@ int main(int argc, const char *argv[]) { } errno = 0; - info("Ready to accept connections"); + notice("Ready to accept connections"); while (active) { ready_sockets_num = poll(poll_fds, NUM_SOCKETS, 1000); diff --git a/src/server.h b/src/server.h index 6c58c9b..710a269 100644 --- a/src/server.h +++ b/src/server.h @@ -22,7 +22,6 @@ #define SERVER_TIMEOUT_INIT 4 #define SERVER_TIMEOUT 3600 - extern int sockets[NUM_SOCKETS]; extern pid_t children[MAX_CHILDREN]; extern MMDB_s mmdbs[MAX_MMDB];