[LMSAPI] Renamed 'Remote' to 'LmsAPI'
This commit is contained in:
@@ -61,7 +61,7 @@
|
|||||||
- Make a dedicated audio layout in mobile environment (keep the same layout for videos?)
|
- Make a dedicated audio layout in mobile environment (keep the same layout for videos?)
|
||||||
- Handle internal path
|
- Handle internal path
|
||||||
|
|
||||||
[Remote API]
|
[Lms API]
|
||||||
- Implement partial text search options in the GetXXX messages
|
- Implement partial text search options in the GetXXX messages
|
||||||
|
|
||||||
[REST API]
|
[REST API]
|
||||||
|
|||||||
+11
-11
@@ -67,14 +67,14 @@ lms_SOURCES = \
|
|||||||
|
|
||||||
if LMSAPI
|
if LMSAPI
|
||||||
lms_SOURCES += \
|
lms_SOURCES += \
|
||||||
$(srcdir)/remote/server/Connection.cpp \
|
$(srcdir)/lms-api/server/Connection.cpp \
|
||||||
$(srcdir)/remote/server/ConnectionManager.cpp \
|
$(srcdir)/lms-api/server/ConnectionManager.cpp \
|
||||||
$(srcdir)/remote/server/AudioCollectionRequestHandler.cpp \
|
$(srcdir)/lms-api/server/AudioCollectionRequestHandler.cpp \
|
||||||
$(srcdir)/remote/server/AuthRequestHandler.cpp \
|
$(srcdir)/lms-api/server/AuthRequestHandler.cpp \
|
||||||
$(srcdir)/remote/server/MediaRequestHandler.cpp \
|
$(srcdir)/lms-api/server/MediaRequestHandler.cpp \
|
||||||
$(srcdir)/remote/server/RequestHandler.cpp \
|
$(srcdir)/lms-api/server/RequestHandler.cpp \
|
||||||
$(srcdir)/remote/server/Server.cpp \
|
$(srcdir)/lms-api/server/Server.cpp \
|
||||||
$(srcdir)/service/RemoteServerService.cpp
|
$(srcdir)/service/LmsAPIServerService.cpp
|
||||||
|
|
||||||
nodist_lms_SOURCES = \
|
nodist_lms_SOURCES = \
|
||||||
$(builddir)/auth.pb.cc \
|
$(builddir)/auth.pb.cc \
|
||||||
@@ -112,10 +112,10 @@ MOSTLYCLEANFILES = \
|
|||||||
$(builddir)/messages.pb.cc \
|
$(builddir)/messages.pb.cc \
|
||||||
$(builddir)/messages.pb.h
|
$(builddir)/messages.pb.h
|
||||||
|
|
||||||
%.pb.cc %.pb.h: $(srcdir)/remote/proto/%.proto
|
%.pb.cc %.pb.h: $(srcdir)/lms-api/proto/%.proto
|
||||||
$(PROTOC) --proto_path=$(srcdir)/remote/proto/ --cpp_out=$(builddir)/ $^
|
$(PROTOC) --proto_path=$(srcdir)/lms-api/proto/ --cpp_out=$(builddir)/ $^
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
lms_CXXFLAGS=-DBOOST_LOG_DYN_LINK -std=c++11 -Wall -I$(top_srcdir)/third-party -I$(srcdir)/ui -I$(srcdir)/remote
|
lms_CXXFLAGS=-DBOOST_LOG_DYN_LINK -std=c++11 -Wall -I$(top_srcdir)/third-party -I$(srcdir)/ui -I$(srcdir)/lms-api
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
#include "logger/Logger.hpp"
|
#include "logger/Logger.hpp"
|
||||||
|
|
||||||
#include "service/UserInterfaceService.hpp"
|
#include "service/UserInterfaceService.hpp"
|
||||||
#include "service/RemoteServerService.hpp"
|
#include "service/LmsAPIServerService.hpp"
|
||||||
#include "service/DatabaseUpdateService.hpp"
|
#include "service/DatabaseUpdateService.hpp"
|
||||||
|
|
||||||
class ConfigReader
|
class ConfigReader
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
|
||||||
namespace Remote
|
namespace LmsAPI
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
@@ -104,7 +104,7 @@ class Header
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace Remote
|
} // namespace LmsAPI
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2013 Emeric Poupon
|
||||||
|
*
|
||||||
|
* This file is part of LMS.
|
||||||
|
*
|
||||||
|
* LMS is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* LMS is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with LMS. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import "common.proto";
|
||||||
|
|
||||||
|
package LmsAPI;
|
||||||
|
|
||||||
|
message AuthRequest
|
||||||
|
{
|
||||||
|
message Password
|
||||||
|
{
|
||||||
|
required string user_login = 1;
|
||||||
|
required string user_password = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum Type
|
||||||
|
{
|
||||||
|
TypePassword = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
required Type type = 1;
|
||||||
|
|
||||||
|
optional Password password = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message AuthResponse
|
||||||
|
{
|
||||||
|
|
||||||
|
message PasswordResult
|
||||||
|
{
|
||||||
|
enum Type
|
||||||
|
{
|
||||||
|
TypePasswordInvalid = 1;
|
||||||
|
TypeLoginThrottling = 2; // The attempt was not processed because of throttling
|
||||||
|
TypePasswordValid = 3;
|
||||||
|
}
|
||||||
|
required Type type = 1;
|
||||||
|
|
||||||
|
optional uint32 delay = 2; // in seconds, in case of PasswordInvalid/LoginThrottling
|
||||||
|
}
|
||||||
|
|
||||||
|
enum Type
|
||||||
|
{
|
||||||
|
TypePasswordResult = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
required Type type = 1;
|
||||||
|
|
||||||
|
optional PasswordResult password_result = 2;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -1,6 +1,25 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2013 Emeric Poupon
|
||||||
|
*
|
||||||
|
* This file is part of LMS.
|
||||||
|
*
|
||||||
|
* LMS is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* LMS is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with LMS. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
import "common.proto";
|
import "common.proto";
|
||||||
|
|
||||||
package Remote;
|
package LmsAPI;
|
||||||
|
|
||||||
message AudioCollectionRequest
|
message AudioCollectionRequest
|
||||||
{
|
{
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2013 Emeric Poupon
|
||||||
|
*
|
||||||
|
* This file is part of LMS.
|
||||||
|
*
|
||||||
|
* LMS is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* LMS is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with LMS. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package LmsAPI;
|
||||||
|
|
||||||
|
message Error
|
||||||
|
{
|
||||||
|
required bool error = 1;
|
||||||
|
optional string message = 2;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -1,8 +1,25 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2013 Emeric Poupon
|
||||||
|
*
|
||||||
|
* This file is part of LMS.
|
||||||
|
*
|
||||||
|
* LMS is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* LMS is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with LMS. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
import "common.proto";
|
import "common.proto";
|
||||||
|
|
||||||
package Remote;
|
package LmsAPI;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
message MediaRequest
|
message MediaRequest
|
||||||
{
|
{
|
||||||
@@ -1,9 +1,29 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2013 Emeric Poupon
|
||||||
|
*
|
||||||
|
* This file is part of LMS.
|
||||||
|
*
|
||||||
|
* LMS is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* LMS is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with LMS. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
import "common.proto";
|
import "common.proto";
|
||||||
|
|
||||||
import "auth.proto";
|
import "auth.proto";
|
||||||
import "collection.proto";
|
import "collection.proto";
|
||||||
import "media.proto";
|
import "media.proto";
|
||||||
|
|
||||||
package Remote;
|
package LmsAPI;
|
||||||
|
|
||||||
// Every request sent by the client must be a ClientMessage
|
// Every request sent by the client must be a ClientMessage
|
||||||
// The server will answer using a ServerMessage
|
// The server will answer using a ServerMessage
|
||||||
+2
-2
@@ -29,7 +29,7 @@
|
|||||||
#include "database/Types.hpp"
|
#include "database/Types.hpp"
|
||||||
#include "cover/CoverArtGrabber.hpp"
|
#include "cover/CoverArtGrabber.hpp"
|
||||||
|
|
||||||
namespace Remote {
|
namespace LmsAPI {
|
||||||
namespace Server {
|
namespace Server {
|
||||||
|
|
||||||
using namespace Database;
|
using namespace Database;
|
||||||
@@ -387,7 +387,7 @@ AudioCollectionRequestHandler::processGetRevision(AudioCollectionResponse::Revis
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace Remote
|
} // namespace LmsAPI
|
||||||
} // namespace Server
|
} // namespace Server
|
||||||
|
|
||||||
|
|
||||||
+2
-2
@@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
#include "messages.pb.h"
|
#include "messages.pb.h"
|
||||||
|
|
||||||
namespace Remote {
|
namespace LmsAPI {
|
||||||
namespace Server {
|
namespace Server {
|
||||||
|
|
||||||
class AudioCollectionRequestHandler
|
class AudioCollectionRequestHandler
|
||||||
@@ -54,7 +54,7 @@ class AudioCollectionRequestHandler
|
|||||||
static const std::size_t _maxCoverArtSize = 512; // in pixels, square
|
static const std::size_t _maxCoverArtSize = 512; // in pixels, square
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Remote
|
} // namespace LmsAPI
|
||||||
} // namespace Server
|
} // namespace Server
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
+2
-2
@@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
#include "AuthRequestHandler.hpp"
|
#include "AuthRequestHandler.hpp"
|
||||||
|
|
||||||
namespace Remote {
|
namespace LmsAPI {
|
||||||
namespace Server {
|
namespace Server {
|
||||||
|
|
||||||
AuthRequestHandler::AuthRequestHandler(Database::Handler& db)
|
AuthRequestHandler::AuthRequestHandler(Database::Handler& db)
|
||||||
@@ -100,6 +100,6 @@ AuthRequestHandler::processPassword(const AuthRequest::Password& request, AuthRe
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Remote
|
|
||||||
} // namespace Server
|
} // namespace Server
|
||||||
|
} // namespace LmsAPI
|
||||||
|
|
||||||
+4
-4
@@ -17,14 +17,14 @@
|
|||||||
* along with LMS. If not, see <http://www.gnu.org/licenses/>.
|
* along with LMS. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef REMOTE_AUTH_REQUEST_HANDLER
|
#ifndef LMSAPI_AUTH_REQUEST_HANDLER
|
||||||
#define REMOTE_AUTH_REQUEST_HANDLER
|
#define LMSAPI_AUTH_REQUEST_HANDLER
|
||||||
|
|
||||||
#include "database/DatabaseHandler.hpp"
|
#include "database/DatabaseHandler.hpp"
|
||||||
|
|
||||||
#include "messages.pb.h"
|
#include "messages.pb.h"
|
||||||
|
|
||||||
namespace Remote {
|
namespace LmsAPI {
|
||||||
namespace Server {
|
namespace Server {
|
||||||
|
|
||||||
class AuthRequestHandler
|
class AuthRequestHandler
|
||||||
@@ -41,7 +41,7 @@ class AuthRequestHandler
|
|||||||
Database::Handler& _db;
|
Database::Handler& _db;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Remote
|
|
||||||
} // namespace Server
|
} // namespace Server
|
||||||
|
} // namespace LmsAPI
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
#include "ConnectionManager.hpp"
|
#include "ConnectionManager.hpp"
|
||||||
#include "Connection.hpp"
|
#include "Connection.hpp"
|
||||||
|
|
||||||
namespace Remote {
|
namespace LmsAPI {
|
||||||
namespace Server {
|
namespace Server {
|
||||||
|
|
||||||
Connection::Connection(boost::asio::io_service& ioService,
|
Connection::Connection(boost::asio::io_service& ioService,
|
||||||
@@ -79,11 +79,11 @@ void
|
|||||||
Connection::readMsg()
|
Connection::readMsg()
|
||||||
{
|
{
|
||||||
// Read a header first
|
// Read a header first
|
||||||
boost::asio::streambuf::mutable_buffers_type bufs = _inputStreamBuf.prepare(Remote::Header::size);
|
boost::asio::streambuf::mutable_buffers_type bufs = _inputStreamBuf.prepare(LmsAPI::Header::size);
|
||||||
|
|
||||||
boost::asio::async_read(_socket,
|
boost::asio::async_read(_socket,
|
||||||
bufs,
|
bufs,
|
||||||
boost::asio::transfer_exactly(Remote::Header::size),
|
boost::asio::transfer_exactly(LmsAPI::Header::size),
|
||||||
boost::bind(&Connection::handleReadHeader, shared_from_this(),
|
boost::bind(&Connection::handleReadHeader, shared_from_this(),
|
||||||
boost::asio::placeholders::error,
|
boost::asio::placeholders::error,
|
||||||
boost::asio::placeholders::bytes_transferred));
|
boost::asio::placeholders::bytes_transferred));
|
||||||
@@ -114,9 +114,9 @@ Connection::handleReadHeader(const boost::system::error_code& error, std::size_t
|
|||||||
{
|
{
|
||||||
if (!error)
|
if (!error)
|
||||||
{
|
{
|
||||||
if (bytes_transferred != Remote::Header::size)
|
if (bytes_transferred != LmsAPI::Header::size)
|
||||||
{
|
{
|
||||||
LMS_LOG(MOD_REMOTE, SEV_ERROR) << "bytes_transferred (" << bytes_transferred << ") != Remote::Header::size!";
|
LMS_LOG(MOD_REMOTE, SEV_ERROR) << "bytes_transferred (" << bytes_transferred << ") != LmsAPI::Header::size!";
|
||||||
_connectionManager.stop(shared_from_this());
|
_connectionManager.stop(shared_from_this());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -125,7 +125,7 @@ Connection::handleReadHeader(const boost::system::error_code& error, std::size_t
|
|||||||
|
|
||||||
std::istream is(&_inputStreamBuf);
|
std::istream is(&_inputStreamBuf);
|
||||||
|
|
||||||
Remote::Header header;
|
LmsAPI::Header header;
|
||||||
if (!header.from_istream(is))
|
if (!header.from_istream(is))
|
||||||
{
|
{
|
||||||
LMS_LOG(MOD_REMOTE, SEV_ERROR) << "Cannot read header from buffer!";
|
LMS_LOG(MOD_REMOTE, SEV_ERROR) << "Cannot read header from buffer!";
|
||||||
@@ -161,8 +161,8 @@ Connection::handleReadMsg(const boost::system::error_code& error, std::size_t by
|
|||||||
std::istream is(&_inputStreamBuf);
|
std::istream is(&_inputStreamBuf);
|
||||||
std::ostream os(&_outputStreamBuf);
|
std::ostream os(&_outputStreamBuf);
|
||||||
|
|
||||||
Remote::ServerMessage response;
|
LmsAPI::ServerMessage response;
|
||||||
Remote::ClientMessage request;
|
LmsAPI::ClientMessage request;
|
||||||
|
|
||||||
if (!request.ParseFromIstream(&is))
|
if (!request.ParseFromIstream(&is))
|
||||||
{
|
{
|
||||||
@@ -188,23 +188,23 @@ Connection::handleReadMsg(const boost::system::error_code& error, std::size_t by
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_outputStreamBuf.size() >= Remote::Header::max_data_size)
|
if (_outputStreamBuf.size() >= LmsAPI::Header::max_data_size)
|
||||||
{
|
{
|
||||||
LMS_LOG(MOD_REMOTE, SEV_ERROR) << "output message is too big! " << _outputStreamBuf.size() << " > " << Remote::Header::max_data_size;
|
LMS_LOG(MOD_REMOTE, SEV_ERROR) << "output message is too big! " << _outputStreamBuf.size() << " > " << LmsAPI::Header::max_data_size;
|
||||||
_connectionManager.stop(shared_from_this());
|
_connectionManager.stop(shared_from_this());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::array<unsigned char, Remote::Header::size> headerBuffer;
|
std::array<unsigned char, LmsAPI::Header::size> headerBuffer;
|
||||||
{
|
{
|
||||||
Remote::Header header;
|
LmsAPI::Header header;
|
||||||
header.setDataSize(_outputStreamBuf.size());
|
header.setDataSize(_outputStreamBuf.size());
|
||||||
header.to_buffer(headerBuffer);
|
header.to_buffer(headerBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::size_t n = boost::asio::write(_socket,
|
std::size_t n = boost::asio::write(_socket,
|
||||||
boost::asio::buffer(headerBuffer),
|
boost::asio::buffer(headerBuffer),
|
||||||
boost::asio::transfer_exactly(Remote::Header::size),
|
boost::asio::transfer_exactly(LmsAPI::Header::size),
|
||||||
ec);
|
ec);
|
||||||
if (ec)
|
if (ec)
|
||||||
{
|
{
|
||||||
@@ -213,7 +213,7 @@ Connection::handleReadMsg(const boost::system::error_code& error, std::size_t by
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
assert(n == Remote::Header::size);
|
assert(n == LmsAPI::Header::size);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now send serialized payload
|
// Now send serialized payload
|
||||||
@@ -247,4 +247,4 @@ Connection::handleReadMsg(const boost::system::error_code& error, std::size_t by
|
|||||||
|
|
||||||
|
|
||||||
} // namespace Server
|
} // namespace Server
|
||||||
} // namespace Remote
|
} // namespace LmsAPI
|
||||||
@@ -17,8 +17,8 @@
|
|||||||
* along with LMS. If not, see <http://www.gnu.org/licenses/>.
|
* along with LMS. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef REMOTE_CONNECTION_HPP
|
#ifndef LMSAPI_CONNECTION_HPP
|
||||||
#define REMOTE_CONNECTION_HPP
|
#define LMSAPI_CONNECTION_HPP
|
||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
#include "messages/Header.hpp"
|
#include "messages/Header.hpp"
|
||||||
|
|
||||||
namespace Remote {
|
namespace LmsAPI {
|
||||||
namespace Server {
|
namespace Server {
|
||||||
|
|
||||||
class ConnectionManager;
|
class ConnectionManager;
|
||||||
@@ -91,7 +91,7 @@ class Connection : public std::enable_shared_from_this<Connection>
|
|||||||
|
|
||||||
|
|
||||||
} // namespace Server
|
} // namespace Server
|
||||||
} // namespace Remote
|
} // namespace LmsAPI
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
#include "ConnectionManager.hpp"
|
#include "ConnectionManager.hpp"
|
||||||
|
|
||||||
namespace Remote {
|
namespace LmsAPI {
|
||||||
namespace Server {
|
namespace Server {
|
||||||
|
|
||||||
ConnectionManager::ConnectionManager()
|
ConnectionManager::ConnectionManager()
|
||||||
@@ -57,6 +57,6 @@ ConnectionManager::stopAll()
|
|||||||
|
|
||||||
|
|
||||||
} // namespace Server
|
} // namespace Server
|
||||||
} // namespace Remote
|
} // namespace LmsAPI
|
||||||
|
|
||||||
|
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
#include "Connection.hpp"
|
#include "Connection.hpp"
|
||||||
|
|
||||||
namespace Remote {
|
namespace LmsAPI {
|
||||||
namespace Server {
|
namespace Server {
|
||||||
|
|
||||||
/// Manages open connections so that they may be cleanly stopped when the server
|
/// Manages open connections so that they may be cleanly stopped when the server
|
||||||
@@ -53,6 +53,6 @@ class ConnectionManager
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Server
|
} // namespace Server
|
||||||
} // namespace Remote
|
} // namespace LmsAPI
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
+2
-2
@@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
#include "database/Types.hpp"
|
#include "database/Types.hpp"
|
||||||
|
|
||||||
namespace Remote {
|
namespace LmsAPI {
|
||||||
namespace Server {
|
namespace Server {
|
||||||
|
|
||||||
MediaRequestHandler::MediaRequestHandler(Database::Handler& db)
|
MediaRequestHandler::MediaRequestHandler(Database::Handler& db)
|
||||||
@@ -211,7 +211,7 @@ MediaRequestHandler::processTerminate(const MediaRequest::Terminate& request, Me
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace Remote
|
} // namespace LmsAPI
|
||||||
} // namespace Server
|
} // namespace Server
|
||||||
|
|
||||||
|
|
||||||
+2
-2
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
#include "media.pb.h"
|
#include "media.pb.h"
|
||||||
|
|
||||||
namespace Remote {
|
namespace LmsAPI {
|
||||||
namespace Server {
|
namespace Server {
|
||||||
|
|
||||||
class MediaRequestHandler
|
class MediaRequestHandler
|
||||||
@@ -58,8 +58,8 @@ class MediaRequestHandler
|
|||||||
static const std::size_t _maxTranscoders = 1;
|
static const std::size_t _maxTranscoders = 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Remote
|
|
||||||
} // namespace Server
|
} // namespace Server
|
||||||
|
} // namespace LmsAPI
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
#include "RequestHandler.hpp"
|
#include "RequestHandler.hpp"
|
||||||
|
|
||||||
namespace Remote {
|
namespace LmsAPI {
|
||||||
namespace Server {
|
namespace Server {
|
||||||
|
|
||||||
RequestHandler::RequestHandler(boost::filesystem::path dbPath)
|
RequestHandler::RequestHandler(boost::filesystem::path dbPath)
|
||||||
@@ -95,7 +95,7 @@ RequestHandler::process(const ClientMessage& request, ServerMessage& response)
|
|||||||
|
|
||||||
|
|
||||||
} // namespace Server
|
} // namespace Server
|
||||||
} // namespace Remote
|
} // namespace LmsAPI
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
#include "AudioCollectionRequestHandler.hpp"
|
#include "AudioCollectionRequestHandler.hpp"
|
||||||
#include "MediaRequestHandler.hpp"
|
#include "MediaRequestHandler.hpp"
|
||||||
|
|
||||||
namespace Remote {
|
namespace LmsAPI {
|
||||||
namespace Server {
|
namespace Server {
|
||||||
|
|
||||||
class RequestHandler
|
class RequestHandler
|
||||||
@@ -52,7 +52,7 @@ class RequestHandler
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Server
|
} // namespace Server
|
||||||
} // namespace Remote
|
} // namespace LmsAPI
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
#include "Server.hpp"
|
#include "Server.hpp"
|
||||||
|
|
||||||
namespace Remote {
|
namespace LmsAPI {
|
||||||
namespace Server {
|
namespace Server {
|
||||||
|
|
||||||
Server::Server(const endpoint_type& bindEndpoint,
|
Server::Server(const endpoint_type& bindEndpoint,
|
||||||
@@ -109,4 +109,4 @@ Server::stop()
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Server
|
} // namespace Server
|
||||||
} // namespace Remote
|
} // namespace LmsAPI
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
#include "RequestHandler.hpp"
|
#include "RequestHandler.hpp"
|
||||||
|
|
||||||
namespace Remote {
|
namespace LmsAPI {
|
||||||
namespace Server {
|
namespace Server {
|
||||||
|
|
||||||
class Server
|
class Server
|
||||||
@@ -76,6 +76,6 @@ class Server
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Server
|
} // namespace Server
|
||||||
} // namespace Remote
|
} // namespace LmsAPI
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
+1
-1
@@ -28,7 +28,7 @@
|
|||||||
#include "service/ServiceManager.hpp"
|
#include "service/ServiceManager.hpp"
|
||||||
#include "service/DatabaseUpdateService.hpp"
|
#include "service/DatabaseUpdateService.hpp"
|
||||||
#include "service/UserInterfaceService.hpp"
|
#include "service/UserInterfaceService.hpp"
|
||||||
#include "service/RemoteServerService.hpp"
|
#include "service/LmsAPIServerService.hpp"
|
||||||
|
|
||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,48 +0,0 @@
|
|||||||
import "common.proto";
|
|
||||||
|
|
||||||
package Remote;
|
|
||||||
|
|
||||||
message AuthRequest
|
|
||||||
{
|
|
||||||
message Password
|
|
||||||
{
|
|
||||||
required string user_login = 1;
|
|
||||||
required string user_password = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
enum Type
|
|
||||||
{
|
|
||||||
TypePassword = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
required Type type = 1;
|
|
||||||
|
|
||||||
optional Password password = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message AuthResponse
|
|
||||||
{
|
|
||||||
|
|
||||||
message PasswordResult
|
|
||||||
{
|
|
||||||
enum Type
|
|
||||||
{
|
|
||||||
TypePasswordInvalid = 1;
|
|
||||||
TypeLoginThrottling = 2; // The attempt was not processed because of throttling
|
|
||||||
TypePasswordValid = 3;
|
|
||||||
}
|
|
||||||
required Type type = 1;
|
|
||||||
|
|
||||||
optional uint32 delay = 2; // in seconds, in case of PasswordInvalid/LoginThrottling
|
|
||||||
}
|
|
||||||
|
|
||||||
enum Type
|
|
||||||
{
|
|
||||||
TypePasswordResult = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
required Type type = 1;
|
|
||||||
|
|
||||||
optional PasswordResult password_result = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
|
|
||||||
package Remote;
|
|
||||||
|
|
||||||
message Error
|
|
||||||
{
|
|
||||||
required bool error = 1;
|
|
||||||
optional string message = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
#include "logger/Logger.hpp"
|
#include "logger/Logger.hpp"
|
||||||
|
|
||||||
#include "RemoteServerService.hpp"
|
#include "LmsAPIServerService.hpp"
|
||||||
|
|
||||||
namespace Service {
|
namespace Service {
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
#include "Service.hpp"
|
#include "Service.hpp"
|
||||||
|
|
||||||
#include "remote/server/Server.hpp"
|
#include "lms-api/server/Server.hpp"
|
||||||
|
|
||||||
namespace Service {
|
namespace Service {
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@ class RemoteServerService : public Service
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
Remote::Server::Server _server;
|
LmsAPI::Server::Server _server;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Service
|
} // namespace Service
|
||||||
Reference in New Issue
Block a user