summary refs log tree commit diff stats
path: root/lib/pure/asyncnet.nim
Commit message (Collapse)AuthorAgeFilesLines
* fixes ptr to cstring warnings[backport] (#20848)ringabout2022-11-161-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * fix =#13790 ptr char (+friends) should not implicitly convert to cstring * Apply suggestions from code review * first round; compiles on windows * nimPreviewSlimSystem * conversion is unsafe, cast needed * fixes more tests * fixes asyncnet * another try another error * last one * true * one more * why bugs didn't show at once * add `nimPreviewCstringConversion` switch * typo * fixes ptr to cstring warnings[backport] * add fixes Co-authored-by: xflywind <43030857+xflywind@users.noreply.github.com>
* Markdown code blocks migration part 7 (#20547)Andrey Makarov2022-10-121-3/+2
|
* make more standard libraries work with `nimPreviewSlimSystem` (#20343)ringabout2022-09-271-0/+4
| | | | | | | | | | | | | | | | | | | | | | | * make more standard libraries work with `nimPreviewSlimSystem` * typo * part two * Delete specutils.nim * fixes more tests * more fixes * fixes tests * fixes three more tests * add formatfloat import * fix * last
* remove `shallow` usages for ORC (#20109)ringabout2022-08-231-1/+2
|
* enable style:usages for stdlib tests [backport: 1.6] (#19715)flywind2022-04-131-3/+3
| | | | | | | | | | | | | | | * enable style:usages for stdlib tests * freeAddrInfo * more tests * importc * bufSize * fix more * => parseSql and renderSql
* Add Zephyr Support (#19003)Jaremy Creechley2021-10-241-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Porting Nim to run on Zephyr. Includes changes to `std/net`. Squashed commit of the following: tweaking more memory / malloc things revert back bitmasks tweaking nim to use kernel heap as C malloc doesn't work fixing socket polling on zephyr cleanup getting maximum sockets for process or for rtos'es reorganizing and fixing net for async / system merge netlite changes back into nativesockets merge netlite changes back into nativesockets reverting native sockets back tweaking nim / zephyr network adding option to run 'net-lite' from linux bridging zephyr's max connections fixing net errors fixing compilation with getAddrString fixing compilation with getAddrString experimenting with a nativesockets_lite ... getAddrString experimenting with a nativesockets_lite ... getAddrString experimenting with a nativesockets_lite ... getLocalAddr experimenting with a nativesockets_lite ... getLocalAddr experimenting with a nativesockets_lite ... add note regarding incorrect FreeRTOS Sockadd_in fields changing to NIM_STATIC_ASSERT cleaning up the static_assert error messages cleaning up the static_assert error messages setting up static assert ftw! testing compile time asserts reworking Sockaddr objects to more closely match various platforms reworking Sockaddr objects to more closely match various platforms reworking Sockaddr objects to more closely match various platforms finding missing items (issue #18684) fixup posix constants (issue #18684) adding plumbing for zephyr os (issue #18684) adding plumbing for zephyr os (issue #18684) * fixing constant capitalizations * remove extra debug prints and fix TSa_Family/cint issue * remove extra debug prints and fix TSa_Family/cint issue * Porting Nim to run on Zephyr. Includes changes to `std/net`. Squashed commit of the following: tweaking more memory / malloc things revert back bitmasks tweaking nim to use kernel heap as C malloc doesn't work fixing socket polling on zephyr cleanup getting maximum sockets for process or for rtos'es reorganizing and fixing net for async / system merge netlite changes back into nativesockets merge netlite changes back into nativesockets reverting native sockets back tweaking nim / zephyr network adding option to run 'net-lite' from linux bridging zephyr's max connections fixing net errors fixing compilation with getAddrString fixing compilation with getAddrString experimenting with a nativesockets_lite ... getAddrString experimenting with a nativesockets_lite ... getAddrString experimenting with a nativesockets_lite ... getLocalAddr experimenting with a nativesockets_lite ... getLocalAddr experimenting with a nativesockets_lite ... add note regarding incorrect FreeRTOS Sockadd_in fields changing to NIM_STATIC_ASSERT cleaning up the static_assert error messages cleaning up the static_assert error messages setting up static assert ftw! testing compile time asserts reworking Sockaddr objects to more closely match various platforms reworking Sockaddr objects to more closely match various platforms reworking Sockaddr objects to more closely match various platforms finding missing items (issue #18684) fixup posix constants (issue #18684) adding plumbing for zephyr os (issue #18684) adding plumbing for zephyr os (issue #18684) * fixing constant capitalizations * remove extra debug prints and fix TSa_Family/cint issue * remove extra debug prints and fix TSa_Family/cint issue * fixing PR issues * Porting Nim to run on Zephyr. Includes changes to `std/net`. Squashed commit of the following: tweaking more memory / malloc things revert back bitmasks tweaking nim to use kernel heap as C malloc doesn't work fixing socket polling on zephyr cleanup getting maximum sockets for process or for rtos'es reorganizing and fixing net for async / system merge netlite changes back into nativesockets merge netlite changes back into nativesockets reverting native sockets back tweaking nim / zephyr network adding option to run 'net-lite' from linux bridging zephyr's max connections fixing net errors fixing compilation with getAddrString fixing compilation with getAddrString experimenting with a nativesockets_lite ... getAddrString experimenting with a nativesockets_lite ... getAddrString experimenting with a nativesockets_lite ... getLocalAddr experimenting with a nativesockets_lite ... getLocalAddr experimenting with a nativesockets_lite ... add note regarding incorrect FreeRTOS Sockadd_in fields changing to NIM_STATIC_ASSERT cleaning up the static_assert error messages cleaning up the static_assert error messages setting up static assert ftw! testing compile time asserts reworking Sockaddr objects to more closely match various platforms reworking Sockaddr objects to more closely match various platforms reworking Sockaddr objects to more closely match various platforms finding missing items (issue #18684) fixup posix constants (issue #18684) adding plumbing for zephyr os (issue #18684) adding plumbing for zephyr os (issue #18684) * fixing constant capitalizations * remove extra debug prints and fix TSa_Family/cint issue * remove extra debug prints and fix TSa_Family/cint issue * Remerge * fixing constant capitalizations * remove extra debug prints and fix TSa_Family/cint issue * remove extra debug prints and fix TSa_Family/cint issue * fixing PR issues * fix maxDescriptors on zephyr/freertos * move maxDescriptors to selector.nim -- fixes compile issue * change realloc impl on zephyr to match ansi c behavior * change realloc impl on zephyr to match ansi c behavior * force compileOnly mode for tlwip Co-authored-by: Jaremy J. Creechley <jaremy.creechley@wavebaselabs.com> Co-authored-by: Jaremy Creechley <jaremy.creechley@panthalassa.com>
* Export sslHandle in `net` and `asyncnet`. (#17573)Ardek Romak2021-05-061-0/+5
|
* further progress on rst roles & directives (fix #17646) (#17659)Andrey Makarov2021-04-081-1/+1
| | | | | | | * further progress on rst roles & dir-s (fix #17646) * fix documents according to the messages * fix bug 17 from #17340
* Add hasDataBuffered to asyncnet (#16000)Dylan Modesitt2021-03-291-0/+5
| | | | Co-authored-by: flywind <xzsflywind@gmail.com> Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
* use .. warning:: (#17226)flywind2021-03-041-6/+4
| | | | | | | * remove unnecessary when statement * remove outdated codes * use warnings
* Change stdlib imports to use std prefix in most examples (#17202)Danil Yarantsev2021-02-281-1/+1
|
* use single backtick (#17166)flywind2021-02-231-72/+72
|
* Check for errors after sendPendingSslData (#16696)Yuriy Glukhov2021-01-131-6/+2
| | | | | * Check for errors after sendPendingSslData * Leftover comment removed
* asyncnet: don't try to close the socket again [backport] (#15174)alaviss2020-08-121-17/+20
| | | | | 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.
* asyncnet, net: don't attempt SSL_shutdown if a fatal error occurred (#15066)alaviss2020-07-301-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | * 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 style inconsistencies due to the previous commitnarimiran2020-07-061-8/+8
|
* revert 0944b0f4narimiran2020-07-061-8/+8
|
* add a second asyncnet.recvFrom (#14237)rockcavera2020-06-271-18/+51
| | | | | | | | | * add a second asyncnet.recvFrom * fixes * pre-allocating address * add a new nativesockets.getAddrString()
* asyncnet: clear SSL error queue before performing I/OLeorize2020-06-061-0/+1
| | | | Follow up of 476be6cc278d58232e2c6cd3515eb24eca7e2d38
* asyncnet, net: clear openssl error queue before performing I/OLeorize2020-06-061-0/+1
| | | | | | | | | | | | Per SSL_get_error(3): The current thread's error queue must be empty before the TLS/SSL I/O operation is attempted, or SSL_get_error() will not work reliably. There has been records of not clearing the error queue causing weird SSL errors when there shouldn't be any, see: https://github.com/openssl/openssl/issues/11889
* asyncnet, net: call SSL_shutdown only when connection establishedLeorize2020-06-061-1/+8
| | | | | | This commit prevents "SSL_shutdown while in init" errors from happening. See https://github.com/openssl/openssl/issues/710#issuecomment-253897666
* asyncdispatch, asyncnet: add inheritance control (#14362)alaviss2020-05-201-11/+33
| | | | | * asyncdispatch, asyncnet: add inheritance control * asyncnet, asyncdispatch: cleanup
* move since from inclrtl to std/private/since (#14188)hlaaftana2020-05-021-6/+2
| | | | * move since from inclrtl to std/private/since * move since import in system below for HCR
* fix sendTo and recvFrom in asyncnet (#14154)rockcavera2020-04-301-76/+40
| | | | | | | | | | | | | * added high level sendTo and recvFrom to std/asyncnet; tests were also added. * add .since annotation, a changelog entry and fixed to standard library style guide. * Improved asserts msgs and added notes for use with UDP sockets * pointers removed in parameters and fixes * added .since annotation * minor fixes
* added high level sendTo and recvFrom to std/asyncnet (UDP functionality) ↵rockcavera2020-04-261-0/+127
| | | | | | | | | (#14109) * added high level sendTo and recvFrom to std/asyncnet; tests were also added. * add .since annotation, a changelog entry and fixed to standard library style guide. * Improved asserts msgs and added notes for use with UDP sockets
* introduce getPeerCertificates, fixes #13299 (#13650)Christian Ulrich2020-03-221-0/+13
| | | | | | | | | | | | * make i2d_X509 and d2i_X509 always available i2d_X509 and d2i_X509 have been available in all versions of OpenSSL, so make them available even if nimDisableCertificateValidation is set. * introduce getPeerCertificates, fixes #13299 getPeerCertificates retrieves the verified certificate chain of the peer we are connected to through an SSL-wrapped Socket/AsyncSocket. This introduces the new type Certificate which stores a DER-encoded X509 certificate.
* [backport] Fix style issues in lib/, tools/, and testament/. Fixes #12687. ↵3n-k12019-11-281-11/+11
| | | | (#12754)
* [backport] run nimpretty on asyncnarimiran2019-09-301-7/+8
|
* Fixes subtle SSL recvInto bug.Dominik Picheta2019-07-271-0/+1
| | | | | This resulted in a "value out of range: -1" exception inside `recvInto` (on the `copyMem` line). Basically readIntoBuf was returning `-1`.
* make more parts of the stdlib compile with --styleCheck:errorAraq2019-07-101-5/+5
|
* newruntime for async (#11650)Andreas Rumpf2019-07-051-13/+13
| | | | | | | * fixes overloading resolution for passing owned(Future[string]) to Future[T] * WIP: make --newruntime work with .async * memtracker: make it compile again * make Nimble compile again
* fixes #1286; object case transitions are now soundAndreas Rumpf2019-05-271-14/+10
|
* Fix header inconsistencies in documentation (#11071)Zed2019-04-231-4/+4
|
* asyncnet.nim: Minor code cleanupAraq2019-02-191-4/+4
|
* Provide access to getsockname()/getpeername()Federico Ceratto2019-02-171-0/+12
| | | | Port of #3323 with added tests
* Merge pull request #9915 from zevv/asyncnet-unixDominik Picheta2018-12-121-0/+55
|\ | | | | Added basic AF_UNIX support to asyncnet.
| * Added basic AF_UNIX support to asyncnet.Ico Doornekamp2018-12-091-0/+55
| | | | | | | | | | | | | | | | Unfortunately this required some code duplication because the doConnect() from asynccommon.nim only works with addrInfo which does not make sense for AF_UNIX. makeUnixAddr() was moved to nativesocket.nim and exported
* | Fixes 9716 [backport] (#9790)Yuriy Glukhov2018-11-241-1/+1
| | | | | | | | | | | | * reuse temporary variable * fixes #9716 [backport] * Declare local vars in safer place
* | stdlib: documenation updates, the exception names have been changedAndreas Rumpf2018-10-251-1/+1
|/
* WIP: disallow 'nil' for strings and seqsAndreas Rumpf2018-08-131-2/+2
|
* make async tests green for LinuxAraq2018-08-081-2/+0
|
* remove deprecated stuff from the stdlib; introduce better deprecation warningsAraq2018-05-051-2/+0
|
* make asyncnet work againAndreas Rumpf2018-04-301-1/+1
|
* Fixes #4995. (#7157)Dominik Picheta2018-02-131-4/+8
|
* Revert 3db460f5045e790b54ea382 as requested by @Araq.Dominik Picheta2018-01-281-2/+0
|
* Merge branch 'devel' into async-improvementsDominik Picheta2018-01-171-0/+2
|\
| * Raise assertion error when attempting to use closed socket.Dominik Picheta2018-01-151-0/+2
| |
* | setBlocking(false) is called on AsyncFD in newAsyncSocket proc.Dominik Picheta2017-11-241-0/+9
|/
* Remove expr/stmt (#5857)Arne Döring2017-07-251-2/+2
|
* Adding test for recvlineEuan Torano2017-07-091-4/+2
| | | | Signed-off-by: Euan Torano <euantorano@gmail.com>