summary refs log tree commit diff stats
path: root/lib/pure/asyncnet.nim
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Wait for reads to finish before reading the resultEuan T2017-07-031-2/+2
| | | As requested by @dom96, this fixes an issue seen here: https://github.com/nim-lang/redis/pull/4#issuecomment-312713921
* Add 'hostname' param to wrapConnectedSocketRuslan Mustakov2017-05-041-1/+8
|
* Implement dial, support IPv6 in httpclient (#5763)Ruslan Mustakov2017-05-021-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Implement dial, support IPv6 in httpclient Added ``dial`` procedure to networking modules: ``net``, ``asyncdispatch``, ``asyncnet``. It merges socket creation, address resolution, and connection into single step. When using ``dial``, you don't have to worry about IPv4 vs IPv6 problem. Fixed addrInfo loop in connect to behave properly. Previously it would stop on first non-immediate failure, instead of continuing and trying the remaining addresses. Fixed newAsyncNativeSocket to raise proper error if socket creation fails. Fixes: #3811 * Check domain during connect() only on non-Windows This is how it was in the previous implementation of connect(). * Call 'osLastError' before 'close' in net.dial * Record osLastError before freeAddrInfo in net.dial * Add missing docs for 'dial' proc * Optimize dial to create one FD per domain, add tests And make async IPv6 servers work on Windows. * Add IPv6 test to uri module * Fix getAddrString error handling
* fixes #3847 (#5609)Andreas Rumpf2017-03-271-12/+4
|
* Implement SSL SNI hostname setting for asyncnet.Dominik Picheta2017-02-081-0/+5
|
* deprecated nativesockets.dealloc, use freeAddrInfo instead; fixed stdlib ↵Andreas Rumpf2017-01-301-2/+2
| | | | deprecations
* Add async IO overview to asyncnet module docs.Dominik Picheta2017-01-061-1/+39
|
* Add OptReuseAddr to example and handle closingFederico Ceratto2017-01-021-0/+2
|
* Fixes #4587.Dominik Picheta2016-09-251-2/+19
|
* Fixes #3847.Dominik Picheta2016-09-251-6/+24
|
* Removed tests with `asyncio`.cheatfate2016-09-071-3/+8
| | | | | Fix ssl connection drop in asyncnet Add tasyncssl test
* Some small fixes to changes introduced by #4683.Dominik Picheta2016-09-061-0/+2
|
* Revert function names scheme due to the @dom96 commentAnatoly Galiulin2016-09-061-4/+4
|