Shivaram Lingamneni
0af0a0b445
fix a race condition
Setting `closed` on the socket (which can mean either "the socket is broken"
or "we should close the socket at the next opportunity") was racing against
the final write. Even if socket.closed is true, we should attempt to send
buffered message data to the socket, before we send the `finalData` and
actually call `Close`.
před 5 roky
Shivaram Lingamneni
97e71dfef7
extract Semaphore to utils package
před 5 roky
Shivaram Lingamneni
85493ef031
upgrade message-tags to non-draft version
před 5 roky
Shivaram Lingamneni
c8cf0befc6
fixes to irc/socket.go
* fix a race condition: a call to `Write` does not spawn a writer goroutine
if the trylock is held, so `BlockingWrite` must check for fresh data after
releasing the trylock
* streamline some close/finalize logic
před 5 roky
Shivaram Lingamneni
a0bf548fc5
draft/resume-0.2 implementation, message history support
před 5 roky
Shivaram Lingamneni
3150f4e23b
reduce copying of output lines
před 6 roky
Shivaram Lingamneni
ebfef1e848
add Semaphore and ServerSemaphores
před 6 roky
Shivaram Lingamneni
f54561171e
try to reduce redundant goroutines
před 6 roky
Shivaram Lingamneni
4778e7bcc7
fixes
* Placate `go vet`
* Reorder the `send` loop, clarify things a little
před 6 roky
Shivaram Lingamneni
b2f798cf03
eliminate dedicated RunSocketWriter goroutine
před 6 roky
Shivaram Lingamneni
d1f5c59eef
fix #190
před 6 roky
Shivaram Lingamneni
8fd1446627
tweak: clean up Socket.Close()
před 6 roky
Shivaram Lingamneni
0a432c9d99
do an actual nonblocking send instead of the len() trick
před 6 roky
Shivaram Lingamneni
fa5d4be718
refactor irc.Socket
před 6 roky
Daniel Oaks
2419f69879
Move all errors into errors.go
před 6 roky
Euan Kemp
2e8a98a925
irc: fix timer memleak
This is a gotcha called out in the `time.After` docs. `time.After` will
leak the underlying channel if nothing ever receives on it.
před 7 roky
Daniel Oaks
4254672133
socket: Fix bad mutex unlock
před 7 roky
Daniel Oaks
c911ff2bcd
Squash a bunch of possible races
před 7 roky
Daniel Oaks
f7a4f5d956
socket: Move to a timing-out send method that reduces goroutines and ensures QUIT/ERROR are sent
před 7 roky
Daniel Oaks
067f982da4
socket: Remove old comment
před 7 roky
Daniel Oaks
4a66771c39
socket: Attempt to close sockets better
před 7 roky
Daniel Oaks
86957d4392
socket: Fix quitting
před 7 roky
Daniel Oaks
121269661b
socket: Make closing work a little better
před 7 roky
Daniel Oaks
317a804644
Fix dates at top of source files
před 7 roky
Daniel Oaks
91fab3ba55
socket: Better deal with chanfloods
před 7 roky
Daniel Oaks
f5536d7945
socket: Add a simple println when SendQ exceeded, config comment update
před 7 roky
Daniel Oaks
c3be2d0d46
socket: Fixup sending code so we can support more connections
před 7 roky
Daniel Oaks
f29a5f0e70
socket: Very initial SendQ limit
před 7 roky
Daniel Oaks
de4db1c6ef
socket: Start overhaul of sockets and writing
před 7 roky
Daniel Oaks
149550b453
socket: Timeout TLS handshakes
před 7 roky
Daniel Oaks
b5e7d8968f
accounts: Add SASL EXTERNAL handler
před 7 roky
Daniel Oaks
49034cb20e
certfp: Add certfp retrieval from client
před 7 roky
Daniel Oaks
2f08401a0f
Attempt to add mostly-correct license info at the top of each file... track this stuff a bit better
před 8 roky
Daniel Oaks
9860094020
socket: Use updated socket code
před 8 roky
Jeremy Latt
4ce4ba31c5
keep track of whether sockets are closed
před 10 roky
Jeremy Latt
6c10add399
improve performance by using less goroutines
- get rid of command channel in Client
- get rid of loginTimer; use other timers instead
- move debugging code to debug.go
před 10 roky
Jeremy Latt
142bf3d3bb
don't async buffer flushing
před 10 roky
Jeremy Latt
b0bb0faadc
remove unnecessary String()s; rename parse functions
před 10 roky
Jeremy Latt
3b12dec207
cleanup
před 10 roky
Jeremy Latt
2dc69c7e3d
use a Scanner instead of ReadString
před 10 roky
Jeremy Latt
5f268e4847
async all write buffer flushes
před 10 roky
Jeremy Latt
d696f2313e
stop leaking client goroutines; closes #34
před 10 roky
Jeremy Latt
e15f47c766
move to channel-based logging
před 10 roky
Jeremy Latt
77d053ccac
get rid of editableCommand
před 10 roky
Jeremy Latt
04f0b2c48d
trim trailing space from commands
před 10 roky
Jeremy Latt
6f00f89efa
relax unicode parsing rules
NFKC was previously used for all text. Now, we use NFKC for all args but
the last, which may be free text. This arg is normalized with NFC to
allow for formatting characters.
před 10 roky
Jeremy Latt
45bb0d05e7
normalize all unicode input from the client
před 10 roky
Jeremy Latt
be089e7f5f
do bcrypt in the client main routine
před 10 roky
Jeremy Latt
41e6baf9d4
get rid of a race; use pointers where possible
před 10 roky
Jeremy Latt
0856a9fa81
flag socket as closed when writes fail
před 10 roky