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
7bd9a858
Commit
7bd9a858
authored
Feb 10, 2013
by
Sergey Lyubka
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #92 from jmucchiello/send_http_error
Send http error
parents
b2b43ab0
2efc5d9f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
16 deletions
+20
-16
mongoose.c
mongoose.c
+19
-16
mongoose.h
mongoose.h
+1
-0
No files found.
mongoose.c
View file @
7bd9a858
...
@@ -915,6 +915,8 @@ static void send_http_error(struct mg_connection *conn, int status,
...
@@ -915,6 +915,8 @@ static void send_http_error(struct mg_connection *conn, int status,
int
len
=
0
;
int
len
=
0
;
conn
->
status_code
=
status
;
conn
->
status_code
=
status
;
if
(
conn
->
ctx
->
callbacks
.
http_error
==
NULL
||
conn
->
ctx
->
callbacks
.
http_error
(
conn
,
status
))
{
buf
[
0
]
=
'\0'
;
buf
[
0
]
=
'\0'
;
// Errors 1xx, 204 and 304 MUST NOT send a body
// Errors 1xx, 204 and 304 MUST NOT send a body
...
@@ -933,6 +935,7 @@ static void send_http_error(struct mg_connection *conn, int status,
...
@@ -933,6 +935,7 @@ static void send_http_error(struct mg_connection *conn, int status,
"Connection: %s
\r\n\r\n
"
,
status
,
reason
,
len
,
"Connection: %s
\r\n\r\n
"
,
status
,
reason
,
len
,
suggest_connection_header
(
conn
));
suggest_connection_header
(
conn
));
conn
->
num_bytes_sent
+=
mg_printf
(
conn
,
"%s"
,
buf
);
conn
->
num_bytes_sent
+=
mg_printf
(
conn
,
"%s"
,
buf
);
}
}
}
#if defined(_WIN32) && !defined(__SYMBIAN32__)
#if defined(_WIN32) && !defined(__SYMBIAN32__)
...
...
mongoose.h
View file @
7bd9a858
...
@@ -67,6 +67,7 @@ struct mg_callbacks {
...
@@ -67,6 +67,7 @@ struct mg_callbacks {
const
char
*
path
,
size_t
*
data_len
);
const
char
*
path
,
size_t
*
data_len
);
void
(
*
init_lua
)(
struct
mg_connection
*
,
void
*
lua_context
);
void
(
*
init_lua
)(
struct
mg_connection
*
,
void
*
lua_context
);
void
(
*
upload
)(
struct
mg_connection
*
,
const
char
*
file_name
);
void
(
*
upload
)(
struct
mg_connection
*
,
const
char
*
file_name
);
int
(
*
http_error
)(
struct
mg_connection
*
,
int
status
);
};
};
// Start web server.
// Start web server.
...
...
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