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
58ad3d6e
Commit
58ad3d6e
authored
9 years ago
by
Andy Green
Browse files
Options
Downloads
Patches
Plain Diff
clean libev.c style
Signed-off-by:
Andy Green
<
andy.green@linaro.org
>
parent
5783b1a1
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/libev.c
+19
-24
19 additions, 24 deletions
lib/libev.c
with
19 additions
and
24 deletions
lib/libev.c
+
19
−
24
View file @
58ad3d6e
...
...
@@ -32,10 +32,10 @@ void lws_feature_status_libev(struct lws_context_creation_info *info)
static
void
lws_accept_cb
(
struct
ev_loop
*
loop
,
struct
ev_io
*
watcher
,
int
revents
)
{
struct
lws_pollfd
eventfd
;
struct
lws_io_watcher
*
lws_io
=
container_of
(
watcher
,
struct
lws_io_watcher
,
watcher
);
struct
lws_context
*
context
=
lws_io
->
context
;
struct
lws_pollfd
eventfd
;
if
(
revents
&
EV_ERROR
)
return
;
...
...
@@ -60,31 +60,27 @@ lws_sigint_cb(struct ev_loop *loop, struct ev_signal *watcher, int revents)
ev_break
(
loop
,
EVBREAK_ALL
);
}
LWS_VISIBLE
int
lws_sigint_cfg
(
struct
lws_context
*
context
,
int
use_ev_sigint
,
lws_ev_signal_cb
*
cb
)
LWS_VISIBLE
int
lws_sigint_cfg
(
struct
lws_context
*
context
,
int
use_ev_sigint
,
lws_ev_signal_cb
*
cb
)
{
context
->
use_ev_sigint
=
use_ev_sigint
;
if
(
cb
)
{
if
(
cb
)
context
->
lws_ev_sigint_cb
=
cb
;
}
else
{
else
context
->
lws_ev_sigint_cb
=
&
lws_sigint_cb
;
};
return
0
;
}
;
}
LWS_VISIBLE
int
lws_initloop
(
struct
lws_context
*
context
,
struct
ev_loop
*
loop
)
lws_initloop
(
struct
lws_context
*
context
,
struct
ev_loop
*
loop
)
{
struct
ev_signal
*
w_sigint
=
&
context
->
w_sigint
.
watcher
;
struct
ev_io
*
w_accept
=
&
context
->
w_accept
.
watcher
;
const
char
*
backend_name
;
int
status
=
0
;
int
backend
;
const
char
*
backend_name
;
struct
ev_io
*
w_accept
=
&
context
->
w_accept
.
watcher
;
struct
ev_signal
*
w_sigint
=
&
context
->
w_sigint
.
watcher
;
if
(
!
loop
)
loop
=
ev_default_loop
(
0
);
...
...
@@ -93,17 +89,16 @@ lws_initloop(
/*
* Initialize the accept w_accept with the listening socket
* and register a callback for read operations
:
* and register a callback for read operations
*/
ev_io_init
(
w_accept
,
lws_accept_cb
,
context
->
lserv_fd
,
EV_READ
);
ev_io_init
(
w_accept
,
lws_accept_cb
,
context
->
lserv_fd
,
EV_READ
);
ev_io_start
(
context
->
io_loop
,
w_accept
);
/* Register the signal watcher unless the user
has indicated otherwise:
*/
if
(
context
->
use_ev_sigint
)
{
/* Register the signal watcher unless the user
says not to
*/
if
(
context
->
use_ev_sigint
)
{
ev_signal_init
(
w_sigint
,
context
->
lws_ev_sigint_cb
,
SIGINT
);
ev_signal_start
(
context
->
io_loop
,
w_sigint
);
}
;
}
backend
=
ev_backend
(
loop
);
switch
(
backend
)
{
...
...
@@ -128,7 +123,7 @@ lws_initloop(
default:
backend_name
=
"Unknown libev backend"
;
break
;
}
;
}
lwsl_notice
(
" libev backend: %s
\n
"
,
backend_name
);
...
...
@@ -163,7 +158,7 @@ lws_libev_io(struct lws *wsi, int flags)
return
;
assert
((
flags
&
(
LWS_EV_START
|
LWS_EV_STOP
))
&&
(
flags
&
(
LWS_EV_READ
|
LWS_EV_WRITE
)));
(
flags
&
(
LWS_EV_READ
|
LWS_EV_WRITE
)));
if
(
flags
&
LWS_EV_START
)
{
if
(
flags
&
LWS_EV_WRITE
)
...
...
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