MediaServ: Update to new SENF library API
[mediaserv.git] / Server / HTTPConnection.cc
index 33a4e1c..1c1f8e7 100644 (file)
@@ -31,9 +31,9 @@ prefix_ g0dil::mediaserv::HTTPConnection::HTTPConnection(ClientHandle client,
                                                          HTTPLogger & logger)
     : client_(client), server_(server), logger_(logger), fileFd_(-1), bandwidth_(0)
 {
-    satcom::lib::ReadHelper<ClientHandle>
-       ::dispatch(client_, MaxRequestSize, satcom::lib::ReadUntil("\r\n\r\n"),
-                  satcom::lib::membind(&HTTPConnection::handleRequest,this));
+    senf::ReadHelper<ClientHandle>
+       ::dispatch(client_, MaxRequestSize, senf::ReadUntil("\r\n\r\n"),
+                  senf::membind(&HTTPConnection::handleRequest,this));
 }
 
 prefix_ g0dil::mediaserv::HTTPConnection::~HTTPConnection()
@@ -45,7 +45,7 @@ prefix_ g0dil::mediaserv::HTTPConnection::~HTTPConnection()
 }
 
 prefix_ void
-g0dil::mediaserv::HTTPConnection::handleRequest(satcom::lib::ReadHelper<ClientHandle>::ptr helper)
+g0dil::mediaserv::HTTPConnection::handleRequest(senf::ReadHelper<ClientHandle>::ptr helper)
 {
 
     try {
@@ -63,18 +63,18 @@ g0dil::mediaserv::HTTPConnection::handleRequest(satcom::lib::ReadHelper<ClientHa
        if (++i != i_end) throw InvalidHTTPRequestException();
 
        fileFd_ = ::open(request_.url().c_str(),O_RDONLY);
-       if (fileFd_ < 0) throw satcom::lib::SystemException(errno);
+       if (fileFd_ < 0) throw senf::SystemException(errno);
        struct ::stat s;
-       if (::fstat(fileFd_,&s) < 0) throw satcom::lib::SystemException(errno);
+       if (::fstat(fileFd_,&s) < 0) throw senf::SystemException(errno);
        
        std::ostringstream response;
        response << request_.version() << (request_.version().empty() ? "" : " ") << "200 OK\r\n";
        response << "Content-Type: " << mimeType << "\r\n";
        response << "Content-Length: " << s.st_size << "\r\n\r\n";
        
-       satcom::lib::WriteHelper<ClientHandle>
+       senf::WriteHelper<ClientHandle>
            ::dispatch(client_, response.str(), 
-                      satcom::lib::membind(&HTTPConnection::startStream,this));
+                      senf::membind(&HTTPConnection::startStream,this));
 
     }
     catch (std::exception const & ex) {
@@ -84,7 +84,7 @@ g0dil::mediaserv::HTTPConnection::handleRequest(satcom::lib::ReadHelper<ClientHa
 }
 
 prefix_ void
-g0dil::mediaserv::HTTPConnection::startStream(satcom::lib::WriteHelper<ClientHandle>::ptr helper)
+g0dil::mediaserv::HTTPConnection::startStream(senf::WriteHelper<ClientHandle>::ptr helper)
 {
     try {
        helper->throw_error();