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
and
there
.
Show more breadcrumbs
Ganil-acq
GANILinux
linux-service
library
mongoose
Commits
6a46244a
Commit
6a46244a
authored
11 years ago
by
Sergey Lyubka
Browse files
Options
Downloads
Patches
Plain Diff
embedding guide for MG_POLL fixed
parent
60674c11
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
docs/Embed.md
+10
-6
10 additions, 6 deletions
docs/Embed.md
with
10 additions
and
6 deletions
docs/Embed.md
+
10
−
6
View file @
6a46244a
...
...
@@ -71,16 +71,20 @@ The sequence of events for every connection is this:
certain prefix, and let Mongoose serve all static files.
If event handler decides to serve the request, but doesn't have
all the data at the moment, it should return
`MG_MORE`
. That tells
Mongoose to
send
`MG_POLL`
events on each iteration of
`mg_poll_server()`
Mongoose to
keep the connection open after callback returns.
`mg_connection::connection_param` pointer is a placeholder to keep
user-specific data. For example, handler could decide to open a DB
connection and store DB connection handle in `connection_param`.
*
`MG_POLL`
is sent only to those connections which returned
`MG_MORE`
.
Event handler should try to complete the reply. If reply is completed,
then event handler should return
`MG_TRUE`
. Otherwise, it should
return
`MG_FALSE`
, and polling will continue until
handler returns
`MG_TRUE`
.
*
`MG_POLL`
is sent to every connection on every iteration of
`mg_poll_server()`
. Event handler should return
`MG_FALSE`
to ignore
this event. If event handler returns
`MG_TRUE`
, then Mongoose assumes
that event handler has finished sending data, and Mongoose will
close the connection.
*
`MG_HTTP_ERROR`
sent when Mongoose is about to send HTTP error back
to the client. Event handler can choose to send a reply itself, in which
case event handler must return
`MG_TRUE`
. Otherwise, event handler must
return
`MG_FALSE`
*
`MG_CLOSE`
is sent when the connection is closed. This event is used
to cleanup per-connection state stored in
`connection_param`
if it was allocated.
...
...
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