Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
mongoose
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ganil-acq
GANILinux
linux-service
library
mongoose
Commits
079c99c4
Commit
079c99c4
authored
11 years ago
by
Sergey Lyubka
Browse files
Options
Downloads
Patches
Plain Diff
Started to restore single callback function
parent
6d2a76b6
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
mongoose.c
+9
-0
9 additions, 0 deletions
mongoose.c
mongoose.h
+11
-0
11 additions, 0 deletions
mongoose.h
with
20 additions
and
0 deletions
mongoose.c
+
9
−
0
View file @
079c99c4
...
@@ -491,6 +491,7 @@ struct mg_context {
...
@@ -491,6 +491,7 @@ struct mg_context {
SSL_CTX
*
ssl_ctx
;
// SSL context
SSL_CTX
*
ssl_ctx
;
// SSL context
char
*
config
[
NUM_OPTIONS
];
// Mongoose configuration parameters
char
*
config
[
NUM_OPTIONS
];
// Mongoose configuration parameters
struct
mg_callbacks
callbacks
;
// User-defined callback function
struct
mg_callbacks
callbacks
;
// User-defined callback function
mg_callback_t
user_callback
;
// User-defined callback function
void
*
user_data
;
// User-defined data
void
*
user_data
;
// User-defined data
struct
socket
*
listening_sockets
;
struct
socket
*
listening_sockets
;
...
@@ -540,6 +541,14 @@ const char **mg_get_valid_option_names(void) {
...
@@ -540,6 +541,14 @@ const char **mg_get_valid_option_names(void) {
return
config_options
;
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
)
{
static
FILE
*
mg_fopen
(
const
char
*
path
,
const
char
*
mode
)
{
#ifdef _WIN32
#ifdef _WIN32
wchar_t
wbuf
[
PATH_MAX
],
wmode
[
20
];
wchar_t
wbuf
[
PATH_MAX
],
wmode
[
20
];
...
...
This diff is collapsed.
Click to expand it.
mongoose.h
+
11
−
0
View file @
079c99c4
...
@@ -49,6 +49,17 @@ struct mg_request_info {
...
@@ -49,6 +49,17 @@ struct mg_request_info {
}
http_headers
[
64
];
// Maximum 64 headers
}
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
{
struct
mg_callbacks
{
int
(
*
begin_request
)(
struct
mg_connection
*
);
int
(
*
begin_request
)(
struct
mg_connection
*
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment