Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongoose
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
esp
mongoose
Commits
bd23ec43
Commit
bd23ec43
authored
May 29, 2014
by
Sergey Lyubka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed a bit of dead code. Added more comments in proxy_event_handler()
parent
3671b263
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
5 deletions
+2
-5
proxy.c
examples/proxy.c
+2
-5
No files found.
examples/proxy.c
View file @
bd23ec43
...
@@ -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
))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment