Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
34735fab
Commit
34735fab
authored
Aug 28, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
client: no while loop in client_manager_io()
The last patch removed the "continue" directive, and now the while loop is without function. Remove it. Also make client_manager_io() return 0.
parent
f6a7dd2b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
32 deletions
+26
-32
client.c
src/client.c
+26
-32
No files found.
src/client.c
View file @
34735fab
...
@@ -476,50 +476,44 @@ int client_manager_io(void)
...
@@ -476,50 +476,44 @@ int client_manager_io(void)
fd_set
efds
;
fd_set
efds
;
struct
client
*
client
,
*
n
;
struct
client
*
client
,
*
n
;
int
selret
;
int
selret
;
int
fdmax
;
int
fdmax
=
0
;
while
(
1
)
{
FD_ZERO
(
&
efds
);
fdmax
=
0
;
client_manager_register_read_fd
(
&
rfds
,
&
fdmax
);
client_manager_register_write_fd
(
&
wfds
,
&
fdmax
);
FD_ZERO
(
&
efds
);
registered_IO_add_fds
(
&
fdmax
,
&
rfds
,
&
wfds
,
&
efds
);
client_manager_register_read_fd
(
&
rfds
,
&
fdmax
);
client_manager_register_write_fd
(
&
wfds
,
&
fdmax
);
registered_IO_add_fds
(
&
fdmax
,
&
rfds
,
&
wfds
,
&
efds
);
main_notify_lock
();
selret
=
select
(
fdmax
+
1
,
&
rfds
,
&
wfds
,
&
efds
,
NULL
);
main_notify_unlock
();
main_notify_lock
();
if
(
selret
<
0
)
{
selret
=
select
(
fdmax
+
1
,
&
rfds
,
&
wfds
,
&
efds
,
NULL
);
if
(
errno
==
EINTR
)
main_notify_unlock
()
;
return
0
;
if
(
selret
<
0
)
{
FATAL
(
"select() failed: %s
\n
"
,
strerror
(
errno
));
if
(
errno
==
EINTR
)
}
break
;
FATAL
(
"select() failed: %s
\n
"
,
strerror
(
errno
));
}
registered_IO_consume_fds
(
&
selret
,
&
rfds
,
&
wfds
,
&
efds
);
registered_IO_consume_fds
(
&
selret
,
&
rfds
,
&
wfds
,
&
efds
);
getConnections
(
&
rfds
);
getConnections
(
&
rfds
);
list_for_each_entry_safe
(
client
,
n
,
&
clients
,
siblings
)
{
list_for_each_entry_safe
(
client
,
n
,
&
clients
,
siblings
)
{
if
(
FD_ISSET
(
client
->
fd
,
&
rfds
))
{
if
(
FD_ISSET
(
client
->
fd
,
&
rfds
))
{
if
(
COMMAND_RETURN_KILL
==
if
(
COMMAND_RETURN_KILL
==
client_read
(
client
))
{
client_read
(
client
))
{
return
COMMAND_RETURN_KILL
;
return
COMMAND_RETURN_KILL
;
}
client
->
lastTime
=
time
(
NULL
);
}
if
(
FD_ISSET
(
client
->
fd
,
&
wfds
))
{
client_write_deferred
(
client
);
client
->
lastTime
=
time
(
NULL
);
}
}
client
->
lastTime
=
time
(
NULL
);
}
if
(
FD_ISSET
(
client
->
fd
,
&
wfds
))
{
client_write_deferred
(
client
);
client
->
lastTime
=
time
(
NULL
);
}
}
break
;
}
}
return
1
;
return
0
;
}
}
void
client_manager_init
(
void
)
void
client_manager_init
(
void
)
...
...
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