Changeset View
Changeset View
Standalone View
Standalone View
ksirk/iris/src/xmpp/xmpp-im/s5b.cpp
Show First 20 Lines • Show All 839 Lines • ▼ Show 20 Line(s) | 839 | else | |||
---|---|---|---|---|---|
840 | sc->grantConnect(); | 840 | sc->grantConnect(); | ||
841 | e->relatedServer = (S5BServer *)sender(); | 841 | e->relatedServer = (S5BServer *)sender(); | ||
842 | e->i->setIncomingClient(sc); | 842 | e->i->setIncomingClient(sc); | ||
843 | } | 843 | } | ||
844 | 844 | | |||
845 | void S5BManager::srv_incomingUDP(bool init, const QHostAddress &addr, int port, const QString &key, const QByteArray &data) | 845 | void S5BManager::srv_incomingUDP(bool init, const QHostAddress &addr, int port, const QString &key, const QByteArray &data) | ||
846 | { | 846 | { | ||
847 | Entry *e = findEntryByHash(key); | 847 | Entry *e = findEntryByHash(key); | ||
848 | if(!e->c->d->mode != S5BConnection::Datagram) | 848 | if(e->c->d->mode != S5BConnection::Datagram) | ||
849 | return; // this key isn't in udp mode? drop! | 849 | return; // this key isn't in udp mode? drop! | ||
850 | 850 | | |||
851 | if(init) { | 851 | if(init) { | ||
852 | if(e->udp_init) | 852 | if(e->udp_init) | ||
853 | return; // only init once | 853 | return; // only init once | ||
854 | 854 | | |||
855 | // lock on to this sender | 855 | // lock on to this sender | ||
856 | e->udp_addr = addr; | 856 | e->udp_addr = addr; | ||
▲ Show 20 Lines • Show All 1242 Lines • ▼ Show 20 Line(s) | 2098 | #ifdef S5B_DEBUG | |||
2099 | printf("S5BServer: incoming connection from %s:%d\n", i->client->peerAddress().toString().toLatin1(), i->client->peerPort()); | 2099 | printf("S5BServer: incoming connection from %s:%d\n", i->client->peerAddress().toString().toLatin1(), i->client->peerPort()); | ||
2100 | #endif | 2100 | #endif | ||
2101 | connect(i, &Item::result, this, &S5BServer::item_result); | 2101 | connect(i, &Item::result, this, &S5BServer::item_result); | ||
2102 | d->itemList.append(i); | 2102 | d->itemList.append(i); | ||
2103 | } | 2103 | } | ||
2104 | 2104 | | |||
2105 | void S5BServer::ss_incomingUDP(const QString &host, int port, const QHostAddress &addr, int sourcePort, const QByteArray &data) | 2105 | void S5BServer::ss_incomingUDP(const QString &host, int port, const QHostAddress &addr, int sourcePort, const QByteArray &data) | ||
2106 | { | 2106 | { | ||
2107 | if(port != 0 || port != 1) | 2107 | if((port != 0) && (port != 1)) | ||
2108 | return; | 2108 | return; | ||
2109 | 2109 | | |||
2110 | foreach(S5BManager* m, d->manList) { | 2110 | foreach(S5BManager* m, d->manList) { | ||
2111 | if(m->srv_ownsHash(host)) { | 2111 | if(m->srv_ownsHash(host)) { | ||
2112 | m->srv_incomingUDP(port == 1 ? true : false, addr, sourcePort, host, data); | 2112 | m->srv_incomingUDP(port == 1 ? true : false, addr, sourcePort, host, data); | ||
2113 | return; | 2113 | return; | ||
2114 | } | 2114 | } | ||
2115 | } | 2115 | } | ||
▲ Show 20 Lines • Show All 420 Lines • Show Last 20 Lines |