File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -46,7 +46,6 @@ namespace web_video_server
4646
4747struct PendingFooter
4848{
49- std::chrono::steady_clock::time_point timestamp;
5049 std::weak_ptr<std::string> contents;
5150};
5251
Original file line number Diff line number Diff line change @@ -86,11 +86,10 @@ void MultipartStream::send_part_header(
8686 connection_->write (async_web_server_cpp::HttpReply::to_buffers (*headers), headers);
8787}
8888
89- void MultipartStream::send_part_footer (const std::chrono::steady_clock::time_point & time)
89+ void MultipartStream::send_part_footer (const std::chrono::steady_clock::time_point & /* time */ )
9090{
9191 const std::shared_ptr<std::string> str (new std::string (" \r\n --" + boundary_ + " \r\n " ));
9292 PendingFooter pf;
93- pf.timestamp = time;
9493 pf.contents = str;
9594 connection_->write (boost::asio::buffer (*str), str);
9695 if (max_queue_size_ > 0 ) {pending_footers_.push (pf);}
@@ -121,19 +120,11 @@ void MultipartStream::send_part(
121120
122121bool MultipartStream::is_busy ()
123122{
124- auto current_time = std::chrono::steady_clock::now ();
125123 while (!pending_footers_.empty ()) {
126124 if (pending_footers_.front ().contents .expired ()) {
127125 pending_footers_.pop ();
128126 } else {
129- auto footer_time = pending_footers_.front ().timestamp ;
130- if (std::chrono::duration_cast<std::chrono::duration<double >>(
131- (current_time - footer_time)).count () > 0.5 )
132- {
133- pending_footers_.pop ();
134- } else {
135- break ;
136- }
127+ break ;
137128 }
138129 }
139130 return max_queue_size_ != 0 && pending_footers_.size () >= max_queue_size_;
You can’t perform that action at this time.
0 commit comments