fixed commit

This commit is contained in:
Andreas 2013-01-14 22:00:56 +01:00
parent 570b4f9e88
commit 8cb0b3d349
2 changed files with 2 additions and 23 deletions

View File

@ -171,8 +171,8 @@ message KeepAlive {}
// The message itself
message Message {
required int32 version = 1 [default=1];
required MsgType msgType = 2 [default=UNKNOWN]; // What data is in the message?
optional int32 version = 1 [default=1];
optional MsgType msgType = 2 [default=UNKNOWN]; // What data is in the message?
optional Unknown unknown = 10;
optional Connect connect = 11;

View File

@ -127,27 +127,12 @@ void NetworkRemote::AcceptConnection() {
outgoing_data_creator_.get(), SLOT(StateChanged(Engine::State)));
}
<<<<<<< HEAD
if (server_->hasPendingConnections()) {
QTcpSocket* client_socket = server_->nextPendingConnection();
// Check if our ip is in private scope
if (only_non_public_ip_
&& !IpIsPrivate(client_socket->peerAddress())) {
qLog(Info) << "Got a connection from public ip" <<
client_socket->peerAddress().toString();
} else {
CreateRemoteClient(client_socket);
// TODO: Check private ips for ipv6
}
=======
QTcpServer* server = qobject_cast<QTcpServer*>(sender());
QTcpSocket* client_socket = server->nextPendingConnection();
// Check if our ip is in private scope
if (only_non_public_ip_ && !IpIsPrivate(client_socket->peerAddress())) {
qLog(Info) << "Got a connection from public ip" <<
client_socket->peerAddress().toString();
>>>>>>> remote/remotecontrol
} else {
CreateRemoteClient(client_socket);
}
@ -155,18 +140,12 @@ void NetworkRemote::AcceptConnection() {
bool NetworkRemote::IpIsPrivate(const QHostAddress& address) {
return
<<<<<<< HEAD
address.isInSubnet(QHostAddress::parseSubnet("127.0.0.1/8")) ||
// Link Local v6
address.isInSubnet(QHostAddress::parseSubnet("::1/128")) ||
=======
// Link Local v4
address.isInSubnet(QHostAddress::parseSubnet("127.0.0.1/8")) ||
// Link Local v6
address.isInSubnet(QHostAddress::parseSubnet("::1/128")) ||
address.isInSubnet(QHostAddress::parseSubnet("fe80::/10"));
// Private v4 range
>>>>>>> remote/remotecontrol
address.isInSubnet(QHostAddress::parseSubnet("192.168.0.0/16")) ||
address.isInSubnet(QHostAddress::parseSubnet("172.16.0.0/12")) ||
address.isInSubnet(QHostAddress::parseSubnet("10.0.0.0/8")) ||