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
1040b857
Commit
1040b857
authored
Nov 14, 2017
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lib/{curl,upnp}: add more exception handlers
Bugs found by Coverity.
parent
e2c81aa9
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
13 deletions
+25
-13
Request.cxx
src/lib/curl/Request.cxx
+1
-1
Request.hxx
src/lib/curl/Request.hxx
+1
-1
Discovery.cxx
src/lib/upnp/Discovery.cxx
+12
-8
Discovery.hxx
src/lib/upnp/Discovery.hxx
+6
-2
CurlStorage.cxx
src/storage/plugins/CurlStorage.cxx
+5
-1
No files found.
src/lib/curl/Request.cxx
View file @
1040b857
...
...
@@ -72,7 +72,7 @@ CurlRequest::~CurlRequest() noexcept
}
void
CurlRequest
::
Start
()
noexcept
CurlRequest
::
Start
()
{
assert
(
!
registered
);
...
...
src/lib/curl/Request.hxx
View file @
1040b857
...
...
@@ -91,7 +91,7 @@ public:
*
* This method must be called in the event loop thread.
*/
void
Start
()
noexcept
;
void
Start
();
/**
* Unregister this request via CurlGlobal::Remove().
...
...
src/lib/upnp/Discovery.cxx
View file @
1040b857
...
...
@@ -174,15 +174,19 @@ UPnPDeviceDirectory::OnAlive(Upnp_Discovery *disco) noexcept
{
if
(
isMSDevice
(
disco
->
DeviceType
)
||
isCDService
(
disco
->
ServiceType
))
{
auto
*
downloader
=
new
Downloader
(
*
this
,
*
disco
);
try
{
downloader
->
Start
();
}
catch
(...)
{
BlockingCall
(
GetEventLoop
(),
[
downloader
](){
downloader
->
Destroy
();
});
auto
*
downloader
=
new
Downloader
(
*
this
,
*
disco
);
try
{
downloader
->
Start
();
}
catch
(...)
{
BlockingCall
(
GetEventLoop
(),
[
downloader
](){
downloader
->
Destroy
();
});
throw
;
}
}
catch
(...)
{
LogError
(
std
::
current_exception
());
return
UPNP_E_SUCCESS
;
}
...
...
@@ -251,7 +255,7 @@ UPnPDeviceDirectory::ExpireDevices()
UPnPDeviceDirectory
::
UPnPDeviceDirectory
(
EventLoop
&
event_loop
,
UpnpClient_Handle
_handle
,
UPnPDiscoveryListener
*
_listener
)
noexcept
UPnPDiscoveryListener
*
_listener
)
:
curl
(
event_loop
),
handle
(
_handle
),
listener
(
_listener
)
{
...
...
src/lib/upnp/Discovery.hxx
View file @
1040b857
...
...
@@ -110,7 +110,11 @@ class UPnPDeviceDirectory final : UpnpCallback {
private
:
void
OnDeferredStart
()
noexcept
{
request
.
Start
();
try
{
request
.
Start
();
}
catch
(...)
{
OnError
(
std
::
current_exception
());
}
}
/* virtual methods from CurlResponseHandler */
...
...
@@ -147,7 +151,7 @@ class UPnPDeviceDirectory final : UpnpCallback {
public
:
UPnPDeviceDirectory
(
EventLoop
&
event_loop
,
UpnpClient_Handle
_handle
,
UPnPDiscoveryListener
*
_listener
=
nullptr
)
noexcept
;
UPnPDiscoveryListener
*
_listener
=
nullptr
);
~
UPnPDeviceDirectory
()
noexcept
;
UPnPDeviceDirectory
(
const
UPnPDeviceDirectory
&
)
=
delete
;
...
...
src/storage/plugins/CurlStorage.cxx
View file @
1040b857
...
...
@@ -140,7 +140,11 @@ private:
void
OnDeferredStart
()
noexcept
{
assert
(
!
done
);
request
.
Start
();
try
{
request
.
Start
();
}
catch
(...)
{
OnError
(
std
::
current_exception
());
}
}
/* virtual methods from CurlResponseHandler */
...
...
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