Commit Graph

109 Commits

Author SHA1 Message Date
Arne Döring
000b8afd26 Remove expr/stmt (#5857) 2017-07-25 09:28:23 +02:00
Ruslan Mustakov
e0059287bb Add 'hostname' param to wrapConnectedSocket 2017-05-04 16:27:08 +07:00
Ruslan Mustakov
ecf278c467 Implement dial, support IPv6 in httpclient (#5763)
* 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
2017-05-02 09:25:50 +02:00
Andreas Rumpf
159643824b fixes #3847 (#5609) 2017-03-27 09:39:46 +02:00
Andreas Rumpf
76eb20d2d3 deprecated nativesockets.dealloc, use freeAddrInfo instead; fixed stdlib deprecations 2017-01-30 08:50:57 +01:00
Yuriy Glukhov
a80a0972b7 Fixed dynlink with OpenSSL >1.1.0. Added loadLibPattern. 2016-11-30 17:16:54 +02:00
David Krause
5058ae1ba5 fixed typo 2016-11-17 16:47:36 +01:00
Yuriy Glukhov
6690cd15f4 Mark socketError as gcsafe 2016-10-26 20:17:40 +03:00
Dominik Picheta
8a6343b5b6 Fixes #3847. 2016-09-25 13:02:10 +02:00
Dominik Picheta
1fb5dd2477 Fixes #4797. 2016-09-19 19:36:35 +02:00
Dominik Picheta
3ad368f8ca Improvements to httpclient. Refs #4423.
* Adds ability to query HttpCode and compare it with strings.
* Moves HttpMethod to HttpCore module.
* Implements synchronous HttpClient using {.multisync.}.
2016-09-18 18:16:51 +02:00
Andreas Rumpf
6699387c9b make net.nim compile for osx doc2 2016-09-08 15:06:27 +02:00
Dominik Picheta
006207742f Enable SO_NOSIGPIPE for sockets on OS X. 2016-08-16 21:10:55 +02:00
Dominik Picheta
f44486cc85 Fixes #4406. 2016-08-13 23:30:22 +02:00
Andreas Rumpf
60b187513e stdlib and compiler don't use .immediate anymore 2016-07-29 23:51:01 +02:00
Dominik Picheta
f73dd02787 Fix broken asyncnet module. 2016-06-03 14:21:37 +01:00
Dominik Picheta
5390c25b60 Modified #3472 to make its API more idiomatic. 2016-06-03 13:22:18 +01:00
Dominik Picheta
c1706463dc Merge branch 'tls-psk' of https://github.com/zielmicha/nim into zielmicha-tls-psk 2016-06-03 11:52:11 +01:00
Andreas Rumpf
1a88c01f92 documentation build cleaned up 2016-05-31 03:04:45 +02:00
Dominik Picheta
a484e3f8c2 Merge branch 'unix-sockets' of https://github.com/girvo/Nim into girvo-unix-sockets 2016-05-30 09:38:37 +01:00
Josh Girvin
b662d22ad1 Adding nimdoc comments as per PR comments
As per @dom96 code review comments in PR #3488
2016-05-30 16:29:38 +10:00
Andreas Rumpf
380524caa8 Merge pull request #3648 from FedericoCeratto/reuse_port
Add SO_REUSEPORT support
2016-05-29 22:21:56 +02:00
Dominik Picheta
b22305758d Fix deprecation warning in net module. 2016-04-04 21:52:49 +01:00
Dominik Picheta
3ad103b8cc Fixes small mistake in `net` module. 2016-04-04 21:20:29 +01:00
Dominik Picheta
03be03c6e4 Improved asyncnet docs (SSL procs now shown). Deprecated handshake. 2016-04-04 21:00:43 +01:00
Dominik Picheta
8e6f5f20f6 Improve net and ssl module docs. 2016-04-04 20:47:47 +01:00
Peter Cai
3035c2c63a net: disable SSLv3
SSLv3 is no longer secure and has been removed from OpenSSL since 1.0.2.
Disabling this will enable Nim programs to run against OpenSSL 1.0.2.
2016-04-03 15:15:48 +00:00
Josep Sanjuas
5a582a0d9c Define ports as uint16s to fix #3484 2016-03-27 22:56:44 +02:00
Andreas Rumpf
cc925d97f4 the stdlib supports &= in more contexts; refs #3524 2016-03-05 16:13:23 +01:00
Federico Ceratto
d9cb85c2d8 Spellcheck 2016-02-29 11:25:51 +00:00
Andreas Rumpf
73291aa1bc Merge pull request #3781 from rgv151/patch-net-gc-safe
[net/httpclient] make it gc-safe #2692
2016-02-06 15:26:07 +01:00
Andreas Rumpf
ec1abdef97 fixes #3789 2016-01-31 01:32:09 +01:00
Bruce Doan
4a3a9d8ab8 export parseIpAddress proc 2016-01-27 00:07:31 +07:00
Bruce Doan
443ec02a92 make it gc-safe #2692 2016-01-26 23:06:15 +07:00
Hans Raaf
0634486689 Fixed deprecation warnings while Nim compiles.
I just removed unsigned and changed a writeLn() call to writeLine() to
avoid the remaining deprecation warnings.
2016-01-18 18:14:50 +01:00
Federico Ceratto
e174aa1dbc Add SO_REUSEPORT support 2015-12-16 00:42:22 +00:00
Michał Zieliński
da308be2d7 net.nim: add support for Unix sockets 2015-10-28 20:01:48 +01:00
Michał Zieliński
3ecf33fa6a net.nim: destroyContext for destroying SSLContext 2015-10-24 22:48:33 +02:00
Michał Zieliński
ba61a8d00a net.nim: support for TLS-PSK ciphersuites 2015-10-24 22:17:31 +02:00
Michał Zieliński
3ebf27ddd2 net.nim: support storing arbitrary data inside SSLContext 2015-10-24 08:53:06 +02:00
Adam Strzelecki
be991ed413 Rename rawsockets module to nativesockets
This change was done to avoid confusion with TCP/IP raw sockets. Native sockets
module represents handling native system low level socket API in general and is
not just limited anyhow to TCP/IP raw sockets.

A stub lib/deprecated/pure/rawsockets.nim module has been added as
compatibility layer for old code using rawsockets, so this change will not
break existing code.
2015-10-03 19:45:41 +02:00
Aman Gupta
8edbef346a raise with error message 2015-09-23 17:15:13 -07:00
Aman Gupta
4a715b8e08 disable SSLv2 2015-09-23 12:03:14 -07:00
Aman Gupta
5f95c4e055 avoid referencing undefined SSLv2_method on mac osx 2015-09-22 19:54:15 -07:00
Dominik Picheta
4da5e47414 Implements getPeerAddr/getPeerName on Windows and adds IDX. 2015-09-15 10:37:16 +01:00
Reimer Behrends
b9df1323f7 Provide access to getsockname()/getpeername().
This patch implements procedures getLocalAddr() and getPeerAddr() that
return the results of getsockname() and getpeername(), respectively, as
pairs (string, Port) for both Socket and SockedHandle.
2015-09-14 01:42:46 +02:00
Sloane Simmons
b124b8b4bb Use raiseOSError with additionalInfo parameter from devel 2015-07-04 09:29:37 -05:00
Dominik Picheta
615defb1a9 Fixes socket problems on Windows and normalises some names.
Ref #2976. Ref #2003. See news.txt for details.
2015-06-29 20:11:21 +01:00
Dominik Picheta
68f583ddb7 Adjustments to #2610. 2015-06-22 21:40:38 +01:00
Dominik Picheta
8853dfb353 Merge branch 'starttls' of https://github.com/wiml/Nim into wiml-starttls
Conflicts:
	lib/pure/net.nim
2015-06-22 21:34:21 +01:00