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
Admin message
Gitlab has been updated. More info
here
.
Show more breadcrumbs
Ganil-acq
GANILinux
linux-service
library
mongoose
Commits
c132191c
Commit
c132191c
authored
12 years ago
by
Sergey Lyubka
Browse files
Options
Downloads
Patches
Plain Diff
Prepare to change the API to use explicit callbacks
parent
d73aa1ad
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mongoose.h
+19
-1
19 additions, 1 deletion
mongoose.h
with
19 additions
and
1 deletion
mongoose.h
+
19
−
1
View file @
c132191c
...
@@ -52,6 +52,24 @@ struct mg_request_info {
...
@@ -52,6 +52,24 @@ struct mg_request_info {
};
};
// This structure needs to be passed to mg_start(), to let mongoose know
// which callbacks to invoke. For detailed description, see
// https://github.com/valenok/mongoose/blob/master/UserManual.md
struct
mg_callbacks
{
int
(
*
request_start
)(
struct
mg_connection
*
);
void
(
*
request_done
)(
struct
mg_connection
*
,
int
reply_status_code
);
int
(
*
log_message
)(
struct
mg_connection
*
,
const
char
*
message
);
int
(
*
init_ssl
)(
void
*
ssl_context
);
void
(
*
websocket_connect
)(
struct
mg_connection
*
);
void
(
*
websocket_ready
)(
struct
mg_connection
*
);
int
(
*
websocket_data
)(
struct
mg_connection
*
);
void
(
*
websocket_close
)(
struct
mg_connection
*
);
void
(
*
open_file
)(
struct
mg_connection
*
,
char
**
data
,
size_t
*
data_len
);
void
(
*
init_lua
)(
struct
mg_connection
*
,
void
*
lua_context
);
void
(
*
upload
)(
struct
mg_connection
*
,
const
char
*
file_name
);
};
// Various events on which user-defined callback function is called by Mongoose.
// Various events on which user-defined callback function is called by Mongoose.
enum
mg_event
{
enum
mg_event
{
// New HTTP request has arrived from the client.
// New HTTP request has arrived from the client.
...
@@ -323,7 +341,7 @@ int mg_get_cookie(const struct mg_connection *,
...
@@ -323,7 +341,7 @@ int mg_get_cookie(const struct mg_connection *,
// request_fmt,...: HTTP request.
// request_fmt,...: HTTP request.
// Return:
// Return:
// On success, valid pointer to the new connection, suitable for mg_read().
// On success, valid pointer to the new connection, suitable for mg_read().
// On error, NULL.
// On error, NULL.
error_buffer contains error message.
// Example:
// Example:
// char ebuf[100];
// char ebuf[100];
// struct mg_connection *conn;
// struct mg_connection *conn;
...
...
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