Commit bd23ec43 authored by Sergey Lyubka's avatar Sergey Lyubka

Removed a bit of dead code. Added more comments in proxy_event_handler()

parent 3671b263
...@@ -71,10 +71,6 @@ static int try_to_serve_locally(struct mg_connection *conn) { ...@@ -71,10 +71,6 @@ static int try_to_serve_locally(struct mg_connection *conn) {
strncat(path, "/index.html", sizeof(path) - strlen(path) - 1); strncat(path, "/index.html", sizeof(path) - strlen(path) - 1);
res = exists(path); res = exists(path);
printf("PATH: [%s]\n", path); printf("PATH: [%s]\n", path);
#if 0
snprintf(path + strlen(path), sizeof(path) - strlen(path),
"/%s", "index.html");
#endif
} }
if (res == 0) return MG_FALSE; if (res == 0) return MG_FALSE;
...@@ -108,7 +104,8 @@ static int proxy_event_handler(struct mg_connection *conn, enum mg_event ev) { ...@@ -108,7 +104,8 @@ static int proxy_event_handler(struct mg_connection *conn, enum mg_event ev) {
host == NULL ? "" : host); host == NULL ? "" : host);
if (strstr(conn->uri, "/qqq") != NULL) s_received_signal = SIGTERM; if (strstr(conn->uri, "/qqq") != NULL) s_received_signal = SIGTERM;
// Proxied HTTP requests have URI http://..... // Proxied HTTPS requests use "CONNECT foo.com:443"
// Proxied HTTP requests use "GET http://..... "
// Serve requests for target_url from the local FS. // Serve requests for target_url from the local FS.
if (memcmp(conn->uri, target_url, target_url_size) == 0 && if (memcmp(conn->uri, target_url, target_url_size) == 0 &&
is_resource_present_locally(conn->uri + target_url_size)) { is_resource_present_locally(conn->uri + target_url_size)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment