SyncServerHandlers.cpp   SyncServerHandlers.cpp 
skipping to change at line 23 skipping to change at line 23
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#include "SyncServerHandlers.hpp" #include "SyncServerHandlers.hpp"
#include "SyncServer.hpp" #include "SyncServer.hpp"
using namespace SyncProtocol;
ServerHandler::ServerHandler(SyncServer *server) ServerHandler::ServerHandler(SyncServer *server)
: server(server) : server(server)
{ {
} }
bool ServerErrorHandler::handleMessage(QDataStream &stream, SyncRemotePeer &peerData) bool ServerErrorHandler::handleMessage(QDataStream &stream, SyncProtocol::t PayloadSize dataSize, SyncRemotePeer &peerData)
{ {
ErrorMessage msg; ErrorMessage msg;
bool ok = msg.deserialize(stream,peerData.msgHeader.dataSize); bool ok = msg.deserialize(stream,dataSize);
peerData.peerLog("Received error message from client: " + msg.messag e); peerData.peerLog("Received error message from client: " + msg.messag e);
//we don't drop the connection here, we let the remote end do that //we don't drop the connection here, we let the remote end do that
return ok; return ok;
} }
ServerAuthHandler::ServerAuthHandler(SyncServer* server, bool allowDivergin gAppVersions) ServerAuthHandler::ServerAuthHandler(SyncServer* server, bool allowDivergin gAppVersions)
: ServerHandler(server), allowDivergingAppVersions(allowDivergingApp Versions) : ServerHandler(server), allowDivergingAppVersions(allowDivergingApp Versions)
{ {
} }
bool ServerAuthHandler::handleMessage(QDataStream &stream, SyncRemotePeer & peer) bool ServerAuthHandler::handleMessage(QDataStream &stream, SyncProtocol::tP ayloadSize dataSize, SyncRemotePeer &peer)
{ {
ClientChallengeResponse msg; ClientChallengeResponse msg;
bool ok = msg.deserialize(stream, peer.msgHeader.dataSize); bool ok = msg.deserialize(stream, dataSize);
if(!ok) if(!ok)
{ {
peer.peerLog("invalid challenge response received"); peer.peerLog("invalid challenge response received");
return false; return false;
} }
//check if ID is valid //check if ID is valid
if(msg.clientId != peer.id) if(msg.clientId != peer.id)
{ {
skipping to change at line 93 skipping to change at line 95
if(!allowDivergingAppVersions) if(!allowDivergingAppVersions)
{ {
peer.writeError("app version mismatch not allowed"); peer.writeError("app version mismatch not allowed");
return true; return true;
} }
} }
peer.peerLog("Authenticated client"); peer.peerLog("Authenticated client");
//if we got here, peer is successfully authenticated! //if we got here, peer is successfully authenticated!
peer.isAuthenticated = true; peer.authenticated = true;
peer.writeMessage(ServerChallengeResponseValid()); peer.writeMessage(ServerChallengeResponseValid());
server->clientAuthenticated(peer); server->clientAuthenticated(peer);
return true; return true;
} }
bool ServerAliveHandler::handleMessage(QDataStream &stream, SyncRemotePeer &peer) bool ServerAliveHandler::handleMessage(QDataStream &stream, SyncProtocol::t PayloadSize dataSize, SyncRemotePeer &peer)
{ {
Alive p; Alive p;
return p.deserialize(stream,peer.msgHeader.dataSize); return p.deserialize(stream,dataSize);
} }
 End of changes. 8 change blocks. 
7 lines changed or deleted 9 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/