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
976b5f37
Commit
976b5f37
authored
Mar 09, 2014
by
Sergey Lyubka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added Lua callback
parent
31489ab7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
0 deletions
+3
-0
mongoose.c
mongoose.c
+2
-0
mongoose.h
mongoose.h
+1
-0
No files found.
mongoose.c
View file @
976b5f37
...
...
@@ -3957,6 +3957,8 @@ static void handle_lsp_request(struct connection *conn, const char *path,
}
else
{
// We're not sending HTTP headers here, Lua page must do it.
prepare_lua_environment
(
&
conn
->
mg_conn
,
L
);
conn
->
mg_conn
.
connection_param
=
L
;
call_user
(
conn
,
MG_LUA
);
lua_pushcclosure
(
L
,
&
lua_error_handler
,
0
);
lua_rawgeti
(
L
,
LUA_REGISTRYINDEX
,
LUA_RIDX_GLOBALS
);
lsp
(
conn
,
p
,
(
int
)
st
->
st_size
,
L
);
...
...
mongoose.h
View file @
976b5f37
...
...
@@ -66,6 +66,7 @@ enum mg_event {
MG_REQUEST
,
// If callback returns MG_FALSE, Mongoose continues with req
MG_REPLY
,
// If callback returns MG_FALSE, Mongoose closes connection
MG_CLOSE
,
// Connection is closed
MG_LUA
,
// Called before LSP page invoked
MG_HTTP_ERROR
// If callback returns MG_FALSE, Mongoose continues with err
};
typedef
int
(
*
mg_handler_t
)(
struct
mg_connection
*
,
enum
mg_event
);
...
...
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