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
b12cc9fd
Commit
b12cc9fd
authored
Sep 25, 2013
by
Sergey Lyubka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactored handle_options_request() to use mg_write() with less copying
parent
a61c3a26
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
mongoose.c
mongoose.c
+7
-8
No files found.
mongoose.c
View file @
b12cc9fd
...
...
@@ -3824,14 +3824,13 @@ static void handle_ssi_file_request(struct mg_connection *conn,
}
}
static
void
send_options
(
struct
mg_connection
*
conn
)
{
conn
->
status_code
=
200
;
static
void
handle_options_request
(
struct
mg_connection
*
conn
)
{
static
const
char
reply
[]
=
"HTTP/1.1 200 OK
\r\n
"
"Allow: GET, POST, HEAD, CONNECT, PUT, DELETE, OPTIONS, PROPFIND, MKCOL
\r\n
"
"DAV: 1
\r\n\r\n
"
;
mg_printf
(
conn
,
"%s"
,
"HTTP/1.1 200 OK
\r\n
"
"Content-Length: 0
\r\n
"
"Allow: GET, POST, HEAD, CONNECT, PUT, DELETE, "
"OPTIONS, PROPFIND, MKCOL
\r\n
"
"DAV: 1
\r\n\r\n
"
);
conn
->
status_code
=
200
;
mg_write
(
conn
,
reply
,
sizeof
(
reply
)
-
1
);
}
// Writes PROPFIND properties for a collection element
...
...
@@ -4502,7 +4501,7 @@ static void handle_request(struct mg_connection *conn) {
handle_websocket_request
(
conn
);
#endif
}
else
if
(
!
strcmp
(
ri
->
request_method
,
"OPTIONS"
))
{
send_options
(
conn
);
handle_options_request
(
conn
);
}
else
if
(
conn
->
ctx
->
config
[
DOCUMENT_ROOT
]
==
NULL
)
{
send_http_error
(
conn
,
404
,
"Not Found"
,
"Not Found"
);
}
else
if
(
is_put_or_delete_request
(
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