mirror of
https://github.com/bolkedebruin/rdpgw.git
synced 2025-08-17 22:13:50 +02:00
Support setting send/receive buffers for the IP sockets
This commit is contained in:
parent
8876b04466
commit
505eafdc1e
6 changed files with 89 additions and 0 deletions
|
@ -8,6 +8,8 @@ import (
|
|||
"io"
|
||||
"log"
|
||||
"net"
|
||||
"os"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
type RedirectFlags struct {
|
||||
|
@ -136,3 +138,11 @@ func receive(data []byte, out net.Conn) {
|
|||
out.Write(pkt)
|
||||
}
|
||||
|
||||
// wrapSyscallError takes an error and a syscall name. If the error is
|
||||
// a syscall.Errno, it wraps it in a os.SyscallError using the syscall name.
|
||||
func wrapSyscallError(name string, err error) error {
|
||||
if _, ok := err.(syscall.Errno); ok {
|
||||
err = os.NewSyscallError(name, err)
|
||||
}
|
||||
return err
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue