Commit Graph

85 Commits

Author SHA1 Message Date
Jeroen van Rijn
cc24d2de3e Merge pull request #3810 from Feoramund/freebsd-core-net
Port `core:net` to FreeBSD
2024-08-09 09:50:05 +02:00
Feoramund
4c0ab09c9a Handle EPIPE in Darwin core:net 2024-08-05 13:15:08 -04:00
Feoramund
6cc7f3b451 Add FreeBSD Accept_Error.Would_Block alias 2024-08-05 13:00:44 -04:00
Feoramund
3512d7c672 Move Darwin MSG_NOSIGNAL to core:os 2024-08-05 12:49:12 -04:00
Feoramund
eba0774bf3 Prevent SIGPIPE on Darwin when writing to a closed core:net socket
Mimics behavior found on Linux implementation.
2024-08-05 12:23:09 -04:00
Feoramund
fe754af13d Add new contribution notes to core:net 2024-08-05 03:05:49 -04:00
Feoramund
61e770d943 Clean up some FreeBSD core:net code 2024-08-05 03:05:43 -04:00
Feoramund
2b63684ccf Fix integer socket option values for FreeBSD 2024-08-05 02:14:41 -04:00
Feoramund
5ece6980eb Make EINVAL generic in FreeBSD Socket_Option_Error
The documentation for `setsockopt(2)` mentioned accept filters for
`EINVAL`, but I've found that it can arise for any manner of invalid
values for setting socket options.

We'll just have to leave this as a generic error.
2024-08-05 02:14:27 -04:00
Feoramund
8de48d81ea Use common name for ENOBUFS 2024-08-05 00:30:39 -04:00
Feoramund
32fb1fb61c Add missing ECONNRESET TCP_Send_Error
This was not specifically documented in `send(2)`.
2024-08-05 00:30:39 -04:00
Feoramund
05c50561ae Set NOSIGPIPE on all core:net FreeBSD sockets 2024-08-05 00:30:39 -04:00
Feoramund
46455dd0a6 Add more socket options for FreeBSD core:net 2024-08-05 00:30:24 -04:00
gingerBill
66b86bc7e0 Correct os errors for darwin 2024-08-04 12:23:18 +01:00
gingerBill
97c499dbb4 Begin mapping os.Error in the rest of the codebase 2024-08-04 11:58:04 +01:00
flysand7
4dcb75af6d Make all handles non-inheritable by default
The sockets are left as non-inheritable because they
never should be inherited.
2024-07-18 22:50:47 +11:00
Feoramund
8b915aae5e Update code for new -vet 2024-06-30 11:18:40 -04:00
h0mtanks
2b615b09f0 fixed whitespace 2024-06-30 13:47:11 +05:30
h0mtanks
d1603ebac4 added missing would_block enum member 2024-06-30 13:42:55 +05:30
gingerBill
e296d6fb90 Fix loads of indentation issues with mixing spaces and tabs 2024-06-29 19:50:51 +01:00
gingerBill
103eccf104 More style improvements 2024-06-29 19:23:58 +01:00
gingerBill
5413a8b744 Even more style fixes 2024-06-29 19:11:36 +01:00
gingerBill
c88a1bef91 Add another -vet-cast check 2024-06-29 12:40:04 +01:00
Feoramund
e61d893a74 Port core:net to FreeBSD 2024-06-26 10:05:24 -04:00
gingerBill
f9fd8f0c25 Merge pull request #3439 from andreas-jonsson/netbsd
NetBSD support
2024-05-15 10:33:52 +01:00
gingerBill
6dc0ee3877 Fix #3577 2024-05-13 12:54:01 +01:00
Andreas T Jonsson
9a008d10f3 Merge branch 'master' into netbsd 2024-04-25 22:04:40 +02:00
Rickard Andersson
68f663ea85 fix(net): fix return type for send_tcp
Was `.Connection_Closed` but this is only inferrable if our return type
is not a sub-union of another.
2024-04-19 15:39:04 +03:00
Rickard Andersson
efc84cd390 docs(net): add comment about EPIPE -> Connection_Closed 2024-04-19 15:37:20 +03:00
Rickard Andersson
7b95562827 feat(net): turn EPIPE into Connection_Closed 2024-04-19 15:29:28 +03:00
Rickard Andersson
c44f618b7d fix(net): add NOSIGNAL to send options
This is a better default than not having it, since it turns errors that
would be signals into error values instead. We could take these as
options but given that we currently don't I think this at the very least
improves on the status quo.
2024-04-19 15:17:21 +03:00
Andreas T Jonsson
dd95a8d11d More std lib fixes
Just selecting the same codepath as other BSD's for the most part.
2024-04-19 10:42:09 +02:00
blob1807
2d1260bec9 uniformity change
small change to check things uniform
2024-04-13 00:47:49 +10:00
blob1807
c753711d86 Added support for URL fragments
Added support for a URL's fragment/anchor to `split_url` & `join_url` in `core:net` plus 4 new tests to cover it.
2024-04-13 00:39:32 +10:00
Laytan Laats
3a0df80066 correct newly found vets 2024-04-03 00:52:58 +02:00
Tetralux
d74ddb2d91 fixup 2024-02-22 15:01:55 +00:00
Tetralux
ec0831da70 [net] Better error code for binding a privileged port without root access on Darwin
This condition results in os.EACCESS, which we were translating to Broadcast_Disabled.
This was the case because binding to the broadcast address on a UDP port, without setting the BROADCAST flag, also results in this error.

Given the fact that reserved ports also produce this error, we now check for this condition in net.bind() and translate it to a custom, clearer error:
Privileged_Port_Without_Root.
2024-02-22 14:55:27 +00:00
gingerBill
3e7e779abf Replace core:* to base:* where appropriate 2024-01-28 22:18:51 +00:00
flysand7
ff0e976ff3 [net]: Fix passing the wrong socket to on linux 2023-11-24 23:57:53 +11:00
Jeroen van Rijn
bb6d73953c Merge pull request #2972 from flysand7/net-socket-any
[net]: Add send_any, recv_any variants to proc groups for Any_Socket
2023-11-24 13:42:48 +01:00
flysand7
8063569cdd [net]: Add send_any, recv_any variants to proc groups for Any_Socket 2023-11-24 23:27:12 +11:00
Jeroen van Rijn
3b5d28f0ee Merge pull request #2948 from flysand7/fix-do
[core]: Remove `do` keyword from the core library
2023-11-11 13:16:12 +01:00
flysand7
270348b112 [core]: Remove do keyword from the core library 2023-11-11 20:36:38 +11:00
Jeroen van Rijn
761a079789 Fix net.split_url
Resolves issue #2924
2023-11-09 16:56:54 +01:00
Divan Burger
c20839c461 Fix use of unitialized socket in socket_linux.odin#_dial_tcp_from_endpoint 2023-11-06 23:19:12 +02:00
flysand7
4d65b1ab9c Implement new sys/unix package 2023-10-27 10:51:21 +11:00
simon
e7adfff9bf bugfix: darwin net flags 2023-10-06 16:41:13 +01:00
simon
98f9f7d42e darwin _enumerate_interfaces 2023-09-30 20:09:29 +01:00
gingerBill
14adcb9db8 Use or_break and or_continue where appropriate in the core library 2023-09-30 15:34:39 +01:00
Tetralux
e51915a529 [net] Assorted cleanup
- Remove some old comments

- Fix some doc comments

- Improve some doc comments

- Unify name of the errors related to UDP packet sizes
   (i.e: recv buffer too small, and message too big to send)
2023-08-26 11:47:03 +00:00