Commit graph

864 commits

Author SHA1 Message Date
Eric House
f0e9ede61f add manual message-send to fcm_loop for testing 2020-12-14 08:57:11 -08:00
Eric House
774a05f8dc in log script, print sender as well as addressee 2020-09-19 22:52:21 -07:00
Eric House
74bb463f1f add systemd service file for relay 2020-09-10 15:33:50 -07:00
Eric House
02287b8909 tweak to display more info
Script still needs a ton of work to be useful
2020-08-27 11:39:43 -07:00
Eric House
da639af7c3 change what must be a mistaken assert 2020-08-25 08:25:44 -07:00
Eric House
2d00a3e30f systemd file to run the fcm loop 2020-08-23 20:08:15 -07:00
Eric House
dc7064a168 fix bug resulting in invitation droppage
Recent changes in how nli address sets were stored led to rejecting
incoming invitations when BT had been removed (e.g. on emulator) because
I didn't notice the removal when validating.
2020-08-22 12:36:31 -07:00
Eric House
f6d7eed84d add mqtt as a new transport
This is meant to replace the relay eventually, but for now it's a new
option, like BT or SMS, to be chosen. Protocol is handled in common/
code for the first time, meaning that linux and android interact without
the need to keep two platforms in sync. Linux uses lib-mosquitto, and
Android uses eclipse's Paho client (the generic java version, not the
one that uses four-year-old Service patterns and so crashes for SDK >=
26.)
2020-05-20 13:58:53 -07:00
katianderic
c7c1946793 use deviceID to invite via relay; make 3- and 4-device games work 2020-02-16 19:12:22 -08:00
katianderic
b1bd506e22 harvest relaydevid (for use in invitations later) 2020-02-16 19:12:21 -08:00
eehouse111999
c50e85f34a improve scripts' contribution to setup 2020-02-07 14:37:27 -08:00
Eric House
d6cf1d2f95 add comment about work needing doing 2020-01-11 20:44:12 -08:00
Eric House
4fa1b3faf4 Don't join a game that's been idle for more than two weeks
The two weeks is configurable. But the idea is somebody creates a game
with a random name but it's never joined. Eventually the name is used
again and the first to connect joins the existing game that will never
progress. I could just prune from the DB, but this is less work ongoing.
2020-01-10 20:13:06 -08:00
Eric House
9373dce0df fix fcm_msg.py test script (force to take devid) Works! 2019-11-27 11:47:46 -08:00
Eric House
6f3be5933f test script taken from eehouse.org (it works) 2019-07-07 13:00:06 -07:00
Eric House
1ce243904e bring in changes from eehouse.org
This is what's been running for months, so committing it.
2019-07-07 13:00:06 -07:00
Eric House
475206a373 don't assume send will succeed
(Pulling in change that's been on eehouse.org for a while)
2019-07-07 13:00:06 -07:00
Eric House
0be3bb192d Wait for ACK to remove stored message
Bringing in a change that's been on the production relay for a while but
apparently didn't pass tests locally. Now it does.
2019-03-17 11:52:48 -07:00
Eric House
9bde550455 apply ordering and limit correctly 2019-03-17 11:38:00 -07:00
Eric House
ce2ec03d3e relay tracks variantCode int, not string 2019-03-07 18:12:26 -08:00
Eric House
e98519ea38 stop storing fcm keys and similar data in postgres arrays
Not sure why I was doing this, but it's not worth the
trouble (e.g. stopping updates of other data to fix an android bug
sending too many reregistration messages.) So now just use the first
element of arrays, replacing what's there instead of prepending. Ideally
those columns would not be arrays, but that's a harder change.
2019-02-02 21:49:50 -08:00
Eric House
23fe3a1dd6 make script executable 2019-02-02 15:50:17 -08:00
Eric House
4a335522d2 fix so success detected from new API 2019-02-01 20:51:07 -08:00
Your Name
cd777f3b9c pull and display new field 2019-02-02 00:20:35 +00:00
Eric House
c0783fba16 don't save duplicate devIDs
There's likely a bug in Android now where I'm registering over and
over though the fcm id hasn't been changed. That's wrong, but it's
also wrong (and filling up the db) to register a duplicate as if it
were new. So stop that.
2019-02-01 12:13:05 -08:00
Eric House
15a2897112 Revert "toward compiling with gcc8"
This reverts commit d293517e7c.
2019-01-29 09:05:54 -08:00
Eric House
d293517e7c toward compiling with gcc8
My VSIZE is no longer legal, and apparently there's no workaround (no
way to safely figure the length of an array whose size is known at
compile time.) To avoid the risk of duplicating little constants, added
macros that define length in a way a new VSIZE can pick it up. Couldn't
make that work for struct field arrays, however, so there I'm using
constants.
2019-01-28 17:24:53 -08:00
Eric House
a14b43bba0 communicate variant to relay, and store in new column 2019-01-27 06:31:21 -08:00
Eric House
b4096de8ca rewrite of gcm_loop.py to use FCM
Works on my test VM. Untested on production.
2019-01-25 09:21:37 -08:00
Eric House
88a440acc3 add app-side support for firebase messaging
Works for xw4d variant only so far -- xw4 builds are broken!!!
2019-01-24 18:20:01 -08:00
Eric House
89f4246e83 track and log types of (un-acked) messages 2018-05-24 21:03:25 -07:00
Eric House
32c93786b3 fix assert when buffer too small
read directly into vector rather than first loading into a fixed-size
buffer that's apparently occasionally not big enough.
2018-05-21 21:19:32 -07:00
Eric House
40ce484a92 fix mistaken and very broken commit
(Fortunately I never ran a relay with this in it!)
2018-05-21 21:19:25 -07:00
Eric House
1b71198d4e add valgrind option to test script 2018-04-14 10:48:20 -07:00
Eric House
fef4db0ee4 make easier to comment out 2018-03-21 07:28:49 -07:00
Eric House
74406c9bba on failure, don't log what looks like success 2018-03-09 06:45:21 -08:00
Eric House
61993fc079 add tests to the rest of the forever loops 2018-02-26 07:03:47 -08:00
Eric House
aaafe1af00 assert we aren't looping infinitely
Stuff I'm doing with invitation resends is making the relay loop
inifintely. Let's assert a small loop count instead: better to crash and
restart than loop forever unable to process requests.
2018-02-25 20:44:06 -08:00
Eric House
bda545fc8e comment out iface
On Linode anyway the relay's unreachable from python scripts unless I do
this, and it seems harmless in local tests too.
2017-12-14 06:39:40 -08:00
Eric House
afda9ce446 add assertion 2017-12-09 13:30:25 -08:00
Eric House
530e0181e5 list open sockets 2017-12-09 13:30:08 -08:00
Eric House
811c8f535e add socket refcounting
AddrInfo now has ref()/unref() and keeps a global socket->refcount map
(since actual AddrInfo instances come and go.) When the
count drops to 0, the existing CloseSocket() method is called. This
seems to fix a bunch of race conditions that had a socket being closed
and reused while old code was still expecting to write to the device
attached to the socket the first time (along with lots of calls to close()
already-closed sockets, attempts to write() to closed sockets, etc.)
2017-12-07 07:18:09 -08:00
Eric House
dbf38f7759 don't use mlock in config; don't close socket
Use of mutex logging recurses infinitely if config uses mlock, so remove
that. And don't free sockets after handling their messages as they may
be in use elsewhere. This likely introduces a leak of sockets.
2017-12-06 19:11:32 -08:00
Eric House
243eb213bb make reply messages a param within result
Makes it easier to debug by adding stuff on the relay end
2017-12-06 18:57:48 -08:00
Eric House
70dea02efc cleanup; fix possible socket drop
Haven't seen it happen, but I think there was a bug that could have led
to all the sockets coming back as ready from poll() being dropped. Fixed
that and added/cleaned up some logging.
2017-12-04 20:40:44 -08:00
Eric House
d5c4ecabce rename class; add some logging
Rename class that's no longer just about UDP as it began. Add a bit of
logging. This commit *should* not change behavior at all.
2017-12-03 19:18:36 -08:00
Eric House
fd5549014a fix logging 2017-12-03 18:52:06 -08:00
Eric House
e485af925f log milliseconds: seconds not enough. 2017-12-03 16:07:30 -08:00
Eric House
b77ea0aaad copied from relay_via_http branch
(was at: ./xwords4/android/scripts/relay.py) This is the web API clients
can use to talk to the relay.
2017-11-12 20:29:15 -08:00
Eric House
f072c68bf9 bring in changes from relay_via_http branch
It's time to make them live so client development can use a live relay,
and all the old tests pass, so why not.
2017-11-12 20:25:29 -08:00