summaryrefslogtreecommitdiffhomepage
path: root/src/conns.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/conns.h')
-rw-r--r--src/conns.h24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/conns.h b/src/conns.h
index 393e5d4..36082f2 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"
/*
* Connection Definition
@@ -45,7 +45,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;
@@ -62,6 +62,11 @@ struct conn_s {
char *server_ip_addr;
/*
+ * Store the server's alternative IP (for BindIPv4/6Mapped)
+ */
+ char *server_ip_addr_alt;
+
+ /*
* Store the client's IP information
*/
char *client_ip_addr;
@@ -87,11 +92,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 *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