| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
* [FIX] strtabs interpolation in nimscript
* [TEST] Use `static` in strtabs test
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
client code since Linux `inotify` is much like Linux `getdents64`.
Expanding on "almost always"..The only time that this `iterator` logic
is ***not*** needed on the output of a `read` from inotify fd's is when
one passes a length to `read` *guaranteed* to only pass one event struct
in the buffer. That unusual circumstance requires (at least!) knowing
the length of the delivered filename before an event occurs, and the
filename itself is optional for some event types.
It is *far* more common to not know lengths in advance which means one
passes a buffer big enough for at least one maximum length directory
entry (256 bytes) which is then also big enough for *many* "typical"
length entries and therefore many events. In such more common scenarios
this iterator logic is definitely needed.
Further, not using this logic, yet treating the return from read as "the
whole answer" can test ok on "thin" event streams (e.g. 1 event per ms),
hiding a latent bug of processing only the first event.
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
| |
* fix sqlgetdata import
* fix db_odbc
* more fixes
* fix style
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
| |
code compatibility (#15105)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* shadow dom api
* fix typos
* host to Element type
* fix code style
* move elementsFromPoint to dom_extensions.nim
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* readLine: Unicode support for Windows console
When input is read from the Windows console, input encoding is UTF16. This is translated internally to UTF8.
* readLine: Remove recursive imports
* readLine: Fix issues with --gc:arc
**--gc:arc** defines **nimv2**. This changes the definition of **WideCStringObj**.
Also an empty string should be returned in case of EOF.
|
| |
| |
| |
| | |
**--gc:arc** defines **nimv2**. This changes the definition of **WideCStringObj**.
Also an empty string should be returned in case of EOF.
|
| | |
|
| |
| |
| | |
When input is read from the Windows console, input encoding is UTF16. This is translated internally to UTF8.
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
* io: fix SetHandleInformation signature to match Windows'
Fixes #14980
* rename Handle -> IoHandle because system.nim is a mess
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Fixes #15003.
This is a serious bug which occurs when data cannot be read/sent
immediately and there are a bunch of other read/write events
pending. What happens is that the new events are dropped which
results in the case of the reported bug resulted in some data not
being sent (!).
|
| | |
|
| |
| |
| | |
The sockets which *cannot* be _[read from or written to]_ will also be removed from ``readfds``.
|
| |
| |
| |
| |
| |
| | |
nim transforms code (#14924)
* enable,document,test getImplTransformed, very useful for understanding how nim transforms code
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* Fix #14906 by wrapping outputStream with PipeOutStream
* Fix compile error when ./build_all.sh
* Use PipeOutStream on posix
* Fix compile error when build_all.sh
* Use ptr UncheckedArray
* Replace copyRefObj
* Remove tmp buffer from posPeekData
* Add more tests for outputStream
* Add comments about PipeOutStream.buffer
* Fix bug in posReadLine
* Move implementation of newPipeOutStream to streamwrapper module
|
| |
| |
| |
| |
| | |
* fix odbc regressions
* make only necessary changes
|
| |
| |
| |
| |
| |
| |
| | |
* fix #14082, don't crash on incorrectly formatted input
* address code review
* remove duplication
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
* Fix #14994
* Revert misplaced "optimization"
* Typo
|