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
c7c087a0
Commit
c7c087a0
authored
Jan 24, 2018
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
input/tidal: add some debug logging
parent
3461580b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
0 deletions
+16
-0
TidalInputPlugin.cxx
src/input/plugins/TidalInputPlugin.cxx
+7
-0
TidalSessionManager.cxx
src/input/plugins/TidalSessionManager.cxx
+9
-0
No files found.
src/input/plugins/TidalInputPlugin.cxx
View file @
c7c087a0
...
...
@@ -28,11 +28,15 @@
#include "input/InputPlugin.hxx"
#include "config/Block.hxx"
#include "thread/Mutex.hxx"
#include "util/Domain.hxx"
#include "util/StringCompare.hxx"
#include "Log.hxx"
#include <stdexcept>
#include <memory>
static
constexpr
Domain
tidal_domain
(
"tidal"
);
static
TidalSessionManager
*
tidal_session
;
class
TidalInputStream
final
...
...
@@ -100,6 +104,9 @@ TidalInputStream::OnTidalSession() noexcept
void
TidalInputStream
::
OnTidalTrackSuccess
(
std
::
string
url
)
noexcept
{
FormatDebug
(
tidal_domain
,
"Tidal track '%s' resolves to %s"
,
track_id
.
c_str
(),
url
.
c_str
());
const
std
::
lock_guard
<
Mutex
>
protect
(
mutex
);
track_request
.
reset
();
...
...
src/input/plugins/TidalSessionManager.cxx
View file @
c7c087a0
...
...
@@ -20,6 +20,11 @@
#include "config.h"
#include "TidalSessionManager.hxx"
#include "lib/curl/Global.hxx"
#include "util/Domain.hxx"
#include "Log.hxx"
static
constexpr
Domain
tidal_domain
(
"tidal"
);
TidalSessionManager
::
TidalSessionManager
(
EventLoop
&
event_loop
,
const
char
*
_base_url
,
const
char
*
_token
,
...
...
@@ -53,6 +58,8 @@ TidalSessionManager::AddLoginHandler(TidalSessionHandler &h) noexcept
if
(
session
.
empty
())
{
// TODO: throttle login attempts?
LogDebug
(
tidal_domain
,
"Sending login request"
);
std
::
string
login_uri
(
base_url
);
login_uri
+=
"/login/username"
;
...
...
@@ -76,6 +83,8 @@ TidalSessionManager::AddLoginHandler(TidalSessionHandler &h) noexcept
void
TidalSessionManager
::
OnTidalLoginSuccess
(
std
::
string
_session
)
noexcept
{
FormatDebug
(
tidal_domain
,
"Login successful, session=%s"
,
_session
.
c_str
());
{
const
std
::
lock_guard
<
Mutex
>
protect
(
mutex
);
login_request
.
reset
();
...
...
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