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
d4b14ca3
Commit
d4b14ca3
authored
11 years ago
by
Sergey Lyubka
Browse files
Options
Downloads
Patches
Plain Diff
Better API documentation
parent
f0994896
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
docs/API.md
+6
-2
6 additions, 2 deletions
docs/API.md
mongoose.h
+1
-1
1 addition, 1 deletion
mongoose.h
with
7 additions
and
3 deletions
docs/API.md
+
6
−
2
View file @
d4b14ca3
...
...
@@ -84,10 +84,10 @@ occur. Sequence of events for the accepted connection is this:
*
`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`
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.
if it was allocated.
Event handler return value is ignored.
Sequence of events for the client connection is this:
...
...
@@ -96,7 +96,11 @@ Sequence of events for the client connection is this:
Connection status is held in
`mg_connection::status_code`
: if zero,
then connection was successful, otherwise connection was not established.
User should send a request upon successful connection.
Event handler should return
`MG_TRUE`
if connection was successful and
HTTP request has been sent. Otherwise, it should send
`MG_FALSE`
.
*
`MG_REPLY`
is sent when response has been received from the remote host.
If event handler sends another request, then it should return
`MG_TRUE`
.
Otherwise it should return
`MG_FALSE`
and Mongoose will close the connection.
*
`MG_CLOSE`
same as for the accepted connection.
...
...
This diff is collapsed.
Click to expand it.
mongoose.h
+
1
−
1
View file @
d4b14ca3
...
...
@@ -66,7 +66,7 @@ enum mg_event {
MG_AUTH
,
// If callback returns MG_FALSE, authentication fails
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_CLOSE
,
// Connection is closed
, callback return value is ignored
MG_LUA
,
// Called before LSP page invoked
MG_HTTP_ERROR
// If callback returns MG_FALSE, Mongoose continues with err
};
...
...
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