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
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
e485af925f
log milliseconds: seconds not enough.
2017-12-03 16:07:30 -08:00
Eric House
5bd71ba7c5
put cids back into the database
...
The hack I came up with for storing them in memory isn't working. Even
if it's just that I don't understand C++ maps they need to be cleared
when the DB's wiped (my favorite test these days) and I don't want to
spend the time now.
2017-11-11 18:46:02 -08:00
Eric House
bd4ddb0adf
name change
2017-11-11 15:26:09 -08:00
Eric House
02f05dc867
fix to compile with UDP packet logged
...
to match up with delivery on client
2017-11-04 09:27:33 -07:00
Eric House
23f0d54f63
tweaks: add comment; show only pending messages
2017-10-30 19:07:13 -07:00
Eric House
7c22d1fdf8
fix failure of http apps to ack relay
...
Change how acks are handled by adding ability to look up connname by
combination of hid and token. It's a bit of a hack, but it's already
there in the protocol and enough to find the game.
2017-10-28 16:29:04 -07:00
Eric House
e3b2a0e4e1
fix misbehavior by new in-memory map
...
I don't know why what I was doing didn't work, but removing access via
[] and using iterators passes all the asserts I could throw at it.
2017-10-28 15:01:31 -07:00
Eric House
3645331061
pass hid in to db function getting per-dev info
...
Somehow I've been failing to treat this column as an array for some
time. I don't have any test cases that failed but it was clearly
wrong. Test cases still pass....
2017-10-25 20:33:25 -07:00
Eric House
cc54621e45
store message first, remove on ack
2017-10-25 05:51:45 -07:00
Eric House
37ecd81c04
change param names
...
about to introduce a second. This will make things clearer. No code
change here though.
2017-10-10 20:17:36 -07:00
Eric House
2a3bd60740
supply missing param
2015-12-08 07:15:26 -08:00
Eric House
d468866a01
no more variables called socket; all are "sock" now.
2015-11-20 23:15:04 -08:00
Eric House
67f4e4475c
manual bring-over of relay changes for invite support
2015-07-11 08:08:22 -07:00
Relay User
8f863f0369
Make it possible to launch relay early in machine boot cycle before
...
postgres is running (e.g. from a @reboot shortcut in a crontab) by
having it wait, sleeping periodically, until a connection is
available. Requires new flag be passed into main.
2015-07-11 07:04:24 -07:00
Eric House
dba86a657f
add and handle new INVITE message types. (This can safely be added to shipping relay.)
2015-07-10 23:25:06 -07:00
Eric House
6fe0940187
don't log normal case as error
2015-02-20 07:52:19 -08:00
Eric House
c70fcf64a7
ignore client index of 0, since it means the device needs a slot
...
assigned.
2014-12-08 06:22:30 -08:00
Eric House
b8660470f7
include timestamp in "new day" post-crash line
2014-12-05 06:35:31 -08:00
Eric House
9ba9d258f3
If client provides its index, honor that when placing it in game. This
...
allows a game where indices have already been established over some
transport other than relay to start using the relay mid-game.
2014-12-04 06:03:42 -08:00
Eric House
f3828ab7c9
merge android_branch -> android_multi2
2014-11-22 17:15:22 -08:00
Eric House
4b635791d7
crash fix: provide missing param to format string
2014-11-22 17:08:17 -08:00
Eric House
68e7f303b0
oops -- here's the relay md5sum logging. app side went in prior.
2014-11-05 21:42:45 -08:00
Eric House
4de894627a
fix infinite loop -- duh
2014-04-18 06:01:03 -07:00
Eric House
0e4f24dfe9
use fixed string for model rather than clearing it
2014-04-17 08:24:09 -07:00
Eric House
6f0b5c1bea
empty the model string if the client version's lower than what I'm
...
about to release and there's non-ascii stuff in it.
2014-04-17 08:13:01 -07:00
Eric House
f05b1e0525
log model -- can remove later
2014-04-17 07:44:32 -07:00
Eric House
27a5990283
log out-of-date token
2014-02-24 08:00:52 -08:00
Eric House
b43855a313
fix curses build for 64bit compile and to use common layout (meaning
...
tray is now under the board unstead of to the right). Works on 64-bit
system at least for non-networked games.
2014-01-05 13:04:59 -08:00
Eric House
b3723897d5
to prevent duplicate UDP packets (I hope), bind the UDP socket to a
...
single ip address rather than INADDR_ANY. Get that address at runtime
for an interface provided in the config file.
2013-09-30 23:40:12 -07:00
Eric House
4202f24091
don't allow reregister with a RELAY_ID (a client bug)
2013-09-26 08:37:21 -07:00
Eric House
657d0d2b1f
-l - means log to stderr
2013-09-15 10:04:45 -07:00
Eric House
2629c07256
Address problem with devids (e.g. GCM): until now when you got a new
...
devid you tossed your relayID and reregistered. Which meant any
existing messages meant for your relayID were orphaned, and any open
games didn't know who they belonged to until you reconnected to them
with your new relayID. So: modify the UDP protocol (though not on
Android yet) to include both relayID and devid with registration, with
one or the other an empty string if not present or not changed from
earlier. I can't fix existing clients that are dropping their
relayIDs, but when one does a re-connect without a relayID I can look
it up from the existing game record, then reuse it rather than issue a
new one. Better than nothing -- and that protocol will be obsolete
soon anyway.
2013-09-14 21:06:14 -07:00
Eric House
c115752852
supply in linux client, and look for and store on relay, os version
2013-09-07 16:17:31 -07:00
Eric House
032f8c1f99
add ctrl port command to post UPGRADE message to clients
2013-09-03 06:52:02 -07:00
Eric House
8da0b73744
replace string_printf() with new class derived from std::string with
...
printf() method.
2013-09-02 13:17:42 -07:00
Eric House
d9bfc01e35
change unsigned char to uint8_t (using sed)
2013-08-29 22:55:11 -07:00
Eric House
0e6b211a76
fix treating game-targeted messages as if they were device-targeted.
...
Should probably have separate tables for the two types....
2013-08-29 06:37:22 -07:00
Eric House
b80051cc73
send dev-targeted messages pulled from db by rewriting their headers
...
with a new packetID.
2013-08-28 21:36:12 -07:00
Eric House
cd2b83c9c5
type change: use vector<uint8_t> rather than string in struct for
...
retrieving data from db.
2013-08-28 20:33:42 -07:00
Eric House
063b01d3d8
change most len-as-short+bytes strings to vli+bytes; add device model
...
to what's passed for device registration, and store it in a new column
in devices table.
2013-08-25 21:20:26 -07:00
Eric House
d10e9f6235
use vlis for acks in both directions
2013-08-25 16:59:07 -07:00
Eric House
91235f3be7
begin process of using variable-length-ints in udp protocol. Works
...
between linux client and relay, but unrelased features of Android
client will be broken until fixed.
2013-08-25 12:34:35 -07:00
Eric House
38adea1612
fix infinite recursion
2013-08-22 08:23:32 -07:00
Eric House
1af12f1de2
refactor packet assembly/sending so posting message can post all,
...
including header.
2013-08-22 08:15:38 -07:00
Eric House
16aafccec6
to telnet interface add ability to forget device and to send to one
...
not known (which will make message available next time it connects or
via GCM); rename methods.
2013-08-22 06:29:20 -07:00
Eric House
2157706dcd
add client version and a desc string to devices DB and to reg info sent to relay
2013-08-20 08:09:45 -07:00
Eric House
0868a33c83
print out whether message is ACK'd or not
2013-08-18 20:52:09 -07:00