aboutsummaryrefslogtreecommitdiff
path: root/lib/std/net.zig
AgeCommit message (Collapse)Author
2021-08-09Ip4Address parser: reject 0-prefixed components (#9538)Frank Denis
Some parsers interpret these as octal, some don't, and the confusion can lead to vulnerabilities. Return error.NonCanonical when parsing IPv4 addresses with 0 prefixes.
2021-08-06Update all usages of mem.split/mem.tokenize for generic versionRyan Liptak
2021-06-21fix code broken from previous commitJacob G-W
2021-05-17std: update regarding std.builtin reorganizationAndrew Kelley
There are also some regressed std.fmt tests here and I haven't figured out what's wrong yet.
2021-04-15std: change `@import("builtin")` to `std.builtin`Andrew Kelley
2021-02-21replace ArrayList.shrinkAndFree by ArrayList.shrinkRetainingCapacityBenjamin Graf
2021-02-16std.fs.net.Stream: add writev and writevAllAndrew Kelley
I noticed that the write function does not properly use non-blocking I/O. This file needs to be reworked for evented I/O to properly take advantage of non-blocking writes to network sockets.
2021-01-22std: Update `test ""` to `test` where it makes senseLemonBoy
2021-01-11Apparently unix sockets are supported on WindowsLemonBoy
Starting from Windows 10 build 17063.
2021-01-11std: Decouple network streams from fs.FileLemonBoy
The overlap between files and sockets is minimal and lumping them together means supporting only a small subset of the functionalities provided by the OS. Moreover the socket and file handles are not always interchangeable: on Windows one should use Winsock's close() call rather than the one used for common files.
2021-01-07Reduce use of deprecated IO typesJay Petacat
Related: #4917
2021-01-06std: Rename ArrayList shrink => shrinkAndFreeAlex Cameron
2021-01-02std: Use {s} instead of {} when printing stringsLemonBoy
2020-12-31Year++Frank Denis
2020-12-23move ArrayListSentineled to std lib orphanageVeikka Tuominen
2020-12-01Localhost is special (#6955)daurnimator
* std: always return loopback address when looking up localhost * std: also return Ipv6 loopback * std: remove commented out obsolete code
2020-11-30std/os: remove unneeded error from accept errorsetIsaac Freund
POSIX compliant fnctl cannot return EPERM when getting/setting the given flags. See the specification here: https://pubs.opengroup.org/onlinepubs/9699919799/functions/fcntl.html
2020-11-29std.meta: add assumeSentinelJonathan Marler
2020-11-25std: use mem.asBytes in Ip4Address.parse so it works at comptimedaurnimator
2020-11-07remove deprecated uses of ArrayList.spanJosh Holland
2020-10-28More fixups for Windows targetsLemonBoy
* Use closeSocket on sockets instead of plain old close, the latter doesn't work on them. * Use winsocket2 everywhere, mingw has no BSD sockets.
2020-10-27std: Add basic smoke test for net functionalityLemonBoy
2020-10-25fix type mismatch in std.net.StreamServerjohnLate
Parameter in std.os.listen is u31. Fixes ziglang#6775
2020-10-21Fix std.net.connectUnixSocket in evented I/O modeheidezomp
The event loop constant was missing.
2020-09-24recvfromLoris Cro
Signed-off-by: Loris Cro <kappaloris@gmail.com>
2020-09-24sendtoLoris Cro
Signed-off-by: Loris Cro <kappaloris@gmail.com>
2020-09-24connectLoris Cro
Signed-off-by: Loris Cro <kappaloris@gmail.com>
2020-09-24acceptLoris Cro
Signed-off-by: Loris Cro <kappaloris@gmail.com>
2020-09-03os: return error.SocketNotListening for EINVAL on accept (#6226)Kenta Iwasaki
2020-09-01std: Fix C-string with missing NUL terminatorLemonBoy
Spotted thanks to the stricter conversion rules.
2020-08-20add license header to all std lib filesAndrew Kelley
add SPDX license identifier copyright ownership is zig contributors
2020-08-04zig fmtAndrew Kelley
2020-07-27Provide Ip4Address and Ip6Address in addition to AddressJonathan Marler
2020-07-11run zig fmt on std lib and self hostedVexu
2020-07-04std.mem.dupe is deprecated, move all references in stdjoachimschmidt557
Replaced all occurences of std.mem.dupe in stdlib with Allocator.dupe/std.mem.dupeZ -> Allocator.dupeZ
2020-06-08std.sort: give comparator functions a context parameterAndrew Kelley
2020-06-07tcpConnectToHost try all addresses in AddressListIan Simonson
The AddressList returned can contain more than one item e.g. the ipv4 and ipv6 addresses for a given hostname. Previously if a server had multiple addresses but was not listening on one of them Zig would give up immediately. Now on std.os.ConnectError.ConnectionRefused Zig will try the next address in the list. Zig still gives up on all other errors as they are related to the system and system resources rather than whether the remote server is listening on a particular address.
2020-06-02cleanupsAndrew Kelley
* improve docs * add TODO comments for things that don't have open issues * remove redundant namespacing of struct fields * guard against ioctl returning EINTR * remove the general std.os.ioctl function in favor of the specific ioctl_SIOCGIFINDEX function. This allows us to have a more precise error set, and more type-safe API.
2020-06-02Replace os.linux to os.systemLuna
2020-06-02Use resolveIp when looking up addresses on linuxLuna
2020-06-02Add std.os.ioctlLuna
2020-06-02Use IFNAMESIZE for scope id valueLuna
2020-06-02Add validation for scope idsLuna
2020-06-02Remove warn() callsLuna
2020-06-02Fix ifreq definitionLuna
2020-06-02Change Unsupported to InterfaceNotFoundLuna
2020-06-02Make interface name null-terminated before syscallLuna
2020-06-02Stop using mem.len on arrayLuna
2020-06-02Add ioctl errorsLuna
2020-06-02Only resolve scope id when neededLuna