This method is called from other threads and apparently caused
a sporadic crash caought on Android.
See retroshare://forum?name=Got%20crash%20on%20Android%20with%20GDB%20backtrace&id=95de1451952d8c38cb1cdfdb85eed986&msgid=ac8c9d41f2cd0c9e8e290433c7f296fecb2d62b3
In Restbed one is not supposed to call session->yield outside the
threads controlled by Restbed. RetroShare JSON API async call were
calling session->yield from threads controlled by RetroShare all the
times, this caused crashes in some cases, like when the JSON API
socket timed out concurrently with the session->yield call .
To solve this problem session->yield from async
calls are now wrapped insto mService->schedule to ensure they are
executed on the right thread (aka one of the threads controlled by
Restbed).
While solving this issue I realized also that passing RsEvents as const
references around was quite limiting in cases where the event need to
be finally handled in another thread, in that case passing by const
reference the RsEvent needed to be copied by value into the thread
that process it, in this copy by value process the information of
which was the original specific type is lost, and then only the data
and methods from general RsEvents are available, unless the handler
does tricky stuff with type coercion etc. To solve this limitation
pass the events as std::shared_ptr<const RsEvent> seems the safer and
more elegant solution.
JavaScript represents all numbers in a double like manner thus it
treats 64 bit integers in an unsafe manner, to workaroud this problem
provide an alternative strin representation in JSON serialization
format so JavaScript clients can access the correct value someway.
As JSON have no probles with 64 bits integers keep supporting the integer
representation too.
See https://stackoverflow.com/a/34989371
JSON API user would bet an unusable base64 blob due to RsTlv opaque JSON
serialization, this way the content of the set is serialized plainly
so it is usable through JSON API, without breaking binary
serialization compatibility.
We must stop using those RsTlv derived items.
Rise color palette size from 16 to 256 colors
Note: Max chat item size is 32000 without splitting the message.
31000 = 32000 - some place left for other fields
Mails sent in the past end never received were lingering in the outgoing
queue forever as displayed by statistics. If a mail is older then
GXS_STORAGE_PERIOD all nodes delete it from the GXS group so it can
never arrive to destination, there is no point in keeping it in the
outgoing queue, instead notify sending timed out and delete the mail.
Sending PGP fingerprint trough broadcast discovery is misleading in
terms of security, as those packets cannot be trusted for PGP
fingerprint verification, removing it reduce packet size and reduce the
risc of wrong usage of untrusted information
The age check was causing some address were ignored during connect attempt,
this was disastrous expecially for sporadic users which completely
lost capability to connect to any node, even if the IPs neve changes!
Old addresses triagin is handled elsewhere so ignoring them in connect attempt
only generate very counter-intuitive situations for the user, as
addressed still listed in potential address list were never attempted.
Make reduntant auth check in pqi effective (even if redundant only
siganture was checked but friendess wasn't)
Evidence redundant auth check in pqi by putting it inside #ifdef this
way the beaviior being the same with and without redundat check can be
verified easier
Solve lot of compiler warnings and made code more readable
Remove dangerous sslcert wrapper
Remove misleading messeges and notification about peer not giving cert,
FailedCertificate logic is wrong since many years as authentication is
fully handled inside VerifyX509Callback
Rename from RsDisc to more descriptive RsGossipDiscovery
Keep full retrocompatibility suggesting usage of RsGossipDiscovery
Add capability to send and receive full RetroShare invitation
Emit event when receiving a full invitation
Start using new debug utilities
Use enum class instead of defines and constant where appropriate
Deprecate unsafe costructor, substituted by fromBufferUnsafe which explicitely
marked suggest the caller to pay attention.
Use enum class for id types instead of constants
Make size constants more private
Use internal Id_t alias to avoid huge template lines
Remove and deprecate oguly names in favor of consistent names
Deprecate costructors that may fails, offer alternative methods which
suggest correct usage to the programmer
Internally still use too much try,catch,throw but at least the API
dosn't expose those anymore.
Support for chaining like std::cerr
Support for compile-time optimization without #ifdef around
Support for Android native logging without depending on
AndroidStdIOCatcher workaround
Support for automatic timestamp (on Android it's provided by Android
native log)
Standardized messages categories
Because we don't support libupnp-1.8.x yet avoid using that library
If libupnp-1.6.x is available use that, if not try to use miniupnc if
if unavailble print a warning and disable RetroShare UPnP support
This should bit by bit substitute RsNotify which would be very difficult
to support properly in JSON API.
The new system is much simpler to use also from the C++ side of the
moon.
BroadcastDiscovery take advantage of the new system to notify about new
non friend peer discovered, tested successfully also in JSON API.
Creating GXS groups imply a bunch of crypto operations that require lot
of time expecially on embedded device, channel creation was reported
as failed while it was still pending.
Reduce too long lines.
Print API error messages also on std::cerr.
Discover peers on the same broadcast domain/LAN
Implements own node announcement
Implements others announcement listening
Implements API to get notifiend when other nodes get discovered
Implements API to get discovered nodes
Add discovered peer locator to rsPeers if it is already friend
Yet a bunch of things to do to take full advantage of this new
implementation
Workaround miss-behaviour on old Android phones
Cleanup indentation a bit
Consistent param naming
Introduce default parameter values also for output paramethers