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
686a5321
Commit
686a5321
authored
Mar 18, 2016
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
db/proxy: use AtScopeExit()
parent
6190da13
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
ProxyDatabasePlugin.cxx
src/db/plugins/ProxyDatabasePlugin.cxx
+9
-2
No files found.
src/db/plugins/ProxyDatabasePlugin.cxx
View file @
686a5321
...
...
@@ -35,6 +35,7 @@
#include "tag/Tag.hxx"
#include "util/Error.hxx"
#include "util/Domain.hxx"
#include "util/ScopeExit.hxx"
#include "protocol/Ack.hxx"
#include "event/SocketMonitor.hxx"
#include "event/IdleMonitor.hxx"
...
...
@@ -233,6 +234,10 @@ CheckError(struct mpd_connection *connection, Error &error)
if
(
code
==
MPD_ERROR_SUCCESS
)
return
true
;
AtScopeExit
(
connection
)
{
mpd_connection_clear_error
(
connection
);
};
if
(
code
==
MPD_ERROR_SERVER
)
{
/* libmpdclient's "enum mpd_server_error" is the same
as our "enum ack" */
...
...
@@ -245,7 +250,6 @@ CheckError(struct mpd_connection *connection, Error &error)
mpd_connection_get_error_message
(
connection
));
}
mpd_connection_clear_error
(
connection
);
return
false
;
}
...
...
@@ -786,6 +790,10 @@ ProxyDatabase::VisitUniqueTags(const DatabaseSelection &selection,
struct
mpd_pair
*
pair
;
while
(
result
&&
(
pair
=
mpd_recv_pair_tag
(
connection
,
tag_type2
))
!=
nullptr
)
{
AtScopeExit
(
this
,
pair
)
{
mpd_return_pair
(
connection
,
pair
);
};
TagBuilder
tag
;
tag
.
AddItem
(
tag_type
,
pair
->
value
);
...
...
@@ -798,7 +806,6 @@ ProxyDatabase::VisitUniqueTags(const DatabaseSelection &selection,
tag
.
AddEmptyItem
(
tag_type
);
result
=
visit_tag
(
tag
.
Commit
(),
error
);
mpd_return_pair
(
connection
,
pair
);
}
return
mpd_response_finish
(
connection
)
&&
...
...
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