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
079c99c4
Commit
079c99c4
authored
Sep 26, 2013
by
Sergey Lyubka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Started to restore single callback function
parent
6d2a76b6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
mongoose.c
mongoose.c
+9
-0
mongoose.h
mongoose.h
+11
-0
No files found.
mongoose.c
View file @
079c99c4
...
...
@@ -491,6 +491,7 @@ struct mg_context {
SSL_CTX
*
ssl_ctx
;
// SSL context
char
*
config
[
NUM_OPTIONS
];
// Mongoose configuration parameters
struct
mg_callbacks
callbacks
;
// User-defined callback function
mg_callback_t
user_callback
;
// User-defined callback function
void
*
user_data
;
// User-defined data
struct
socket
*
listening_sockets
;
...
...
@@ -540,6 +541,14 @@ const char **mg_get_valid_option_names(void) {
return
config_options
;
}
static
int
call_user
(
enum
mg_event
ev
,
struct
mg_connection
*
conn
,
void
*
p
)
{
if
(
conn
!=
NULL
&&
conn
->
ctx
!=
NULL
)
{
conn
->
request_info
.
user_data
=
conn
->
ctx
->
user_data
;
}
return
conn
==
NULL
||
conn
->
ctx
==
NULL
||
conn
->
ctx
->
user_callback
==
NULL
?
0
:
conn
->
ctx
->
user_callback
(
ev
,
conn
,
p
);
}
static
FILE
*
mg_fopen
(
const
char
*
path
,
const
char
*
mode
)
{
#ifdef _WIN32
wchar_t
wbuf
[
PATH_MAX
],
wmode
[
20
];
...
...
mongoose.h
View file @
079c99c4
...
...
@@ -49,6 +49,17 @@ struct mg_request_info {
}
http_headers
[
64
];
// Maximum 64 headers
};
enum
mg_event
{
MG_REQUEST_BEGIN
,
MG_REQUEST_END
,
MG_HTTP_ERROR
,
MG_EVENT_LOG
,
MG_THREAD_BEGIN
,
MG_THREAD_END
};
typedef
int
(
*
mg_callback_t
)(
enum
mg_event
event
,
struct
mg_connection
*
conn
,
void
*
data
);
struct
mg_callbacks
{
int
(
*
begin_request
)(
struct
mg_connection
*
);
...
...
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