Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libwebsockets
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Fork
libwebsockets
Commits
54cb3463
Commit
54cb3463
authored
12 years ago
by
Andy Green
Browse files
Options
Downloads
Patches
Plain Diff
introduce LWS_CALLBACK_HTTP_WRITEABLE
Signed-off-by:
Andy Green
<
andy.green@linaro.org
>
parent
adc71469
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
changelog
+10
-0
10 additions, 0 deletions
changelog
lib/libwebsockets.h
+4
-0
4 additions, 0 deletions
lib/libwebsockets.h
lib/server.c
+12
-1
12 additions, 1 deletion
lib/server.c
with
26 additions
and
1 deletion
changelog
+
10
−
0
View file @
54cb3463
Changelog
Changelog
---------
---------
(development since 1.22)
User api additions
------------------
- You can now call libwebsocket_callback_on_writable() on http connectons,
and get a LWS_CALLBACK_HTTP_WRITEABLE callback, the same way you can
regulate writes with a websocket protocol connection.
v1.21-chrome26-firefox18
v1.21-chrome26-firefox18
========================
========================
...
...
This diff is collapsed.
Click to expand it.
lib/libwebsockets.h
+
4
−
0
View file @
54cb3463
...
@@ -134,6 +134,7 @@ enum libwebsocket_callback_reasons {
...
@@ -134,6 +134,7 @@ enum libwebsocket_callback_reasons {
LWS_CALLBACK_SERVER_WRITEABLE
,
LWS_CALLBACK_SERVER_WRITEABLE
,
LWS_CALLBACK_HTTP
,
LWS_CALLBACK_HTTP
,
LWS_CALLBACK_HTTP_FILE_COMPLETION
,
LWS_CALLBACK_HTTP_FILE_COMPLETION
,
LWS_CALLBACK_HTTP_WRITEABLE
,
LWS_CALLBACK_FILTER_NETWORK_CONNECTION
,
LWS_CALLBACK_FILTER_NETWORK_CONNECTION
,
LWS_CALLBACK_FILTER_PROTOCOL_CONNECTION
,
LWS_CALLBACK_FILTER_PROTOCOL_CONNECTION
,
LWS_CALLBACK_OPENSSL_LOAD_EXTRA_CLIENT_VERIFY_CERTS
,
LWS_CALLBACK_OPENSSL_LOAD_EXTRA_CLIENT_VERIFY_CERTS
,
...
@@ -436,6 +437,9 @@ struct libwebsocket_extension;
...
@@ -436,6 +437,9 @@ struct libwebsocket_extension;
* total number of client connections allowed set
* total number of client connections allowed set
* by MAX_CLIENTS.
* by MAX_CLIENTS.
*
*
* LWS_CALLBACK_HTTP_WRITEABLE: you can write more down the http protocol
* link now.
*
* LWS_CALLBACK_HTTP_FILE_COMPLETION: a file requested to be send down
* LWS_CALLBACK_HTTP_FILE_COMPLETION: a file requested to be send down
* http link has completed.
* http link has completed.
*
*
...
...
This diff is collapsed.
Click to expand it.
lib/server.c
+
12
−
1
View file @
54cb3463
...
@@ -192,8 +192,19 @@ int lws_server_socket_service(struct libwebsocket_context *context,
...
@@ -192,8 +192,19 @@ int lws_server_socket_service(struct libwebsocket_context *context,
/* one shot */
/* one shot */
pollfd
->
events
&=
~
POLLOUT
;
pollfd
->
events
&=
~
POLLOUT
;
if
(
wsi
->
state
!=
WSI_STATE_HTTP_ISSUING_FILE
)
if
(
wsi
->
state
!=
WSI_STATE_HTTP_ISSUING_FILE
)
{
n
=
user_callback_handle_rxflow
(
wsi
->
protocol
->
callback
,
wsi
->
protocol
->
owning_server
,
wsi
,
LWS_CALLBACK_HTTP_WRITEABLE
,
wsi
->
user_space
,
NULL
,
0
);
if
(
n
<
0
)
libwebsocket_close_and_free_session
(
context
,
wsi
,
LWS_CLOSE_STATUS_NOSTATUS
);
break
;
break
;
}
/* nonzero for completion or error */
/* nonzero for completion or error */
if
(
libwebsockets_serve_http_file_fragment
(
context
,
wsi
))
if
(
libwebsockets_serve_http_file_fragment
(
context
,
wsi
))
...
...
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