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
7d699ea7
Commit
7d699ea7
authored
Jan 14, 2014
by
Sergey Lyubka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added URI handler return value
parent
fc37b081
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
API.md
docs/API.md
+8
-1
No files found.
docs/API.md
View file @
7d699ea7
...
@@ -82,7 +82,14 @@ whether the request is websocket or not. Also, for websocket requests,
...
@@ -82,7 +82,14 @@ whether the request is websocket or not. Also, for websocket requests,
there is
`struct mg_connection::wsbits`
field which contains first byte
there is
`struct mg_connection::wsbits`
field which contains first byte
of the websocket frame which URI handler can examine. Note that to
of the websocket frame which URI handler can examine. Note that to
reply to the websocket client,
`mg_websocket_write()`
should be used.
reply to the websocket client,
`mg_websocket_write()`
should be used.
To reply to the plain HTTP client,
`mg_write()`
should be used.
To reply to the plain HTTP client,
`mg_write_data()`
should be used.
An URI handler must return a value. If 0 is return, that signals Mongoose
that URI handler hasn't finished sending data to the client. In this case,
Mongoose will call URI handler after each successful socket write.
`struct mg_connection::wsbits`
flag will indicate the status of the write,
`1`
means that write has failed and connection will be closed. If URI
handler has sent all data, it should return
`1`
.
void mg_set_http_error_handler(struct mg_server *, mg_handler_t);
void mg_set_http_error_handler(struct mg_server *, mg_handler_t);
...
...
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