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
3eee35e1
Commit
3eee35e1
authored
Feb 25, 2017
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Client: convert partition to pointer
Prepare to make it mutable.
parent
c7396b06
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
13 deletions
+13
-13
Client.cxx
src/client/Client.cxx
+6
-6
Client.hxx
src/client/Client.hxx
+2
-2
ClientNew.cxx
src/client/ClientNew.cxx
+2
-2
ClientRead.cxx
src/client/ClientRead.cxx
+1
-1
ClientSubscribe.cxx
src/client/ClientSubscribe.cxx
+2
-2
No files found.
src/client/Client.cxx
View file @
3eee35e1
...
...
@@ -28,19 +28,19 @@ const Domain client_domain("client");
Instance
&
Client
::
GetInstance
()
{
return
partition
.
instance
;
return
partition
->
instance
;
}
playlist
&
Client
::
GetPlaylist
()
{
return
partition
.
playlist
;
return
partition
->
playlist
;
}
PlayerControl
&
Client
::
GetPlayerControl
()
{
return
partition
.
pc
;
return
partition
->
pc
;
}
#ifdef ENABLE_DATABASE
...
...
@@ -48,19 +48,19 @@ Client::GetPlayerControl()
const
Database
*
Client
::
GetDatabase
()
const
{
return
partition
.
instance
.
GetDatabase
();
return
partition
->
instance
.
GetDatabase
();
}
const
Database
&
Client
::
GetDatabaseOrThrow
()
const
{
return
partition
.
instance
.
GetDatabaseOrThrow
();
return
partition
->
instance
.
GetDatabaseOrThrow
();
}
const
Storage
*
Client
::
GetStorage
()
const
{
return
partition
.
instance
.
storage
;
return
partition
->
instance
.
storage
;
}
#endif
src/client/Client.hxx
View file @
3eee35e1
...
...
@@ -50,7 +50,7 @@ class Storage;
class
Client
final
:
FullyBufferedSocket
,
TimeoutMonitor
,
public
boost
::
intrusive
::
list_base_hook
<
boost
::
intrusive
::
link_mode
<
boost
::
intrusive
::
normal_link
>>
{
Partition
&
partition
;
Partition
*
partition
;
public
:
unsigned
permission
;
...
...
@@ -189,7 +189,7 @@ public:
void
AllowFile
(
Path
path_fs
)
const
;
Partition
&
GetPartition
()
{
return
partition
;
return
*
partition
;
}
gcc_pure
...
...
src/client/ClientNew.cxx
View file @
3eee35e1
...
...
@@ -45,7 +45,7 @@ Client::Client(EventLoop &_loop, Partition &_partition,
int
_fd
,
int
_uid
,
int
_num
)
:
FullyBufferedSocket
(
_fd
,
_loop
,
16384
,
client_max_output_buffer_size
),
TimeoutMonitor
(
_loop
),
partition
(
_partition
),
partition
(
&
_partition
),
permission
(
getDefaultPermissions
()),
uid
(
_uid
),
num
(
_num
),
...
...
@@ -107,7 +107,7 @@ client_new(EventLoop &loop, Partition &partition,
void
Client
::
Close
()
{
partition
.
instance
.
client_list
->
Remove
(
*
this
);
partition
->
instance
.
client_list
->
Remove
(
*
this
);
SetExpired
();
...
...
src/client/ClientRead.cxx
View file @
3eee35e1
...
...
@@ -52,7 +52,7 @@ Client::OnSocketInput(void *data, size_t length)
break
;
case
CommandResult
:
:
KILL
:
partition
.
instance
.
Shutdown
();
partition
->
instance
.
Shutdown
();
Close
();
return
InputResult
::
CLOSED
;
...
...
src/client/ClientSubscribe.cxx
View file @
3eee35e1
...
...
@@ -41,7 +41,7 @@ Client::Subscribe(const char *channel)
++
num_subscriptions
;
partition
.
EmitIdle
(
IDLE_SUBSCRIPTION
);
partition
->
EmitIdle
(
IDLE_SUBSCRIPTION
);
return
Client
::
SubscribeResult
::
OK
;
}
...
...
@@ -58,7 +58,7 @@ Client::Unsubscribe(const char *channel)
subscriptions
.
erase
(
i
);
--
num_subscriptions
;
partition
.
EmitIdle
(
IDLE_SUBSCRIPTION
);
partition
->
EmitIdle
(
IDLE_SUBSCRIPTION
);
assert
((
num_subscriptions
==
0
)
==
subscriptions
.
empty
());
...
...
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