summaryrefslogtreecommitdiffhomepage
path: root/src/conns.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/conns.h')
-rw-r--r--src/conns.h28
1 files changed, 17 insertions, 11 deletions
diff --git a/src/conns.h b/src/conns.h
index 322ead1..7e1919c 100644
--- a/src/conns.h
+++ b/src/conns.h
@@ -22,7 +22,7 @@
#define TINYPROXY_CONNS_H
#include "main.h"
-#include "hashmap.h"
+#include "hsearch.h"
enum connect_method_e {
CM_FALSE = 0,
@@ -52,7 +52,7 @@ struct conn_s {
* This structure stores key -> value mappings for substitution
* in the error HTML files.
*/
- hashmap_t error_variables;
+ struct htab *error_variables;
int error_number;
char *error_string;
@@ -69,10 +69,14 @@ struct conn_s {
char *server_ip_addr;
/*
- * Store the client's IP and hostname information
+ * Store the server's alternative IP (for BindIPv4/6Mapped)
+ */
+ char *server_ip_addr_alt;
+
+ /*
+ * Store the client's IP information
*/
char *client_ip_addr;
- char *client_string_addr;
/*
* Store the incoming request's HTTP protocol.
@@ -95,12 +99,14 @@ struct conn_s {
struct upstream *upstream_proxy;
};
-/*
- * Functions for the creation and destruction of a connection structure.
- */
-extern struct conn_s *initialize_conn (int client_fd, const char *ipaddr,
- const char *string_addr,
- const char *sock_ipaddr);
-extern void destroy_conn (struct conn_s *connptr);
+/* expects pointer to zero-initialized struct, set up struct
+ with default values for initial use */
+extern void conn_struct_init(struct conn_s *connptr);
+
+/* second stage initializiation, sets up buffers and connection details */
+extern int conn_init_contents (struct conn_s *connptr, const char *ipaddr,
+ const char *sock_ipaddr,
+ const char *sock_ipaddr_alt);
+extern void conn_destroy_contents (struct conn_s *connptr);
#endif