Commit Graph

643 Commits

Author SHA1 Message Date
Ștefan Talpalaru c15c985c1f
support nimStackTraceOverride (#181) 2021-05-06 09:49:55 +02:00
Jacek Sieka 43b8aada20
Add message to task failure message (#183) 2021-05-06 09:46:58 +02:00
cheatfate 645d62db78
Remove fastpath execution and finally fix issue. 2021-04-27 00:07:49 +03:00
Eugene Kabanov 39f4060e07
Refactor and optimization of BoundedStream. (#180)
Documentation for BoundedStream.
Fix HttpServer bounding.
2021-04-26 14:05:37 +03:00
Eugene Kabanov 833d968782
Fix upload() issue and adding tests. (#179) 2021-04-24 20:32:21 +03:00
cheatfate 7389cfc60b
Remove CPP from CI testing matrix. 2021-04-22 15:37:52 +03:00
Eugene Kabanov e6ba00cb81
Fix reading could stuck on very big chunked headers and tests. (#178) 2021-04-22 15:32:28 +03:00
Eugene Kabanov aab1e30a72
Refactor common.nim and add more resolve procedures. (#177)
* Refactor common.nim to remove `result` usage.
Fix comparison of TransportAddress issue.
Add resolveTAddress procedures for both IPv4 and IPv6 addresses.
Fix tests.

* Bump version to 3.0.2.
2021-04-10 00:39:54 +03:00
Jacek Sieka 895fc53193
add explicit gcsafe annotations (fixes #174) (#175)
Seems like a variation of https://github.com/nim-lang/Nim/issues/17369
2021-04-03 10:05:08 +02:00
markspanbroek e5d3ecdd01
Ensures that asyncmacro2 does not raise exceptions (#172)
* Ensures that asyncmacro2 does not raise exceptions

* Remove unnecessary include
2021-03-30 16:48:20 +02:00
Jacek Sieka 075b7abf4c
fix Defect check in non-strict mode (#170) 2021-03-25 15:53:33 +01:00
Kim De Mey c206d2bc19
Add raises annotation to withTimeout callbacks (#168) 2021-03-25 14:20:26 +01:00
Jacek Sieka 4abd7a5645
exception tracking (#166)
* exception tracking

This PR adds minimal exception tracking to chronos, moving the goalpost
one step further.

In particular, it becomes invalid to raise exceptions from `callSoon`
callbacks: this is critical for writing correct error handling because
there's no reasonable way that a user of chronos can possibly _reason_
about exceptions coming out of there: the event loop will be in an
indeterminite state when the loop is executing an _random_ callback.

As expected, there are several issues in the error handling of chronos:
in particular, it will end up in an inconsistent internal state whenever
the selector loop operations fail, because the internal state update
functions are not written in an exception-safe way. This PR turns this
into a Defect, which probably is not the optimal way of handling things
- expect more work to be done here.

Some API have no way of reporting back errors to callers - for example,
when something fails in the accept loop, there's not much it can do, and
no way to report it back to the user of the API - this has been fixed
with the new accept flow - the old one should be deprecated.

Finally, there is information loss in the API: in composite operations
like `poll` and `waitFor` there's no way to differentiate internal
errors from user-level errors originating from callbacks.

* store `CatchableError` in future
* annotate proc's with correct raises information
* `selectors2` to avoid non-CatchableError IOSelectorsException
* `$` should never raise
* remove unnecessary gcsafe annotations
* fix exceptions leaking out of timer waits
* fix some imports
* functions must signal raising the union of all exceptions across all
platforms to enable cross-platform code
* switch to unittest2
* add `selectors2` which supercedes the std library version and fixes
several exception handling issues in there

* fixes

* docs, platform-independent eh specifiers for some functions

* add feature flag for strict exception mode

also bump version to 3.0.0 - _most_ existing code should be compatible
with this version of exception handling but some things might need
fixing - callbacks, existing raises specifications etc.

* fix AsyncCheck for non-void T
2021-03-24 10:08:33 +01:00
Jacek Sieka b964ba2966
Update README (#167) 2021-03-20 08:12:35 +01:00
Eugene Kabanov c8eefb9382
Split HTTPS and HTTP servers. (#165)
* Split HTTPS and HTTP servers.

* Fix review commens
2021-03-17 15:40:40 +02:00
Eugene Kabanov 0b78606e41
Add `server` and `host` headers handling. (#164)
Fix response headers generation to avoid unnecessary computations.
2021-03-11 13:41:13 +02:00
Eugene Kabanov f774644129
Fix integer decoding overflow issue. (#163)
Switch to stew.base10 procedures.
Adjust tests to follow new behavior.
Bump version to 2.6.1.
2021-03-06 00:22:32 +02:00
Andreas Rumpf 1324b2f787
Enable --gc:orc testing for nim-chronos (#161)
* enable --gc:orc testing on nim devel (1.5.x)
2021-03-03 20:04:09 +02:00
cheatfate 1243aef627
Bump chronos version to 2.6.0. 2021-03-02 15:27:42 +02:00
Eugene Kabanov c31e4537fe
Fix contentType handling code. (#162)
Add more respond() aliases.
Add responded() to check if response is already sent.
2021-03-02 15:26:07 +02:00
cheatfate 03707426e4
Remove Travis CI badge and move Github Actions badge. 2021-02-28 00:12:49 +02:00
cheatfate 72151b99cc
Fix `HttpTable.contains` argument requirements. 2021-02-26 11:31:46 +02:00
Eugene Kabanov eb6e32605f
Fix #156 and refactor osnet.nim (#157)
* Refactor osnet.nim to not use `result`.
Fix #156.

* Fix linux compilation error.
2021-02-25 22:04:56 +01:00
cheatfate d6a39e46e1
Fix tests. 2021-02-21 17:34:55 +02:00
cheatfate d595e0dbc6
Send `Content-Length: 0` on error.
Handle `DisconnectError`.
2021-02-21 04:22:59 +02:00
cheatfate 60a53eea99
Fix import/export issue of httputils.
Add bound address to HttpServer object.
2021-02-20 19:41:22 +02:00
Eugene Kabanov d49e0a9c47
Add drop() implementation (was missed) to httpserver and fix transport leak. (#158)
* Add drop() implementation (was missed).
Add tests for drop().
Fix transport leak because of drop().

* Fix future leak.
2021-02-19 14:07:20 +02:00
cheatfate 25688cd0aa Add hexValue tests. 2021-02-18 22:16:04 +02:00
cheatfate 4e9a857b90 Link to original procedure for hexValue(). 2021-02-18 22:16:04 +02:00
cheatfate 1d49ae7a47 Fix x86 int conversion. 2021-02-18 22:16:04 +02:00
cheatfate eb81018d02 Address review comments and fix issues found.
Adding more tests.
2021-02-18 22:16:04 +02:00
cheatfate fc0d1bcb43 Address review comments. 2021-02-18 22:16:04 +02:00
cheatfate 6f8d06f12d Add HttpDisconnectError to avoid client processor notification call. 2021-02-18 22:16:04 +02:00
cheatfate 1789328748 Set TLSStream default to use TLS1.2 only. 2021-02-18 22:16:04 +02:00
cheatfate 3d74c5cdd2 Add tests for getContentEncoding() and getTransferEncoding(). 2021-02-18 22:16:04 +02:00
cheatfate b47fcb3e86 Annotate with `raises:[Defect]`. 2021-02-18 22:16:04 +02:00
cheatfate 45cb009be2 Remove `bodyTimeout` because downloading body is not under our control. 2021-02-18 22:16:04 +02:00
cheatfate 4406ab7072 Add positive decimal integer parsing tests. 2021-02-18 22:16:04 +02:00
cheatfate 3495122867 Fix getMultipartBoundary() issues and add tests for it. 2021-02-18 22:16:04 +02:00
cheatfate 9b48496513 Fix compilation error with nimcrypto/utils import. 2021-02-18 22:16:04 +02:00
cheatfate 3569e4d553 testutils must be last executed test. 2021-02-18 22:16:04 +02:00
cheatfate 3e9ffae407 Properly fix case when request body size exceeds maximum allowed size. 2021-02-18 22:16:04 +02:00
cheatfate 970e5641d7 Add less strict rules for BoundStream reader/writer. 2021-02-18 22:16:04 +02:00
cheatfate d43a9cb92d HttpServer now supports TLS.
Some TLSStream fixes to properly support EOF.
Some HttpServer to properly support TLS handshake problems.
HttpServer test suite for HTTPS.
2021-02-18 22:16:04 +02:00
cheatfate 1a3e9162a4 Fix multipart end of message handling.
Add apps.nim.
Change copyrights dates.
Add httpserver tests to test suite.
2021-02-18 22:16:04 +02:00
cheatfate 789a5f8252 Fix dependency name. 2021-02-18 22:16:04 +02:00
cheatfate fb11d9f8ab Add httptable changes. 2021-02-18 22:16:04 +02:00
cheatfate 8c20b369b7 Fix queryParams() to not produce empty values.
Fix part() cancellation.
Add requestInfo() procedure.
Fix request.scheme.
Add MultiPart.isEmpty()
Fix MultiPart counter.
Add isEmpty() for HttpTable.
Add some documentation in HttpTable.
2021-02-18 22:16:04 +02:00
cheatfate a310a5620a General fixes. 2021-02-18 22:16:04 +02:00
cheatfate 0b03f8ec50 Expect header handling and response preparations. 2021-02-18 22:16:04 +02:00