Skip to content

Commit

Permalink
October snapshot.
Browse files Browse the repository at this point in the history
  • Loading branch information
GamePad64 committed Oct 7, 2014
1 parent ba1800e commit 7d1bba5
Show file tree
Hide file tree
Showing 28 changed files with 624 additions and 479 deletions.
2 changes: 1 addition & 1 deletion Doxyfile_internal
Expand Up @@ -2095,7 +2095,7 @@ HIDE_UNDOC_RELATIONS = YES
# set to NO
# The default value is: NO.

HAVE_DOT = NO
HAVE_DOT = YES

# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
# to run in parallel. When set to 0 doxygen will base this on the number of
Expand Down
7 changes: 1 addition & 6 deletions src/common/Config.h
Expand Up @@ -70,6 +70,7 @@ class ConfigManager : public Loggable, public Singleton<ConfigManager> {
// Overlay
config.put("overlay.connection.processed_queue_size", 100);
config.put("overlay.connection.key_rotation_spam_limit", 5);
config.put("overlay.connection.timeout", 120);
config.put("overlay.key_provider.history_size", 10);
config.put("overlay.key_provider.renew_interval", 600);

Expand Down Expand Up @@ -103,18 +104,12 @@ class ConfigManager : public Loggable, public Singleton<ConfigManager> {
std::string getDefaultFile();
void setFile(std::string filename);

void configChanged();

void resetToDefaults();
void loadFromFile();
public:
ConfigManager();
virtual ~ConfigManager();

std::set<ConfigClient*> config_clients;
void registerClient(ConfigClient* client);
void unregisterClient(ConfigClient* client);

std::string getDirectory();
std::string getFile();

Expand Down
2 changes: 1 addition & 1 deletion src/common/crypto/Hash.h
Expand Up @@ -29,7 +29,7 @@ class PublicKeyDSA;
* Base class for hashing operations.
* Now it represents Keccak algorithm, which was selected as SHA-3.
*/
class Hash : public MathString< Hash > {
class Hash : public MathString<Hash> {
friend class MathString;
private:
binary_vector_t hash;
Expand Down
4 changes: 1 addition & 3 deletions src/daemon/AsioIOService.h
Expand Up @@ -12,8 +12,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef ASIOIOSERVICE_H_
#define ASIOIOSERVICE_H_
#pragma once

#include <boost/asio.hpp>

Expand All @@ -28,4 +27,3 @@ class AsioIOService {
};

} /* namespace p2pnet */
#endif /* ASIOIOSERVICE_H_ */
14 changes: 7 additions & 7 deletions src/daemon/discovery/DiscoveryService.cpp
Expand Up @@ -13,22 +13,22 @@
*/

#include "DiscoveryService.h"
#include "Protocol.pb.h"
#include "../overlay/OverlayKeyProvider.h"
#include "../overlay/KeyProvider.h"
#include "../transport/Connection.h"
#include "../transport/Socket.h"

namespace p2pnet {
namespace discovery {

DiscoveryService::DiscoveryService(std::shared_ptr<transport::Socket> socket) : socket(socket) {}
DiscoveryService::DiscoveryService(std::shared_ptr<transport::Socket> transport_socket, std::shared_ptr<overlay::Socket> overlay_socket) :
transport_socket(transport_socket), overlay_socket(overlay_socket) {}
DiscoveryService::~DiscoveryService() {}

protocol::ConnectionRequestMessage DiscoveryService::generateConnectionRequest() {
auto pks = overlay::OverlaySocket::getInstance()->getKeyProvider();
protocol::OverlayMessage DiscoveryService::generateConnectionRequest() {
auto pks = overlay_socket->getKeyProvider();

protocol::ConnectionRequestMessage message;
message.set_src_th(pks->getKeyInfo()->th.toBinaryString());
protocol::OverlayMessage message;
message.mutable_header()->set_src_th(pks->getKeyInfo()->th.toBinaryString());
return message;
}

Expand Down
9 changes: 5 additions & 4 deletions src/daemon/discovery/DiscoveryService.h
Expand Up @@ -18,17 +18,18 @@
#include "../../common/Config.h"
#include "../../common/Loggable.h"
#include "../transport/SocketEndpoint.h"
#include "Protocol.pb.h"
#include "OverlayProtocol.pb.h"

namespace p2pnet {
namespace discovery {

class DiscoveryService : public ConfigClient, public Loggable {
protocol::ConnectionRequestMessage generateConnectionRequest();
protocol::OverlayMessage generateConnectionRequest();

std::shared_ptr<transport::Socket> socket;
std::shared_ptr<transport::Socket> transport_socket;
std::shared_ptr<overlay::Socket> overlay_socket;
public:
DiscoveryService(std::shared_ptr<transport::Socket> socket);
DiscoveryService(std::shared_ptr<transport::Socket> transport_socket, std::shared_ptr<overlay::Socket> overlay_socket);
virtual ~DiscoveryService();

void handshake(transport::SocketEndpoint endpoint);
Expand Down
2 changes: 1 addition & 1 deletion src/daemon/discovery/UDPLPD.h
Expand Up @@ -14,7 +14,7 @@
#pragma once

#include "DiscoveryService.h"
#include "Protocol.pb.h"
#include "UDPLPD.pb.h"
#include "../transport/udp/UDPInterface.h"
#include <boost/asio.hpp>
#include <string>
Expand Down

0 comments on commit 7d1bba5

Please sign in to comment.