Sébastien Blin
547fa2eff5
dht_proxy_client: fix getCallback for push notifications
...
Note: Also fix Value deserialization
2018-03-05 19:15:04 -05:00
Sébastien Blin
6f4283b7d5
proxyclient: avoid useless opFailed when correctly cancel a listen
2018-03-01 16:11:49 -05:00
Adrien Béraud
c9cbced0c8
build: make indexation optional
2018-02-27 21:48:49 -05:00
Sébastien Blin
fcac10c4c8
proxyserver: fix cancelListen and reduce push notifications number
2018-02-26 17:01:23 -05:00
Sébastien Blin
22ef53acef
dhtproxy: fix cancelListen with pushNotifications
...
Fill the body of the UNSUBSCRIBE method and fix dhtnode application
2018-02-26 15:25:48 -05:00
Adrien Béraud
2af70e6d50
Merge pull request #243 from AmarOk1412/fixPushBuild
...
pushnotifications: fix build without push notifications, improve travis script
2018-02-26 14:21:34 -05:00
Sébastien Blin
63c9c607bd
pushnotifications: fix build without push notifications, improve travis script
2018-02-26 13:27:06 -05:00
Adrien Béraud
cab0813b17
dht: reduce log verbosity
2018-02-24 15:15:49 -05:00
Adrien Béraud
06cc490ee4
listener: remove unused field
2018-02-24 15:05:14 -05:00
Adrien Béraud
6821988ddf
node: use thread local random device
2018-02-24 14:30:40 -05:00
Adrien Béraud
8cce9fcb85
search: remove getNextStepTime
2018-02-23 13:50:25 -05:00
Adrien Béraud
56caae019c
proxy server: add push notification ttl
2018-02-19 02:10:56 +01:00
Adrien Béraud
f5afcbf62b
proxy server: use high priority notifications
...
Normal priority notifications may be delayed.
2018-02-16 01:54:44 +01:00
Adrien Béraud
0957d30e86
y2038 bug: don't allow time wrap for certificate validity
2018-02-10 23:21:31 +01:00
Adrien Béraud
3a632b1544
proxy server: add logs
2018-02-10 14:31:23 +01:00
Adrien Béraud
be6a5671ed
y2038 bug: change certificate duration to 10 years
...
A certificate duration of 20 years was making certificate expire
after 2038 which is not supported on many 32 bits platforms.
Reduce to 10 years, which gives another decade to deprecate 32-bits platforms.
2018-02-09 01:40:03 +01:00
Adrien Béraud
61ac297b1b
crypto: add method to read Certificate activation date
2018-02-09 00:42:25 +01:00
Adrien Béraud
e274ffd83b
headers: unify API across build options
2018-01-31 18:07:43 +01:00
Adrien Béraud
bd9496e2ba
crypto: fix build on GnuTLS 3.3
2018-01-26 15:10:07 -05:00
Adrien Béraud
233301c3f3
dhtrunner: use proxy by default if configured
2018-01-23 12:19:38 -05:00
atraczyk
e5d83d47be
dhtrunner: don't pass SockAddrs by reference to startNetwork
2018-01-23 11:34:14 -05:00
Adrien Béraud
e6a2d96622
net: restart socket in case of sigpipe
2018-01-23 11:34:14 -05:00
Adrien Béraud
3d77c76a4d
dhtrunner: restart listeners only if one exists
2018-01-23 11:31:12 -05:00
Adrien Béraud
043d5a7c7c
dhtrunner: check dht instance in setLocalCertificateStore
2018-01-19 14:05:21 -05:00
Adrien Béraud
636eb1972d
proxy client: improve robustness, switch behavior
2018-01-18 16:36:13 -05:00
Adrien Béraud
27a250d2c0
proxyclient: fall to disconnected in case of connectivity failure
2018-01-17 12:09:39 -05:00
Adrien Béraud
02f4c81f2a
dhtrunner: improve proxy listen handling
2018-01-17 11:40:18 -05:00
Adrien Béraud
0420ebcce3
dhtinterface: pass listen filters by value
2018-01-17 11:40:18 -05:00
Adrien Béraud
15e3696b88
proxy client: fix build when push notifications are disabled
2018-01-13 16:16:19 -05:00
Adrien Béraud
ca693a6ac1
pushNotificationReceived: take a map<string, string>
...
JSON is used for the DHT proxy protocol and to communicate with gorush.
Push notifications services might use any format, not necessarily JSON.
Push values are received as a map<string, string>, so receive them in
that format.
2018-01-12 13:20:07 -05:00
Adrien Béraud
1d6a307b6b
proxy server: send data push message instead of notification
2018-01-11 17:01:10 -05:00
Adrien Béraud
227cca883c
dhtrunner: start proxy ASAP, use local dht for node stats/import/export
2018-01-11 14:24:59 -05:00
Adrien Béraud
ef82a7ecba
proxy client: make proxy status check asynchronous
2018-01-11 14:24:59 -05:00
Adrien Béraud
6e9f2cda79
SockAddr: add isMappedIPv4, getMappedIPv4
2018-01-11 13:29:18 -05:00
Adrien Béraud
a0d8f4734a
dhtproxy: allow token refresh, set clientID ( #6 )
...
* add method to set the push token independently from other configuration,
since the push token can be updated during runtime.
* allow to provide a "clientID" to be sent in push notifications,
used to demultiplex push notifications to multiple OpenDHT nodes running
on the same host. For instance Ring uses the accountID as the clientID
to know which account received the push notification.
* use {"platform":"android"/"ios"} to communicate the platform instead of {"isAndroid":true/false}.
2018-01-10 16:32:57 -05:00
Sébastien Blin
37a9a3d9da
dhtproxy: inject push notifications in opendht
...
+ add the ability to inject push notifications in opendht to call
correct callbacks
+ if a timeout occurs and no cancelListen was called, relaunch the
listen operation
+ Pass devicekey to enable push notifications for DhtProxyClient
+ Update sockaddr to fix the build on all platforms
Note: update dhtnode
2017-12-12 15:03:02 -06:00
Sébastien Blin
75cca66d7e
dhtproxy: support push notifications for mobile clients
...
+ Add SUBSCRIBE and UNSUBSCRIBE for DhtProxyServer
+ Add the ability to stop Listen via a timeout (and send a push
Notification for the client)
+ Add the ability to use gorush to send push notifications
Note: Update dhtnode
2017-12-12 10:24:54 -06:00
Adrien Béraud
762a1c7ad2
Merge pull request #220 from AmarOk1412/dhtproxyclient_merge
...
proxy: implement DhtProxyClient
2017-12-12 13:38:23 +01:00
AmarOk
d19ba2cb41
proxyserver: add lock_guard to avoid to manually unlock
2017-12-06 14:43:28 -06:00
AmarOk
557323deff
refactor: use new jsoncpp API
...
Use the latest jsoncpp API to remove depreciation warning.
2017-12-06 08:49:24 -06:00
AmarOk
29ffbf6aa7
dhtrunner: remove DhtRunner::getAddrInfo
...
Was replaced by SockAddr::resolve
2017-12-05 10:02:38 -06:00
Adrien Béraud
aaa577d9e3
proxy_client: use atomic bool for shared state flags ( #3 )
2017-12-05 09:50:38 -06:00
Adrien Béraud
8243bc4c3f
proxy_client: don't block for callback
...
Use shared flags to avoid blocking for the callback
while respecting the callback return value.
2017-12-05 15:51:39 +01:00
AmarOk
b1a9742889
dhtproxyclient: add lock_guards for mutex and clean code
2017-12-04 09:42:37 -06:00
Adrien Béraud
d2f91af946
node: use shared_ptr to manage Sockets
2017-12-02 16:03:27 +01:00
Sébastien Blin
e7d8bc4275
proxyclient: erase finished operation threads
2017-11-29 14:44:02 -05:00
Sébastien Blin
eb750f5b7f
proxy_client: execute callbacks in main thread
2017-11-27 17:51:33 -05:00
Sébastien Blin
5967c89c23
proxy: don't reinit dhtproxy multiple times and forward encrypted messages
...
+ Having a null dht_proxy_client can lead to using nullptr.
+ securedht should forward messages if we are using a proxy.
+ Protect callback segfault
2017-11-22 16:09:45 -05:00
Sébastien Blin
4a83b36dcf
tools: add the ability to use a proxy for dhtchat
2017-11-21 13:37:18 -05:00
Sébastien Blin
eb1f9d64e1
dhtproxyclient: add listen ability.
...
+ Fix LISTEN endpoint for DhtProxyServer
= DhtProxyServer use multiple worker threads
+ Add listen/cancelListen for DhtProxyClient
+ Add connectivityChanged.
2017-11-20 16:01:44 -05:00