~egor

Recent activity

[RFC PATCH] Add upstream connections over Tor a month ago

From Egor to ~emersion/soju-dev

where "Tor" means SOCKS5 with a hardcoded address
---
This is good enough for my purposes, but I understand it's probably
better to implement the ability to specify any proxy address.

So, should I make a more generic SOCKS5 patch? And if so, what would be
a good URL format for it? I'm thinking of using a query parameter to
specify the proxy host, like so:
ircs://example.com/?socks5=127.0.0.1:9050

 doc/soju.1.scd |  4 ++++
 go.mod         |  1 +
 go.sum         |  2 ++
 service.go     |  4 ++--
[message trimmed]

[PATCH] Add unix domain socket listeners for HTTP and WS a month ago

From Egor to ~emersion/soju-dev

---
 cmd/soju/main.go | 20 ++++++++++++++++++++
 doc/soju.1.scd   |  4 ++++
 2 files changed, 24 insertions(+)

diff --git a/cmd/soju/main.go b/cmd/soju/main.go
index 04de78b..9f254e2 100644
--- a/cmd/soju/main.go
+++ b/cmd/soju/main.go
@@ -275,6 +275,16 @@ func main() {
					log.Fatalf("serving %q: %v", listen, err)
				}
			}()
		case "ws+unix":
[message trimmed]

Re: stdlib bug: not setting CLOEXEC correctly in net/tcp/+linux.ha 2 years ago

From Egor to ~sircmpwn/hare-dev

Whoops, looks like I shouldn't have threaded the new patch set to the 
previous one, sorry about that.

[PATCH hare v2 7/7] os::exec: clear FD_CLOEXEC when dup2ing fd to itself 2 years ago

From Egor to ~sircmpwn/hare-dev

If you try to dup2 a fd to itself, it's a no-op. Since we want the child
process to inherit the fd, we must ensure to clear CLOEXEC in this case.

posix_spawn_file_actions_adddup2 in musl and glibc works similarly.

Signed-off-by: Egor <egor@opensrc.club>
---
 os/exec/exec+freebsd.ha | 18 ++++++++++++++----
 os/exec/exec+linux.ha   | 18 ++++++++++++++----
 rt/+linux/types.ha      |  2 ++
 3 files changed, 30 insertions(+), 8 deletions(-)

diff --git a/os/exec/exec+freebsd.ha b/os/exec/exec+freebsd.ha
index 59333def..c3362add 100644
[message trimmed]

[PATCH hare v2 6/7] fix dup without CLOEXEC in linux dirfs_clone 2 years ago

From Egor to ~sircmpwn/hare-dev

Signed-off-by: Egor <egor@opensrc.club>
---
 os/+linux/dirfdfs.ha | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/os/+linux/dirfdfs.ha b/os/+linux/dirfdfs.ha
index bb0dfaa5..ce6b9476 100644
--- a/os/+linux/dirfdfs.ha
+++ b/os/+linux/dirfdfs.ha
@@ -98,7 +98,7 @@ export fn dirfs_clone(fs: *fs::fs, resolve: resolve_flags...) *fs::fs = {
	for (let i = 0z; i < len(resolve); i += 1) {
		new.resolve |= resolve[i];
	};
	new.dirfd = rt::dup(new.dirfd) as int;
[message trimmed]

[PATCH hare v2 5/7] fs: invert the meaning of NOCTTY/CLOEXEC in flags 2 years ago

From Egor to ~sircmpwn/hare-dev

the same reasoning as with sockets and pipes

Signed-off-by: Egor <egor@opensrc.club>
---
 fs/types.ha               |  6 ++++--
 os/+freebsd/dirfdfs.ha    | 24 +++++++++---------------
 os/+linux/dirfdfs.ha      | 18 ++++--------------
 os/fs.ha                  | 12 ++++--------
 temp/+freebsd.ha          |  2 +-
 temp/+linux.ha            |  4 ++--
 unix/tty/+freebsd/open.ha |  2 +-
 unix/tty/+linux/open.ha   |  2 +-
 8 files changed, 26 insertions(+), 44 deletions(-)
[message trimmed]

[PATCH hare v2 4/7] unix: invert the meaning of CLOEXEC in pipe_flag 2 years ago

From Egor to ~sircmpwn/hare-dev

for consistency with sockets

Signed-off-by: Egor <egor@opensrc.club>
---
 unix/+freebsd/pipe.ha | 7 ++++---
 unix/+linux/pipe.ha   | 7 ++++---
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/unix/+freebsd/pipe.ha b/unix/+freebsd/pipe.ha
index cc3d9e94..12b10511 100644
--- a/unix/+freebsd/pipe.ha
+++ b/unix/+freebsd/pipe.ha
@@ -6,9 +6,9 @@ use io;
use rt;
[message trimmed]

[PATCH hare v2 3/7] net: add sockflags to connect/accept/socketpair 2 years ago

From Egor to ~sircmpwn/hare-dev

Signed-off-by: Egor <egor@opensrc.club>
---
 net/tcp/+freebsd.ha    | 31 ++++++++++++++++++++++++++-----
 net/tcp/+linux.ha      | 31 ++++++++++++++++++++++++++-----
 net/tcp/options.ha     |  6 ++++--
 net/udp/+freebsd.ha    | 29 +++++++++++++++++++++++++----
 net/udp/+linux.ha      | 29 +++++++++++++++++++++++++----
 net/udp/options.ha     |  6 +++++-
 net/unix/+freebsd.ha   | 31 ++++++++++++++++++++++++++-----
 net/unix/+linux.ha     | 31 ++++++++++++++++++++++++++-----
 net/unix/options.ha    |  6 +++++-
 net/unix/socketpair.ha | 10 ++++++++--
 10 files changed, 176 insertions(+), 34 deletions(-)
[message trimmed]

[PATCH hare v2 2/7] net: invert the meaning of CLOEXEC in sockflags 2 years ago

From Egor to ~sircmpwn/hare-dev

Currently if you want a file descriptor without CLOEXEC, you have to
pass a dummy 0 argument. And if you pass NONBLOCK, you have to remember
to also pass CLOEXEC, since in most cases that's what you actually want.

This will also make it easier to add socketflags to connect/socket
functions, since they already take sockopts and so you can't just
len(flags) == 0 to detect that no SOCK flags have been specified.

Signed-off-by: Egor <egor@opensrc.club>
---
 net/+freebsd.ha | 11 ++++-------
 net/+linux.ha   | 11 ++++-------
 2 files changed, 8 insertions(+), 14 deletions(-)
[message trimmed]

[PATCH hare v2 1/7] net: set CLOEXEC on new sockets atomically 2 years ago

From Egor to ~sircmpwn/hare-dev

Signed-off-by: Egor <egor@opensrc.club>
---
 net/tcp/+freebsd.ha    | 8 ++------
 net/tcp/+linux.ha      | 8 ++------
 net/udp/+freebsd.ha    | 6 ++----
 net/udp/+linux.ha      | 6 ++----
 net/unix/+freebsd.ha   | 8 ++------
 net/unix/+linux.ha     | 8 ++------
 net/unix/socketpair.ha | 2 +-
 7 files changed, 13 insertions(+), 33 deletions(-)

diff --git a/net/tcp/+freebsd.ha b/net/tcp/+freebsd.ha
index 826d01e4..f6764ff5 100644
--- a/net/tcp/+freebsd.ha
[message trimmed]