diff options
-rw-r--r-- | httptnt/resourceStreamer.ecpp | 8 | ||||
-rw-r--r-- | include/media/requestCounter.h | 8 | ||||
-rw-r--r-- | media/mediaManager.cpp | 7 | ||||
-rw-r--r-- | plugins/provider/vdrProvider/vdrProvider.cpp | 1 | ||||
-rw-r--r-- | upnp.cpp | 4 |
5 files changed, 16 insertions, 12 deletions
diff --git a/httptnt/resourceStreamer.ecpp b/httptnt/resourceStreamer.ecpp index 1854916..ef9a011 100644 --- a/httptnt/resourceStreamer.ecpp +++ b/httptnt/resourceStreamer.ecpp @@ -105,10 +105,10 @@ using namespace upnp; while ((bytesRead = streamer->Read(buffer, KB(16))) > 0 && length) { reply.out().write(buffer, bytesRead); length -= bytesRead; - if (!reply.out()) { - code = HTTP_GONE; - break; - } +// if (!reply.out()) { +// code = HTTP_GONE; +// break; +// } } } diff --git a/include/media/requestCounter.h b/include/media/requestCounter.h index dc8a330..a69b4aa 100644 --- a/include/media/requestCounter.h +++ b/include/media/requestCounter.h @@ -8,12 +8,18 @@ #ifndef REQUESTCOUNTER_H_ #define REQUESTCOUNTER_H_ +#include "../tools/atomic.h" + +namespace upnp { + struct request_counter_t { // Should be std::atomic<int>. Unfortunatelly, it's supported on C++11 only. // Hope, it works anyway. - static int OPEN_REQUESTS; + static tools::atomic::AtomicInteger OPEN_REQUESTS; request_counter_t(){++OPEN_REQUESTS;} ~request_counter_t(){--OPEN_REQUESTS;} }; +} // namespace upnp + #endif /* REQUESTCOUNTER_H_ */ diff --git a/media/mediaManager.cpp b/media/mediaManager.cpp index 88587d4..7064daa 100644 --- a/media/mediaManager.cpp +++ b/media/mediaManager.cpp @@ -824,11 +824,10 @@ bool cMediaManager::ScanURI(const string& uri, cUPnPResourceProvider* provider){ } } - stringstream uristrm; + string entryUri; for(StringList::iterator it = entries.begin(); it != entries.end(); ++it){ - uristrm.str(string()); - uristrm << uri << *it; - ScanURI(uristrm.str(), provider); + entryUri = uri + *it; + ScanURI(entryUri, provider); } } diff --git a/plugins/provider/vdrProvider/vdrProvider.cpp b/plugins/provider/vdrProvider/vdrProvider.cpp index 3be9092..9a45690 100644 --- a/plugins/provider/vdrProvider/vdrProvider.cpp +++ b/plugins/provider/vdrProvider/vdrProvider.cpp @@ -89,7 +89,6 @@ public: } else { for(index = Channels.GetNextGroup(-1); (channel = Channels.Get(index)); index = Channels.GetNextGroup(index)){ string group = string(channel->Name()) + '/'; - cerr << group << endl; list.push_back(group); } } @@ -15,7 +15,7 @@ using namespace std; using namespace upnp; -int request_counter_t::OPEN_REQUESTS = 0; +tools::atomic::AtomicInteger request_counter_t::OPEN_REQUESTS; cPluginUpnp::cPluginUpnp(void) { @@ -84,7 +84,7 @@ void cPluginUpnp::Stop(void) cString cPluginUpnp::Active(void) { if(request_counter_t::OPEN_REQUESTS > 0){ - return cString::sprintf(tr("There are %d requests active."), request_counter_t::OPEN_REQUESTS); + return cString::sprintf(tr("There are %d requests active."), request_counter_t::OPEN_REQUESTS.Get()); } return NULL; } |