diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/conns.c | 2 | ||||
-rw-r--r-- | src/conns.h | 9 | ||||
-rw-r--r-- | src/reqs.c | 6 |
3 files changed, 13 insertions, 4 deletions
diff --git a/src/conns.c b/src/conns.c index 94faeea..3859d69 100644 --- a/src/conns.c +++ b/src/conns.c @@ -68,7 +68,7 @@ struct conn_s *initialize_conn (int client_fd, const char *ipaddr, connptr->error_string = NULL; connptr->error_number = -1; - connptr->connect_method = FALSE; + connptr->connect_method = CM_FALSE; connptr->show_stats = FALSE; connptr->protocol.major = connptr->protocol.minor = 0; diff --git a/src/conns.h b/src/conns.h index b63d026..322ead1 100644 --- a/src/conns.h +++ b/src/conns.h @@ -24,6 +24,12 @@ #include "main.h" #include "hashmap.h" +enum connect_method_e { + CM_FALSE = 0, + CM_TRUE = 1, + CM_UPGRADE = 2, +}; + /* * Connection Definition */ @@ -37,8 +43,9 @@ struct conn_s { /* The request line (first line) from the client */ char *request_line; + enum connect_method_e connect_method; + /* Booleans */ - unsigned int connect_method; unsigned int show_stats; /* @@ -438,7 +438,7 @@ BAD_REQUEST_ERROR: goto fail; } - connptr->connect_method = TRUE; + connptr->connect_method = CM_TRUE; } else { #ifdef TRANSPARENT_PROXY if (!do_transparent_proxy @@ -1700,7 +1700,7 @@ void handle_connection (int fd) connptr->server_fd); if(hashmap_search(hashofheaders, "upgrade") > 0) { - connptr->connect_method = TRUE; + connptr->connect_method = CM_UPGRADE; safe_write (connptr->server_fd, lines, lines_len); } @@ -1718,6 +1718,8 @@ void handle_connection (int fd) update_stats (STAT_BADCONN); goto fail; } + } else if (connptr->connect_method == CM_UPGRADE) { + /* NOP */ ; } else { if (send_ssl_response (connptr) < 0) { log_message (LOG_ERR, |