| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
* nativesockets docs minor [backport: 1.2]
* remove annoying messages
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add some enhancements to `jsonutils.nim`
* Use `jsonutils.nim` hookable API to add a possibility to deserialize
JSON arrays directly to `HashSet` and `OrderedSet` types and
respectively to serialize those types to JSON arrays.
* Also add a possibility to deserialize JSON `null` objects to Nim
option objects and respectively to serialize Nim option object to JSON
object if some or to JSON `null` object if none.
* Move serialization/deserialization functionality for `Table` and
`OrderedTable` types from `jsonutils.nim` to `tables.nim` via the
hookable API.
* Add object `jsonutils.Joptions` and parameter from its type to
`jsonutils.fromJson` procedure to control whether to allow
deserializing JSON objects to Nim objects when the JSON has some
extra or missing keys.
* Add unit tests for the added functionalities to `tjsonutils.nim`.
* improve fromJsonFields
* Add changelog entry for the jsonutils enhancements
* Add TODO in `jsonutils.nim`
* Added an entry to "Future directions" section in `jsonutils.nim` as
suggestion for future support of serialization and de-serialization of
nested variant objects.
* Added currently disabled test case in `tjsonutils.nim` for testing
serialization and de-serialization of nested variant objects.
* Move JSON hooks to `jsonutils.nim`
Move `fromJsonHook` and `toJsonHook` procedures for different types to
`jsonutils.nim` module to avoid a dependency of collections modules to
the `json.nim` module.
The hooks are removed from the following modules:
* `tables.nim`
* `sets.nim`
* `options.nim`
* `strtabs.nim`
* Add some tests about `StringTableRef`
Add tests for `StringTableRef`'s `fromJsonHook` and `toJsonHook` to
`tjsonutils.nim`.
* Disable a warning in `jsonutils.nim`
Mark `fun` template in `jsonutils` module with `{.used.}` pragma in
order to disable `[XDeclaredButNotUsed]` hint. The template is actually
used by the `initCaseObject` macro in the same module.
Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
|
|
|
|
|
|
|
| |
* add getprotobyname
* tests, docs, changelog
* add since
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
* Added SSL_CTX_set_session_id_context()
* Added basic nimdoc
* Raise an error if sessionIdContext is longer than the maximum length
* Update nimdocs
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Changes for FreeRTOS/LwIP Port for the ESP32 (ESP-IDF)
Adding FreeRTOS/LwIP to compiler:
* adding freertos option
* dyncalls for freertos
* add freertos to posix os list
* adding lwip option
Setting up networking FreeRTOS/LwIP Port:
* setting up lwip network for freertos
* fixing posix / networking for freertos
* disable setInheritable for freerots
* using lwip for net control items
* Fix builds by ignoring lib/posix/posix_freertos_consts.nim similar to lib/posix/posix_other_consts.nim
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Added more SSL documentation to `net` module.
* Changed two of the net.nim doc refs to links.
* Update lib/pure/net.nim doc wording.
Co-authored-by: Dominik Picheta <dominikpicheta@googlemail.com>
* Update lib/pure/net.nim - added space to doc URI
Co-authored-by: alaviss <leorize+oss@disroot.org>
* Fixed another doc URI in net module.
* For net module doc added warning to connect procedure.
* Update net.nim
Co-authored-by: Dominik Picheta <dominikpicheta@googlemail.com>
Co-authored-by: alaviss <leorize+oss@disroot.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add test coverage for atomics
Signed-off-by: Elijah Shaw-Rutschman <elijahr@gmail.com>
* Fix compareExchange bugs for non-trivial objects
Bugs fixed:
1. compareExchange would not set the desired value in the success case.
2. compareExchange would not set var expected to the found value in the failure case.
3. withLock would spin forever running the unit tests. try..body..finally prevents this. Not sure why this makes a difference, since an exception wasn’t being raised, but clearing the guard in a finally block seems correct anyways.
Signed-off-by: Elijah Shaw-Rutschman <elijahr@gmail.com>
|
|
|
|
|
| |
* better strict funcs, WIP
* progress
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* std/with support filed assign
* add changelog
* add support x.dup.with
* add example
* revert support x.dup.with; add example
* update changelog; fix assignment in parameter
* Update changelog.md
* add example for assignment in parameter
* Remove colon style assign
Co-authored-by: Clyybber <darkmine956@gmail.com>
|
|
|
|
|
| |
The closed flag isn't a good design by any means, but let's have this
working first before I get rid of the flag and potentially create a
non-backportable commit.
|
|
|
| |
Just a small fix for a typo ("for for").
|
| |
|
|
|
|
|
| |
* [FIX] strtabs interpolation in nimscript
* [TEST] Use `static` in strtabs test
|
|
|
|
|
| |
* fix #15148
Co-authored-by: alaviss <leorize+oss@disroot.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit polishes the new proc introduced by d9ed816b10a6.
Changes:
- Rename to `toDeque` for more consistency with well-known procs like
`toHashSet` and `toTable`.
- Rename the `openArray` parameter. The name `arr` was potentially less
clear given that the proc can be used with a seq (or string).
- Add a `since` annotation.
- Reword the doc comment, and clarify that ordering is preserved.
- Add runnableExamples.
- Add "see also" cross linking between `initDeque` and `toDeque`.
- Remove duplicate `nextPowerOfTwo`. The `initImpl` template already
includes it.
- Implement the proc using the `items` iterator, rather than indexing.
This matches the implementation of `sets.toHashSet` and
`tables.toTable`.
- Add a test within `when isMainModule`.
- Add a changelog entry.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add ability to initialize a deque with a sequence
Example:
var dq = initDeque[char](@['a', 'b', 'c'])
* Update deques.nim
* Optimized deque initialization
* Sequence replaced by open array in deque initialization
|
| |
|
| |
|
|
|
|
|
|
| |
These don't seem to make sense for the purpose of the procs and lead
to errors when the `--experimental:strictFuncs` feature is enabled.
See also https://github.com/nim-lang/Nim/issues/15142
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* net: allow close() to ignore SSL failures due to disconnections
Comes with this PR is also a SIGPIPE handling contraption.
* net: don't do selectSigpipe() on macOS
macOS sockets have SO_NOSIGPIPE set, so an EPIPE doesn't necessary mean
that a SIGPIPE happened.
* net: fix alreadyBlocked logic
* net: WSAESHUTDOWN is also a disconnection error
|
|
|
|
|
|
|
| |
* improve epoll docs
* export handles
* add comments and changelog
|
|
|
| |
This reverts commit 4bf8d38248f40cc0bf5323843a9ea38c5bcc20a8.
|
|
|
| |
The expected output necessarily cannot match the formatted string.
|
|
|
| |
It needs to have len defined first because of the assert .len > 0. I just moved it up a bit to make them work.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* asyncnet, net: don't attempt SSL_shutdown if a fatal error occurred
Per TLS standard and SSL_shutdown(3ssl). This should prevent errors
coming from a close() after a bad event (ie. the other end of the pipe
is closed before shutdown can be negotiated).
Ref #9867
* tssl: try sending until an error occur
* tssl: cleanup
* tssl: actually run the test
I forgot to make the test run :P
* tssl: run the test on ARC, maybe then it'll be happy
* tssl: turns off ARC, switch tlsEmulation on for freebsd
* tssl: document why tlsEmulation is employed
* net: move SafeDisconn handling logic to socketError
|
|
|
|
|
|
|
| |
* fix #14139
* Update lib/pure/collections/heapqueue.nim
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
Co-authored-by: Clyybber <darkmine956@gmail.com>
|
|
|
|
|
|
|
| |
(#15108)
avoid future implementation mischief. (Maybe not. Sometimes, general
distrust of theory leads people to distrust simple reasoning over times
from CPUs trying as hard as possible to mask DRAM latency via pre-fetch.)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#15104)
request. This can be conceived as an alternate, more capable resolution of
https://github.com/nim-lang/Nim/issues/12200
than
https://github.com/nim-lang/Nim/pull/12208
The code re-org idea here is to upgrade tablimpl.nim:`delImpl`/`delImplIdx`
to abstract client code conventions for cell emptiness & cell hashing via
three new template arguments - `makeEmpty`, `cellEmpty`, `cellHash` which
all take a single integer argument and clear a cell, test if clear or
produce the hash of the key stored at that index in `.data[]`.
Then we update the 3 call sites (`Table`, `CountTable`, `SharedTable`) of
`delImpl`/`delImplIdx` by defining define those arguments just before the
first invocation as non-exported templates.
Because `CountTable` does not save hash() outputs as `.hcode`, it needs a
new tableimpl.nim:`delImplNoHCode` which simply in-lines the hash search
when no `.hcode` field is available for "prefix compare" acceleration.
It is conceivable this new template could be used by future variants, such
as one optimized for integer keys where `hash()` and `==` are fast and
`.hcode` is both wasted space & time (though a small change to interfaces
there for a sentinel key meaning "empty" is needed for maximum efficiency).
We also eliminate the old O(n) `proc remove(CountTable...)` in favor of
simply invoking the new `delImpl*` templates and take care to correctly
handle the case where `val` is either zero for non-existent keys in `inc`
or evolves to zero over time in `[]=` or `inc`.
The only user-visible changes from the +-42 delta here are speed, iteration
order post deletes, and relaxing the `Positive` constraint on `val` in
`proc inc` again, as indicated in the `changelog.md` entry.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* fix #11352 strutil.insertSep handle negtive number
* test for #11352
* optimize
* not parts string var
* Update lib/pure/strutils.nim
Thanks!
Co-authored-by: alaviss <leorize+oss@disroot.org>
* need to be countdown
Co-authored-by: alaviss <leorize+oss@disroot.org>
|
| |
|
| |
|
| |
|
|
|
|
| |
There was a recent `rightSize` change in tables.nim, so the existing
value (4) was creating too large tables.
|
| |
|
| |
|
| |
|
|
|
|
| |
* prevent newlines where they shouldn't be
* 'contentLength' shouldn't be negative
|