1
0
mirror of https://github.com/aziascreations/BakaShrot.git synced 2026-11-23 20:58:46 +01:00

Stopped long queries, Read is_open() through TLS, Simplified answers and paging

- [server] query_time_limit (20 s by default) stops a client's query
  through SQLite's progress handler: refused with QueryTimedOut (11). A
  client closing while its query runs stops it too.
- The answer timeout in the DLL (BakaShrot_SetAnswerTimeout /
  GetAnswerTimeout, kept across connections), Python (answer_timeout)
  and C# (AnswerTimeoutMs); QueryTimedOut in every binding.
- is_open() reads what's waiting through TLS: a close_notify says
  closed, TLS's own records keep it open, unasked data or a broken
  stream close it.
- The Rust client checks an answer's type in one place (TryFrom per
  packet); Client::wait() pings while waiting (the tool's --follow).
- Pair::from(&Head), heads_after taking a Pair; simpler SyncState
  paging on both ends; the writer's redundant rollback check dropped.
- codes.rs: the bindings' error codes and copied values match Rust's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-21 12:17:28 +01:00
parent a6ade535d0
commit 1bae8ee182
37 changed files with 1064 additions and 264 deletions
+14
View File
@@ -125,6 +125,20 @@ ptrdiff_t BakaShrot_Disconnect(int64_t client);
*/
ptrdiff_t BakaShrot_Ping(int64_t client);
/**
* Sets how long an answer may take, in milliseconds (more than 0; 30000
* until changed): longer for a slow query, say. Past it, the request
* fails with `ConnectionLost`, the connection closed (the server then
* stops the query it was running). Kept for the next connections, and
* applied to the current one: 1, or 0 if refused.
*/
ptrdiff_t BakaShrot_SetAnswerTimeout(int64_t client, int64_t milliseconds);
/**
* How long an answer may take, in milliseconds (`BakaShrot_SetAnswerTimeout()`).
*/
int64_t BakaShrot_GetAnswerTimeout(int64_t client);
/**
* The node this client is, as the server said when connecting: its
* certificate's name. Empty when not connected.