X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcommon%2Fpeer.cpp;h=54e0c59eec5de64bb2ee3abaa31a85d488871e77;hb=bfa14a673eabd3a3f17d68843a634703c821df9c;hp=3785326cc106f7f61d13b0afb6d9d487854a2699;hpb=d0e9b7a1d5e73041ade519189eea012500440ba9;p=quassel.git diff --git a/src/common/peer.cpp b/src/common/peer.cpp index 3785326c..54e0c59e 100644 --- a/src/common/peer.cpp +++ b/src/common/peer.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2015 by the Quassel Project * + * Copyright (C) 2005-2016 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -34,20 +34,23 @@ AuthHandler *Peer::authHandler() const } -// Note that we need to use a fixed-size integer instead of uintptr_t, in order -// to avoid issues with different architectures for client and core. -// In practice, we'll never really have to restore the real value of a PeerPtr from -// a QVariant. +// PeerPtr is used in RPC signatures for enabling receivers to send replies +// to a particular peer rather than broadcast to all connected ones. +// To enable this, the SignalProxy transparently replaces the bogus value +// received over the network with the actual address of the local Peer +// instance. Because the actual value isn't needed on the wire, it is +// serialized as null. QDataStream &operator<<(QDataStream &out, PeerPtr ptr) { - out << reinterpret_cast(ptr); + Q_UNUSED(ptr); + out << static_cast(0); // 64 bit for historic reasons return out; } QDataStream &operator>>(QDataStream &in, PeerPtr &ptr) { + ptr = nullptr; quint64 value; in >> value; - ptr = reinterpret_cast(value); return in; }