Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tg
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
tg
Commits
1831415f
Commit
1831415f
authored
Sep 21, 2014
by
vvaltman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes for listening socket
parent
0a78c370
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
loop.c
loop.c
+3
-2
No files found.
loop.c
View file @
1831415f
...
@@ -633,11 +633,12 @@ static void event_incoming (struct bufferevent *bev, short what, void *_arg) {
...
@@ -633,11 +633,12 @@ static void event_incoming (struct bufferevent *bev, short what, void *_arg) {
close
(
ev
->
fd
);
close
(
ev
->
fd
);
bufferevent_free
(
bev
);
bufferevent_free
(
bev
);
ev
->
bev
=
0
;
ev
->
bev
=
0
;
ev
->
refcnt
--
;
if
(
!--
ev
->
refcnt
)
{
free
(
ev
);
}
}
}
}
}
static
void
accept_incoming
(
evutil_socket_t
efd
,
short
what
,
void
*
arg
)
{
static
void
accept_incoming
(
evutil_socket_t
efd
,
short
what
,
void
*
arg
)
{
vlogprintf
(
E_WARNING
,
"Accepting incoming connection
\n
"
);
unsigned
clilen
;
unsigned
clilen
;
struct
sockaddr_in
cli_addr
;
struct
sockaddr_in
cli_addr
;
int
fd
=
accept
(
sfd
,
(
struct
sockaddr
*
)
&
cli_addr
,
&
clilen
);
int
fd
=
accept
(
sfd
,
(
struct
sockaddr
*
)
&
cli_addr
,
&
clilen
);
...
@@ -682,7 +683,7 @@ int loop (void) {
...
@@ -682,7 +683,7 @@ int loop (void) {
#endif
#endif
if
(
sfd
>=
0
)
{
if
(
sfd
>=
0
)
{
struct
event
*
ev
=
event_new
(
tgl_state
.
ev_base
,
sfd
,
EV_READ
,
accept_incoming
,
0
);
struct
event
*
ev
=
event_new
(
tgl_state
.
ev_base
,
sfd
,
EV_READ
|
EV_PERSIST
,
accept_incoming
,
0
);
event_add
(
ev
,
0
);
event_add
(
ev
,
0
);
}
}
update_prompt
();
update_prompt
();
...
...
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