aboutsummaryrefslogtreecommitdiffstats
path: root/src/server/loaderiface.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2025-01-09 20:46:50 +0100
committerbptato <nincsnevem662@gmail.com>2025-01-09 20:48:20 +0100
commit8c769fc302a04737f1060fdcc0fab16a733d94c9 (patch)
tree174bd70c150b298a65ce7cecb48406caf4adf155 /src/server/loaderiface.nim
parent73f8c04970cbd0bc5a5923272ef21bf39d5c9293 (diff)
downloadchawan-8c769fc302a04737f1060fdcc0fab16a733d94c9.tar.gz
buffer: remove server socket
Now we just pass through a socket created in pager. This removes the need for a socket directory, and strengthens the buffer sandbox slightly. I've kept the ServerSocket code, because I want to add some form of RPC and communication between separate instances in the future. However, I don't expect this to be handled outside the main process, so I've removed the Capsicum-specific connectat/bindat code.
Diffstat (limited to 'src/server/loaderiface.nim')
-rw-r--r--src/server/loaderiface.nim21
1 files changed, 2 insertions, 19 deletions
diff --git a/src/server/loaderiface.nim b/src/server/loaderiface.nim
index f21fbd7f..87711d8a 100644
--- a/src/server/loaderiface.nim
+++ b/src/server/loaderiface.nim
@@ -29,10 +29,6 @@ type
unregistered*: seq[int]
registerFun*: proc(fd: int)
unregisterFun*: proc(fd: int)
- # directory where we store UNIX domain sockets
- sockDir*: string
- # (FreeBSD only) fd for the socket directory so we can connectat() on it
- sockDirFd*: cint
# A mechanism to queue up new fds being added to the poll data
# inside the events iterator.
registerBlocked: bool
@@ -465,23 +461,10 @@ proc removeClient*(loader: FileLoader; pid: int) =
w.swrite(lcRemoveClient)
w.swrite(pid)
-when defined(freebsd):
- let O_DIRECTORY {.importc, header: "<fcntl.h>", noinit.}: cint
-
-# On Capsicum-capable systems, this opens path as a directory.
-# On other systems, it returns -1.
-proc openSockDir*(path: string): cint =
- when defined(freebsd):
- return newPosixStream(path, O_DIRECTORY, 0).fd
- else:
- return -1
-
-proc newFileLoader*(loaderPid, clientPid: int; sockDir: string;
- sockDirFd: cint; controlStream: SocketStream): FileLoader =
+proc newFileLoader*(loaderPid, clientPid: int; controlStream: SocketStream):
+ FileLoader =
return FileLoader(
loaderPid: loaderPid,
- sockDir: sockDir,
- sockDirFd: sockDirFd,
clientPid: clientPid,
controlStream: controlStream
)