Skip to main content
Homepage
Explore
Search or go to…
/
Sign in
Explore
Primary navigation
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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Collapse sidebar
Snippets
Groups
Projects
Show more breadcrumbs
Fork
libwebsockets
Commits
58ad3d6e
This project is archived. Its data is
read-only
.
Commit
58ad3d6e
authored
Jan 9, 2016
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
No related branches found
No related tags found
No related merge requests found
Changes
1
Show 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)
...
@@ -32,10 +32,10 @@ void lws_feature_status_libev(struct lws_context_creation_info *info)
static
void
static
void
lws_accept_cb
(
struct
ev_loop
*
loop
,
struct
ev_io
*
watcher
,
int
revents
)
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
*
lws_io
=
container_of
(
watcher
,
struct
lws_io_watcher
,
watcher
);
struct
lws_io_watcher
,
watcher
);
struct
lws_context
*
context
=
lws_io
->
context
;
struct
lws_context
*
context
=
lws_io
->
context
;
struct
lws_pollfd
eventfd
;
if
(
revents
&
EV_ERROR
)
if
(
revents
&
EV_ERROR
)
return
;
return
;
...
@@ -60,31 +60,27 @@ lws_sigint_cb(struct ev_loop *loop, struct ev_signal *watcher, int revents)
...
@@ -60,31 +60,27 @@ lws_sigint_cb(struct ev_loop *loop, struct ev_signal *watcher, int revents)
ev_break
(
loop
,
EVBREAK_ALL
);
ev_break
(
loop
,
EVBREAK_ALL
);
}
}
LWS_VISIBLE
int
lws_sigint_cfg
(
LWS_VISIBLE
int
struct
lws_context
*
context
,
lws_sigint_cfg
(
struct
lws_context
*
context
,
int
use_ev_sigint
,
int
use_ev_sigint
,
lws_ev_signal_cb
*
cb
)
lws_ev_signal_cb
*
cb
)
{
{
context
->
use_ev_sigint
=
use_ev_sigint
;
context
->
use_ev_sigint
=
use_ev_sigint
;
if
(
cb
)
{
if
(
cb
)
context
->
lws_ev_sigint_cb
=
cb
;
context
->
lws_ev_sigint_cb
=
cb
;
}
else
else
{
context
->
lws_ev_sigint_cb
=
&
lws_sigint_cb
;
context
->
lws_ev_sigint_cb
=
&
lws_sigint_cb
;
};
return
0
;
return
0
;
}
;
}
LWS_VISIBLE
int
LWS_VISIBLE
int
lws_initloop
(
lws_initloop
(
struct
lws_context
*
context
,
struct
ev_loop
*
loop
)
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
status
=
0
;
int
backend
;
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
)
if
(
!
loop
)
loop
=
ev_default_loop
(
0
);
loop
=
ev_default_loop
(
0
);
...
@@ -93,17 +89,16 @@ lws_initloop(
...
@@ -93,17 +89,16 @@ lws_initloop(
/*
/*
* Initialize the accept w_accept with the listening socket
* 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
,
ev_io_init
(
w_accept
,
lws_accept_cb
,
context
->
lserv_fd
,
EV_READ
);
context
->
lserv_fd
,
EV_READ
);
ev_io_start
(
context
->
io_loop
,
w_accept
);
ev_io_start
(
context
->
io_loop
,
w_accept
);
/* Register the signal watcher unless the user
has indicated otherwise:
*/
/* Register the signal watcher unless the user
says not to
*/
if
(
context
->
use_ev_sigint
)
{
if
(
context
->
use_ev_sigint
)
{
ev_signal_init
(
w_sigint
,
context
->
lws_ev_sigint_cb
,
SIGINT
);
ev_signal_init
(
w_sigint
,
context
->
lws_ev_sigint_cb
,
SIGINT
);
ev_signal_start
(
context
->
io_loop
,
w_sigint
);
ev_signal_start
(
context
->
io_loop
,
w_sigint
);
}
;
}
backend
=
ev_backend
(
loop
);
backend
=
ev_backend
(
loop
);
switch
(
backend
)
{
switch
(
backend
)
{
...
@@ -128,7 +123,7 @@ lws_initloop(
...
@@ -128,7 +123,7 @@ lws_initloop(
default:
default:
backend_name
=
"Unknown libev backend"
;
backend_name
=
"Unknown libev backend"
;
break
;
break
;
}
;
}
lwsl_notice
(
" libev backend: %s
\n
"
,
backend_name
);
lwsl_notice
(
" libev backend: %s
\n
"
,
backend_name
);
...
...
...
...
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
sign in
to comment