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
8b65b524
Commit
8b65b524
authored
Dec 31, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output/httpd: use reference instead of pointer
parent
f1ac2cd3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
14 deletions
+14
-14
HttpdClient.cxx
src/output/HttpdClient.cxx
+11
-11
HttpdClient.hxx
src/output/HttpdClient.hxx
+2
-2
HttpdOutputPlugin.cxx
src/output/HttpdOutputPlugin.cxx
+1
-1
No files found.
src/output/HttpdClient.cxx
View file @
8b65b524
...
...
@@ -48,13 +48,13 @@ HttpdClient::~HttpdClient()
void
HttpdClient
::
Close
()
{
httpd
->
RemoveClient
(
*
this
);
httpd
.
RemoveClient
(
*
this
);
}
void
HttpdClient
::
LockClose
()
{
const
ScopeLock
protect
(
httpd
->
mutex
);
const
ScopeLock
protect
(
httpd
.
mutex
);
Close
();
}
...
...
@@ -67,7 +67,7 @@ HttpdClient::BeginResponse()
current_page
=
nullptr
;
if
(
!
head_method
)
httpd
->
SendHeader
(
*
this
);
httpd
.
SendHeader
(
*
this
);
}
/**
...
...
@@ -155,13 +155,13 @@ HttpdClient::SendResponse()
"realTimeInfo.dlna.org: DLNA.ORG_TLAG=*
\r\n
"
"contentFeatures.dlna.org: DLNA.ORG_OP=01;DLNA.ORG_CI=0
\r\n
"
"
\r\n
"
,
httpd
->
content_type
);
httpd
.
content_type
);
}
else
if
(
metadata_requested
)
{
char
*
metadata_header
=
icy_server_metadata_header
(
httpd
->
name
,
httpd
->
genre
,
httpd
->
website
,
httpd
->
content_type
,
icy_server_metadata_header
(
httpd
.
name
,
httpd
.
genre
,
httpd
.
website
,
httpd
.
content_type
,
metaint
);
g_strlcpy
(
buffer
,
metadata_header
,
sizeof
(
buffer
));
...
...
@@ -176,7 +176,7 @@ HttpdClient::SendResponse()
"Pragma: no-cache
\r\n
"
"Cache-Control: no-cache, no-store
\r\n
"
"
\r\n
"
,
httpd
->
content_type
);
httpd
.
content_type
);
}
ssize_t
nbytes
=
SocketMonitor
::
Write
(
buffer
,
strlen
(
buffer
));
...
...
@@ -192,7 +192,7 @@ HttpdClient::SendResponse()
return
true
;
}
HttpdClient
::
HttpdClient
(
HttpdOutput
*
_httpd
,
int
_fd
,
EventLoop
&
_loop
,
HttpdClient
::
HttpdClient
(
HttpdOutput
&
_httpd
,
int
_fd
,
EventLoop
&
_loop
,
bool
_metadata_supported
)
:
BufferedSocket
(
_fd
,
_loop
),
httpd
(
_httpd
),
...
...
@@ -262,7 +262,7 @@ HttpdClient::GetBytesTillMetaData() const
inline
bool
HttpdClient
::
TryWrite
()
{
const
ScopeLock
protect
(
httpd
->
mutex
);
const
ScopeLock
protect
(
httpd
.
mutex
);
assert
(
state
==
RESPONSE
);
...
...
@@ -270,7 +270,7 @@ HttpdClient::TryWrite()
if
(
pages
.
empty
())
{
/* another thread has removed the event source
while this thread was waiting for
httpd
->
mutex */
httpd
.
mutex */
CancelWrite
();
return
true
;
}
...
...
src/output/HttpdClient.hxx
View file @
8b65b524
...
...
@@ -34,7 +34,7 @@ class HttpdClient final : BufferedSocket {
/**
* The httpd output object this client is connected to.
*/
HttpdOutput
*
const
httpd
;
HttpdOutput
&
httpd
;
/**
* The current state of the client.
...
...
@@ -120,7 +120,7 @@ public:
* @param httpd the HTTP output device
* @param fd the socket file descriptor
*/
HttpdClient
(
HttpdOutput
*
httpd
,
int
_fd
,
EventLoop
&
_loop
,
HttpdClient
(
HttpdOutput
&
httpd
,
int
_fd
,
EventLoop
&
_loop
,
bool
_metadata_supported
);
/**
...
...
src/output/HttpdOutputPlugin.cxx
View file @
8b65b524
...
...
@@ -179,7 +179,7 @@ httpd_output_finish(struct audio_output *ao)
inline
void
HttpdOutput
::
AddClient
(
int
fd
)
{
clients
.
emplace_front
(
this
,
fd
,
GetEventLoop
(),
clients
.
emplace_front
(
*
this
,
fd
,
GetEventLoop
(),
encoder
->
plugin
.
tag
==
nullptr
);
++
clients_cnt
;
...
...
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