diff options
Diffstat (limited to 'src/http_proxy_client.c')
-rw-r--r-- | src/http_proxy_client.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/http_proxy_client.c b/src/http_proxy_client.c index b06f523..e801a73 100644 --- a/src/http_proxy_client.c +++ b/src/http_proxy_client.c @@ -38,6 +38,12 @@ typedef struct { SSL_CTX* ctx; } proxy_argT; +/* + * Function name: clean_return + * Description: Closes the connection and exits the thread. + * Arguments: sockfd - the descriptor of the connection + */ + static void clean_return(int sockfd) { @@ -47,6 +53,12 @@ clean_return(int sockfd) pthread_exit(NULL); } +/* + * Function name: http_proxy_client + * Description: Function responsible for the client part of the http proxy connection. + * Arguments: vptr - the structure with all the information needed for http proxy tunnel + */ + void* http_proxy_client(void *vptr) { @@ -519,6 +531,16 @@ http_proxy_client(void *vptr) clean_return(conn.sockfd); } +/* + * Function name: initialize_http_proxy_client + * Description: Initializes the thread responsible for http proxy connection. + * Arguments: sockfd - the new connection descriptor will be stored here + * cr - the pointer to ClientRealm structure + * ctx - the pointer to SSL_CTX structure + * Returns: 0 - success, + * !0 - failure. + */ + int initialize_http_proxy_client(int* sockfd, ClientRealm* cr, SSL_CTX* ctx) { |