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
3dffd760
Commit
3dffd760
authored
Jan 28, 2014
by
Sergey Lyubka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed warnings
parent
5a67af0c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
11 deletions
+6
-11
mongoose.c
mongoose.c
+6
-11
No files found.
mongoose.c
View file @
3dffd760
...
...
@@ -1131,7 +1131,7 @@ static const char cgi_status[] = "HTTP/1.1 200 OK\r\n";
static
void
open_cgi_endpoint
(
struct
connection
*
conn
,
const
char
*
prog
)
{
struct
cgi_env_block
blk
;
char
dir
[
MAX_PATH_SIZE
]
,
*
p
=
NULL
;
char
dir
[
MAX_PATH_SIZE
];
sock_t
fds
[
2
];
prepare_cgi_environment
(
conn
,
prog
,
&
blk
);
...
...
@@ -1139,11 +1139,8 @@ static void open_cgi_endpoint(struct connection *conn, const char *prog) {
// directory containing executable program, 'p' must point to the
// executable program name relative to 'dir'.
mg_snprintf
(
dir
,
sizeof
(
dir
),
"%s"
,
prog
);
if
((
p
=
strrchr
(
dir
,
'/'
))
!=
NULL
)
{
*
p
++
=
'\0'
;
}
else
{
dir
[
0
]
=
'.'
,
dir
[
1
]
=
'\0'
;
p
=
(
char
*
)
prog
;
if
(
strrchr
(
dir
,
'/'
)
==
NULL
)
{
mg_snprintf
(
dir
,
sizeof
(
dir
),
"%s"
,
"."
);
}
// Try to create socketpair in a loop until success. mg_socketpair()
...
...
@@ -1492,7 +1489,7 @@ const char *mg_get_header(const struct mg_connection *ri, const char *s) {
// Perform case-insensitive match of string against pattern
static
int
match_prefix
(
const
char
*
pattern
,
int
pattern_len
,
const
char
*
str
)
{
const
char
*
or_str
;
int
i
,
j
,
len
,
res
;
int
len
,
res
,
i
=
0
,
j
=
0
;
if
((
or_str
=
(
const
char
*
)
memchr
(
pattern
,
'|'
,
pattern_len
))
!=
NULL
)
{
res
=
match_prefix
(
pattern
,
or_str
-
pattern
,
str
);
...
...
@@ -1500,8 +1497,6 @@ static int match_prefix(const char *pattern, int pattern_len, const char *str) {
match_prefix
(
or_str
+
1
,
(
pattern
+
pattern_len
)
-
(
or_str
+
1
),
str
);
}
i
=
j
=
0
;
res
=
-
1
;
for
(;
i
<
pattern_len
;
i
++
,
j
++
)
{
if
(
pattern
[
i
]
==
'?'
&&
str
[
j
]
!=
'\0'
)
{
continue
;
...
...
@@ -1714,8 +1709,8 @@ static void SHA1Transform(uint32_t state[5], const unsigned char buffer[64]) {
state
[
4
]
+=
e
;
// Erase working structures. The order of operations is important,
// used to ensure that compiler doesn't optimize those out.
memset
(
block
,
0
,
sizeof
(
block
))
;
a
=
b
=
c
=
d
=
e
=
block
[
0
].
l
[
0
]
;
a
=
b
=
c
=
d
=
e
=
0
;
memset
(
block
,
a
,
sizeof
(
block
))
;
}
static
void
SHA1Init
(
SHA1_CTX
*
context
)
{
...
...
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