diff --git a/src/conn_http.cpp b/src/conn_http.cpp index 87ca14ee..f6d82d2a 100644 --- a/src/conn_http.cpp +++ b/src/conn_http.cpp @@ -199,6 +199,7 @@ namespace Connector_HTTP{ H.SetHeader("X-Origin", conn->getHost());//add the UID to the headers before copying std::string request = H.BuildRequest();//copy the request for later forwarding to the connector std::string orig_url = H.getUrl(); + int starttime = time(0); H.Clean(); //check if a connection exists, and if not create one @@ -267,6 +268,7 @@ namespace Connector_HTTP{ H.SetHeader("X-UID", uid); H.SetHeader("Server", "mistserver/" PACKAGE_VERSION "/" + Util::Config::libver); conn->Send(H.BuildResponse("200", "OK")); + conn->flush(); }else{ //unknown length H.SetHeader("X-UID", uid); @@ -286,8 +288,8 @@ namespace Connector_HTTP{ //forward any and all incoming data directly without parsing conn->Send(myConn->Received()); myConn->Received().clear(); + conn->flush(); } - conn->spool(); usleep(30000); } myConn->close(); @@ -295,7 +297,7 @@ namespace Connector_HTTP{ } //print some debug info #if DEBUG >= 4 - std::cout << "Finished request: " << orig_url << " => " << connector << " (" << uid << ")" << std::endl; + std::cout << "Finished request: " << orig_url << " => " << connector << " (" << uid << ") in " << (time(0) - starttime) << "s" << std::endl; #endif } } diff --git a/src/conn_http_dynamic.cpp b/src/conn_http_dynamic.cpp index 993c9934..d82b27ea 100644 --- a/src/conn_http_dynamic.cpp +++ b/src/conn_http_dynamic.cpp @@ -42,7 +42,8 @@ namespace Connector_HTTP{ MP4::ASRT asrt; asrt.SetUpdate(false); asrt.AddQualityEntry(""); - asrt.AddSegmentRunEntry(1, 199);//1 Segment, 199 Fragments + /// \todo Actually use correct number of fragments. + asrt.AddSegmentRunEntry(1, 20000);//1 Segment, 20000 Fragments asrt.WriteContent(); MP4::ABST abst; diff --git a/src/player.cpp b/src/player.cpp index 83f0ed8d..ad8e01a7 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -198,6 +198,7 @@ int main(int argc, char** argv){ unsigned int size = htonl(source.getPacket().size()); in_out.Send((char*)&size, 4); in_out.Send(source.getPacket()); + in_out.flush(); } } else { usleep(std::min(10000LL, lastTime - (now - timeDiff)) * 1000);