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
c132191c
Commit
c132191c
authored
Jan 31, 2013
by
Sergey Lyubka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prepare to change the API to use explicit callbacks
parent
d73aa1ad
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
1 deletion
+19
-1
mongoose.h
mongoose.h
+19
-1
No files found.
mongoose.h
View file @
c132191c
...
...
@@ -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.
enum
mg_event
{
// New HTTP request has arrived from the client.
...
...
@@ -323,7 +341,7 @@ int mg_get_cookie(const struct mg_connection *,
// request_fmt,...: HTTP request.
// Return:
// On success, valid pointer to the new connection, suitable for mg_read().
// On error, NULL.
// On error, NULL.
error_buffer contains error message.
// Example:
// char ebuf[100];
// struct mg_connection *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