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
cf7ed8c5
Commit
cf7ed8c5
authored
Oct 15, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
idle: client command "noidle" aborts idle
parent
6eb62e47
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
5 deletions
+25
-5
COMMANDS
doc/COMMANDS
+4
-2
client.c
src/client.c
+21
-3
No files found.
doc/COMMANDS
View file @
cf7ed8c5
...
...
@@ -282,8 +282,10 @@ idle
While a client waits for "idle" results, the server disables
timeouts, allowing a client to wait for events as long as mpd
runs. The "idle" command can be canceled by sending a new
command.
runs. The "idle" command can be canceled by sending the
command "noidle" (no other commands are allowed). MPD will
then leave "idle" mode and print results immediately; might be
empty at this time.
COMMAND LIST
...
...
src/client.c
View file @
cf7ed8c5
...
...
@@ -345,6 +345,27 @@ static int client_process_line(struct client *client, char *line)
{
int
ret
=
1
;
if
(
strcmp
(
line
,
"noidle"
)
==
0
)
{
if
(
client
->
idle_waiting
)
{
/* send empty idle response and leave idle mode */
client
->
idle_waiting
=
false
;
command_success
(
client
);
client_write_output
(
client
);
}
/* do nothing if the client wasn't idling: the client
has already received the full idle response from
client_idle_notify(), which he can now evaluate */
return
0
;
}
else
if
(
client
->
idle_waiting
)
{
/* during idle mode, clients must not send anything
except "noidle" */
ERROR
(
"client %i: command
\"
%s
\"
during idle
\n
"
,
client
->
num
,
line
);
return
COMMAND_RETURN_CLOSE
;
}
if
(
client
->
cmd_list_OK
>=
0
)
{
if
(
strcmp
(
line
,
CLIENT_LIST_MODE_END
)
==
0
)
{
DEBUG
(
"client %i: process command "
...
...
@@ -418,9 +439,6 @@ static int client_input_received(struct client *client, int bytesRead)
char
*
newline
,
*
next
;
int
ret
;
/* any input from the client makes it leave "idle" mode */
client
->
idle_waiting
=
false
;
client
->
bufferLength
+=
bytesRead
;
/* process all lines */
...
...
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