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
68fcc195
Commit
68fcc195
authored
Jan 04, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output/httpd: move queue size check to HttpdClient::PushPage()
Don't let the server care for client problems.
parent
8e4efd07
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
18 deletions
+6
-18
HttpdClient.cxx
src/output/HttpdClient.cxx
+6
-0
HttpdClient.hxx
src/output/HttpdClient.hxx
+0
-8
HttpdOutputPlugin.cxx
src/output/HttpdOutputPlugin.cxx
+0
-10
No files found.
src/output/HttpdClient.cxx
View file @
68fcc195
...
...
@@ -387,6 +387,12 @@ HttpdClient::PushPage(Page *page)
/* the client is still writing the HTTP request */
return
;
if
(
queue_size
>
256
*
1024
)
{
FormatDebug
(
httpd_output_domain
,
"client is too slow, flushing its queue"
);
ClearQueue
();
}
page
->
Ref
();
pages
.
push
(
page
);
queue_size
+=
page
->
size
;
...
...
src/output/HttpdClient.hxx
View file @
68fcc195
...
...
@@ -143,14 +143,6 @@ public:
void
LockClose
();
/**
* Returns the total size of this client's page queue.
*/
gcc_pure
size_t
GetQueueSize
()
const
{
return
queue_size
;
}
/**
* Clears the page queue.
*/
void
CancelQueue
();
...
...
src/output/HttpdOutputPlugin.cxx
View file @
68fcc195
...
...
@@ -401,16 +401,6 @@ HttpdOutput::BroadcastPage(Page *page)
void
HttpdOutput
::
BroadcastFromEncoder
()
{
mutex
.
lock
();
for
(
auto
&
client
:
clients
)
{
if
(
client
.
GetQueueSize
()
>
256
*
1024
)
{
FormatDebug
(
httpd_output_domain
,
"client is too slow, flushing its queue"
);
client
.
CancelQueue
();
}
}
mutex
.
unlock
();
Page
*
page
;
while
((
page
=
ReadPage
())
!=
nullptr
)
{
BroadcastPage
(
page
);
...
...
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