| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Implements: https://todo.sr.ht/~runxiyu/cca/13
|
| |
|
|
|
|
| |
I'm not sure whether this is actually better than locking.
|
|
|
|
|
| |
This makes it use slightly less memory. Approximately courseGroupT bits
per connection!
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
- Remove sub-Makefiles; recursive make is annoying
- Just use one top-level Makefile that builds everything
- Embed templates and minified static resources into the binary
- Embed all compiled documentation into the binary and serve
- Embed all source into the binary and serve
|
|
|
|
| |
And adjust Makefiles, admin handbook, and lint.sh accordingly.
|
| |
|
| |
|
|
|
|
|
| |
Luckily we encounter a database error before we have the chance to
dereference a null pointer. But it's still good practice to check.
|
|
|
|
| |
References: https://todo.sr.ht/~runxiyu/cca/7
|
|
|
|
| |
This also deduplicates some code.
|
|
|
|
| |
This is being done quite a few times, so let's make it a function.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When beginning to handle a WebSocket connection, we shall create a new
context, with the request context as its parent. We use the new context
for everything from now on, except for reporting error messages, which
is handled by creating a reportError function in a closure in
makeReportError and passing it along to command-handling functions.
Note that if one user attempts to rapidly launch WebSocket connections,
there might still be a race condition where the old connection hasn't
been completely established yet (i.e. an entry hasn't been added to
cancelPool) and the new connection isn't able to cancel the old
connection. I'm a bit tired to think of a solution now but it could
probably be solved by moving the cancellation registration and
cancelling sooner during the initial handshake.
Note that more parts of the event loop needs to select from ctx.Done
(from newCtx) for this to work reliably.
|
|
|
|
|
|
|
| |
Previously both commands used N, and deselection wasn't really
implemented on the JavaScript side. It worked and didn't throw an
exception but it's technically wrong and the user could see an empty
number field for a split second.
|
| |
|
|
|
|
|
| |
It's done in the WebSocket routines rather than in the template maker
because it's relatively easier to write the logic this way.
|
|
|