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
72621531
Commit
72621531
authored
Oct 22, 2021
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
protocol/Result: convert to Client method
parent
0a48146e
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
8 additions
and
62 deletions
+8
-62
meson.build
meson.build
+0
-1
Client.hxx
src/client/Client.hxx
+4
-0
Process.cxx
src/client/Process.cxx
+3
-4
ThreadBackgroundCommand.cxx
src/client/ThreadBackgroundCommand.cxx
+1
-2
Result.cxx
src/protocol/Result.cxx
+0
-27
Result.hxx
src/protocol/Result.hxx
+0
-28
No files found.
meson.build
View file @
72621531
...
...
@@ -265,7 +265,6 @@ sources = [
version_cxx,
'src/Main.cxx',
'src/protocol/ArgParser.cxx',
'src/protocol/Result.cxx',
'src/command/CommandError.cxx',
'src/command/PositionArg.cxx',
'src/command/AllCommands.cxx',
...
...
src/client/Client.hxx
View file @
72621531
...
...
@@ -154,6 +154,10 @@ public:
return
Write
(
s
.
data
(),
s
.
size
());
}
bool
WriteOK
()
noexcept
{
return
Write
(
"OK
\n
"
);
}
/**
* returns the uid of the client process, or a negative value
* if the uid is unknown
...
...
src/client/Process.cxx
View file @
72621531
...
...
@@ -20,7 +20,6 @@
#include "Client.hxx"
#include "Config.hxx"
#include "Domain.hxx"
#include "protocol/Result.hxx"
#include "command/AllCommands.hxx"
#include "Log.hxx"
#include "util/StringAPI.hxx"
...
...
@@ -72,7 +71,7 @@ Client::ProcessLine(char *line) noexcept
if
(
idle_waiting
)
{
/* send empty idle response and leave idle mode */
idle_waiting
=
false
;
command_success
(
*
this
);
WriteOK
(
);
}
/* do nothing if the client wasn't idling: the client
...
...
@@ -108,7 +107,7 @@ Client::ProcessLine(char *line) noexcept
"list returned {}"
,
id
,
unsigned
(
ret
));
if
(
ret
==
CommandResult
::
OK
)
command_success
(
*
this
);
WriteOK
(
);
return
ret
;
}
else
{
...
...
@@ -144,7 +143,7 @@ Client::ProcessLine(char *line) noexcept
return
CommandResult
::
CLOSE
;
if
(
ret
==
CommandResult
::
OK
)
command_success
(
*
this
);
WriteOK
(
);
return
ret
;
}
...
...
src/client/ThreadBackgroundCommand.cxx
View file @
72621531
...
...
@@ -21,7 +21,6 @@
#include "Client.hxx"
#include "Response.hxx"
#include "command/CommandError.hxx"
#include "protocol/Result.hxx"
ThreadBackgroundCommand
::
ThreadBackgroundCommand
(
Client
&
_client
)
noexcept
:
thread
(
BIND_THIS_METHOD
(
_Run
)),
...
...
@@ -57,7 +56,7 @@ ThreadBackgroundCommand::DeferredFinish() noexcept
PrintError
(
response
,
error
);
}
else
{
SendResponse
(
response
);
c
ommand_success
(
client
);
c
lient
.
WriteOK
(
);
}
/* delete this object */
...
...
src/protocol/Result.cxx
deleted
100644 → 0
View file @
0a48146e
/*
* Copyright 2003-2021 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "Result.hxx"
#include "client/Client.hxx"
void
command_success
(
Client
&
client
)
{
client
.
Write
(
"OK
\n
"
);
}
src/protocol/Result.hxx
deleted
100644 → 0
View file @
0a48146e
/*
* Copyright 2003-2021 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPD_PROTOCOL_RESULT_HXX
#define MPD_PROTOCOL_RESULT_HXX
class
Client
;
void
command_success
(
Client
&
client
);
#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