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
19986337
Commit
19986337
authored
Jan 16, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ClientGlobal: move client_close_all() to ClientList.cxx
parent
0194217f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
32 deletions
+13
-32
ClientGlobal.cxx
src/ClientGlobal.cxx
+1
-12
ClientList.cxx
src/ClientList.cxx
+9
-14
ClientList.hxx
src/ClientList.hxx
+3
-6
No files found.
src/ClientGlobal.cxx
View file @
19986337
...
...
@@ -53,20 +53,9 @@ void client_manager_init(void)
*
1024
;
}
static
void
client_close_all
(
void
)
{
while
(
!
client_list_is_empty
())
{
Client
*
client
=
client_list_get_first
();
client
->
Close
();
}
assert
(
client_list_is_empty
());
}
void
client_manager_deinit
(
void
)
{
client_close_all
();
client_
list_
close_all
();
client_max_connections
=
0
;
}
src/ClientList.cxx
View file @
19986337
...
...
@@ -30,25 +30,11 @@ static std::list<Client *> clients;
static
unsigned
num_clients
;
bool
client_list_is_empty
(
void
)
{
return
num_clients
==
0
;
}
bool
client_list_is_full
(
void
)
{
return
num_clients
>=
client_max_connections
;
}
Client
*
client_list_get_first
(
void
)
{
assert
(
!
clients
.
empty
());
return
clients
.
front
();
}
void
client_list_add
(
Client
*
client
)
{
...
...
@@ -74,3 +60,12 @@ client_list_remove(Client *client)
clients
.
erase
(
i
);
--
num_clients
;
}
void
client_list_close_all
()
{
while
(
!
clients
.
empty
())
clients
.
front
()
->
Close
();
assert
(
num_clients
==
0
);
}
src/ClientList.hxx
View file @
19986337
...
...
@@ -23,14 +23,8 @@
class
Client
;
bool
client_list_is_empty
(
void
);
bool
client_list_is_full
(
void
);
Client
*
client_list_get_first
(
void
);
void
client_list_add
(
Client
*
client
);
...
...
@@ -40,4 +34,7 @@ client_list_foreach(void (*callback)(Client *client, void *ctx), void *ctx);
void
client_list_remove
(
Client
*
client
);
void
client_list_close_all
();
#endif
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