~emersion/public-inbox

tlstunnel: Remove file limit bump v1 APPLIED

Tom Lebreux: 1
 Remove file limit bump

 1 files changed, 0 insertions(+), 16 deletions(-)
#1216241 .build.yml success
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~emersion/public-inbox/patches/51726/mbox | git am -3
Learn more about email & git

[PATCH tlstunnel] Remove file limit bump Export this patch

Starting with Go 1.19[0] the file limit is increased by default.

[0]: https://github.com/golang/go/commit/8427429c592588af8c49522c76b3e0e0e335d270
---
As discussed on the mailing list, we might as well just get rid of this
since upstream Go increases the limit by default at startup.
 cmd/tlstunnel/main.go | 16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/cmd/tlstunnel/main.go b/cmd/tlstunnel/main.go
index 1adcac317619..be113e062237 100644
--- a/cmd/tlstunnel/main.go
+++ b/cmd/tlstunnel/main.go
@@ -51,27 +51,11 @@ func newServer() (*tlstunnel.Server, error) {
	return srv, nil
}

func bumpOpenedFileLimit() error {
	var rlimit syscall.Rlimit
	if err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, &rlimit); err != nil {
		return fmt.Errorf("failed to get RLIMIT_NOFILE: %v", err)
	}
	rlimit.Cur = rlimit.Max
	if err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rlimit); err != nil {
		return fmt.Errorf("failed to set RLIMIT_NOFILE: %v", err)
	}
	return nil
}

func main() {
	flag.StringVar(&configPath, "config", configPath, "path to configuration file")
	flag.BoolVar(&debug, "debug", false, "enable debug logging")
	flag.Parse()

	if err := bumpOpenedFileLimit(); err != nil {
		log.Printf("failed to bump max number of opened files: %v", err)
	}

	srv, err := newServer()
	if err != nil {
		log.Fatalf("failed to create server: %v", err)
-- 
2.44.0
tlstunnel/patches/.build.yml: SUCCESS in 38s

[Remove file limit bump][0] from [Tom Lebreux][1]

[0]: https://lists.sr.ht/~emersion/public-inbox/patches/51726
[1]: mailto:me@tomlebreux.com

✓ #1216241 SUCCESS tlstunnel/patches/.build.yml https://builds.sr.ht/~emersion/job/1216241
Pushed, thanks!