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
860addf1
Commit
860addf1
authored
Aug 03, 2014
by
Sergey Lyubka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MONGOOSE_NO_SOCKETPAIR -> NS_DISABLE_SOCKETPAIR
parent
03d571a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
mongoose.c
mongoose.c
+13
-13
No files found.
mongoose.c
View file @
860addf1
...
@@ -249,7 +249,7 @@ void ns_set_close_on_exec(sock_t);
...
@@ -249,7 +249,7 @@ void ns_set_close_on_exec(sock_t);
void
ns_sock_to_str
(
sock_t
sock
,
char
*
buf
,
size_t
len
,
int
flags
);
void
ns_sock_to_str
(
sock_t
sock
,
char
*
buf
,
size_t
len
,
int
flags
);
int
ns_hexdump
(
const
void
*
buf
,
int
len
,
char
*
dst
,
int
dst_len
);
int
ns_hexdump
(
const
void
*
buf
,
int
len
,
char
*
dst
,
int
dst_len
);
int
ns_avprintf
(
char
**
buf
,
size_t
size
,
const
char
*
fmt
,
va_list
ap
);
int
ns_avprintf
(
char
**
buf
,
size_t
size
,
const
char
*
fmt
,
va_list
ap
);
#ifdef __cplusplus
#ifdef __cplusplus
}
}
#endif // __cplusplus
#endif // __cplusplus
...
@@ -913,7 +913,7 @@ int ns_server_poll(struct ns_server *server, int milli) {
...
@@ -913,7 +913,7 @@ int ns_server_poll(struct ns_server *server, int milli) {
// select() might have been waiting for a long time, reset current_time
// select() might have been waiting for a long time, reset current_time
// now to prevent last_io_time being set to the past.
// now to prevent last_io_time being set to the past.
current_time
=
time
(
NULL
);
current_time
=
time
(
NULL
);
// Accept new connections
// Accept new connections
if
(
server
->
listening_sock
!=
INVALID_SOCKET
&&
if
(
server
->
listening_sock
!=
INVALID_SOCKET
&&
FD_ISSET
(
server
->
listening_sock
,
&
read_set
))
{
FD_ISSET
(
server
->
listening_sock
,
&
read_set
))
{
...
@@ -1195,7 +1195,7 @@ typedef pid_t process_id_t;
...
@@ -1195,7 +1195,7 @@ typedef pid_t process_id_t;
#define MONGOOSE_IDLE_TIMEOUT_SECONDS 30
#define MONGOOSE_IDLE_TIMEOUT_SECONDS 30
#endif
#endif
#ifdef
MONGOOSE_NO
_SOCKETPAIR
#ifdef
NS_DISABLE
_SOCKETPAIR
#define MONGOOSE_NO_CGI
#define MONGOOSE_NO_CGI
#endif
#endif
...
@@ -1578,11 +1578,11 @@ static void parse_http_headers(char **buf, struct mg_connection *ri) {
...
@@ -1578,11 +1578,11 @@ static void parse_http_headers(char **buf, struct mg_connection *ri) {
static
const
char
*
status_code_to_str
(
int
status_code
)
{
static
const
char
*
status_code_to_str
(
int
status_code
)
{
switch
(
status_code
)
{
switch
(
status_code
)
{
case
100
:
return
"Continue"
;
case
100
:
return
"Continue"
;
case
101
:
return
"Switching Protocols"
;
case
101
:
return
"Switching Protocols"
;
case
102
:
return
"Processing"
;
case
102
:
return
"Processing"
;
case
200
:
return
"OK"
;
case
200
:
return
"OK"
;
case
201
:
return
"Created"
;
case
201
:
return
"Created"
;
case
202
:
return
"Accepted"
;
case
202
:
return
"Accepted"
;
...
@@ -1593,7 +1593,7 @@ static const char *status_code_to_str(int status_code) {
...
@@ -1593,7 +1593,7 @@ static const char *status_code_to_str(int status_code) {
case
207
:
return
"Multi-Status"
;
case
207
:
return
"Multi-Status"
;
case
208
:
return
"Already Reported"
;
case
208
:
return
"Already Reported"
;
case
226
:
return
"IM Used"
;
case
226
:
return
"IM Used"
;
case
300
:
return
"Multiple Choices"
;
case
300
:
return
"Multiple Choices"
;
case
301
:
return
"Moved Permanently"
;
case
301
:
return
"Moved Permanently"
;
case
302
:
return
"Found"
;
case
302
:
return
"Found"
;
...
@@ -1603,7 +1603,7 @@ static const char *status_code_to_str(int status_code) {
...
@@ -1603,7 +1603,7 @@ static const char *status_code_to_str(int status_code) {
case
306
:
return
"Switch Proxy"
;
case
306
:
return
"Switch Proxy"
;
case
307
:
return
"Temporary Redirect"
;
case
307
:
return
"Temporary Redirect"
;
case
308
:
return
"Permanent Redirect"
;
case
308
:
return
"Permanent Redirect"
;
case
400
:
return
"Bad Request"
;
case
400
:
return
"Bad Request"
;
case
401
:
return
"Unauthorized"
;
case
401
:
return
"Unauthorized"
;
case
402
:
return
"Payment Required"
;
case
402
:
return
"Payment Required"
;
...
@@ -1631,7 +1631,7 @@ static const char *status_code_to_str(int status_code) {
...
@@ -1631,7 +1631,7 @@ static const char *status_code_to_str(int status_code) {
case
429
:
return
"Too Many Requests"
;
case
429
:
return
"Too Many Requests"
;
case
431
:
return
"Request Header Fields Too Large"
;
case
431
:
return
"Request Header Fields Too Large"
;
case
451
:
return
"Unavailable For Legal Reasons"
;
case
451
:
return
"Unavailable For Legal Reasons"
;
case
500
:
return
"Internal Server Error"
;
case
500
:
return
"Internal Server Error"
;
case
501
:
return
"Not Implemented"
;
case
501
:
return
"Not Implemented"
;
case
502
:
return
"Bad Gateway"
;
case
502
:
return
"Bad Gateway"
;
...
@@ -1643,7 +1643,7 @@ static const char *status_code_to_str(int status_code) {
...
@@ -1643,7 +1643,7 @@ static const char *status_code_to_str(int status_code) {
case
508
:
return
"Loop Detected"
;
case
508
:
return
"Loop Detected"
;
case
510
:
return
"Not Extended"
;
case
510
:
return
"Not Extended"
;
case
511
:
return
"Network Authentication Required"
;
case
511
:
return
"Network Authentication Required"
;
default:
return
"Server Error"
;
default:
return
"Server Error"
;
}
}
}
}
...
@@ -4252,7 +4252,7 @@ void mg_send_file_internal(struct mg_connection *c, const char *file_name,
...
@@ -4252,7 +4252,7 @@ void mg_send_file_internal(struct mg_connection *c, const char *file_name,
#endif
#endif
mg_snprintf
(
path
,
sizeof
(
path
),
"%s"
,
file_name
);
mg_snprintf
(
path
,
sizeof
(
path
),
"%s"
,
file_name
);
if
(
!
exists
||
must_hide_file
(
conn
,
path
))
{
if
(
!
exists
||
must_hide_file
(
conn
,
path
))
{
send_http_error
(
conn
,
404
,
NULL
);
send_http_error
(
conn
,
404
,
NULL
);
}
else
if
(
is_directory
&&
}
else
if
(
is_directory
&&
...
@@ -4344,12 +4344,12 @@ static void open_local_endpoint(struct connection *conn, int skip_user) {
...
@@ -4344,12 +4344,12 @@ static void open_local_endpoint(struct connection *conn, int skip_user) {
}
}
return
;
return
;
}
}
if
(
!
strcmp
(
conn
->
mg_conn
.
request_method
,
"OPTIONS"
))
{
if
(
!
strcmp
(
conn
->
mg_conn
.
request_method
,
"OPTIONS"
))
{
send_options
(
conn
);
send_options
(
conn
);
return
;
return
;
}
}
#ifdef MONGOOSE_NO_FILESYSTEM
#ifdef MONGOOSE_NO_FILESYSTEM
send_http_error
(
conn
,
404
,
NULL
);
send_http_error
(
conn
,
404
,
NULL
);
#else
#else
...
@@ -4693,7 +4693,7 @@ struct mg_connection *mg_next(struct mg_server *s, struct mg_connection *c) {
...
@@ -4693,7 +4693,7 @@ struct mg_connection *mg_next(struct mg_server *s, struct mg_connection *c) {
struct
connection
*
conn
=
MG_CONN_2_CONN
(
c
);
struct
connection
*
conn
=
MG_CONN_2_CONN
(
c
);
struct
ns_connection
*
nc
=
ns_next
(
&
s
->
ns_server
,
struct
ns_connection
*
nc
=
ns_next
(
&
s
->
ns_server
,
c
==
NULL
?
NULL
:
conn
->
ns_conn
);
c
==
NULL
?
NULL
:
conn
->
ns_conn
);
return
nc
==
NULL
?
NULL
:
return
nc
==
NULL
?
NULL
:
&
((
struct
connection
*
)
nc
->
connection_data
)
->
mg_conn
;
&
((
struct
connection
*
)
nc
->
connection_data
)
->
mg_conn
;
}
}
...
...
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