From 20ae6300864df2d0848d62142b433783e683c2be Mon Sep 17 00:00:00 2001 From: Timothee Cour Date: Sun, 27 Jun 2021 14:59:59 -0700 Subject: [PATCH 1/5] allow forwarding `reusePort`; use asynctools instead of fork now that PR was merged --- jester.nim | 4 ++-- jester.nimble | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/jester.nim b/jester.nim index 92cb8c7..1a49604 100644 --- a/jester.nim +++ b/jester.nim @@ -499,10 +499,10 @@ proc serve*( proc (req: httpbeast.Request): Future[void] = {.gcsafe.}: result = handleRequest(jes, req), - httpbeast.initSettings(self.settings.port, self.settings.bindAddr) + httpbeast.initSettings(self.settings.port, self.settings.bindAddr, reusePort = self.settings.reusePort) ) else: - self.httpServer = newAsyncHttpServer(reusePort=self.settings.reusePort) + self.httpServer = newAsyncHttpServer(reusePort = self.settings.reusePort) let serveFut = self.httpServer.serve( self.settings.port, proc (req: asynchttpserver.Request): Future[void] {.gcsafe, closure.} = diff --git a/jester.nimble b/jester.nimble index eeb64c1..8bf4f58 100644 --- a/jester.nimble +++ b/jester.nimble @@ -17,4 +17,4 @@ when not defined(windows): task test, "Runs the test suite.": exec "nimble install -y asynctools@#0e6bdc3ed5bae8c7cc9" - exec "nim c -r tests/tester" \ No newline at end of file + exec "nim c -r tests/tester" From b1af867255557c111715f9b394d13d0702064dab Mon Sep 17 00:00:00 2001 From: Timothee Cour Date: Sun, 27 Jun 2021 15:01:00 -0700 Subject: [PATCH 2/5] bump version --- jester.nim | 2 +- jester.nimble | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/jester.nim b/jester.nim index 1a49604..9bb477d 100644 --- a/jester.nim +++ b/jester.nim @@ -74,7 +74,7 @@ type of RouteCode: data: ResponseData -const jesterVer = "0.5.0" +const jesterVer = "0.6.0" proc toStr(headers: Option[RawHeaders]): string = return $newHttpHeaders(headers.get(@({:}))) diff --git a/jester.nimble b/jester.nimble index 8bf4f58..d17be37 100644 --- a/jester.nimble +++ b/jester.nimble @@ -1,6 +1,6 @@ # Package -version = "0.5.0" # Be sure to update jester.jesterVer too! +version = "0.6.0" # Be sure to update jester.jesterVer too! author = "Dominik Picheta" description = "A sinatra-like web framework for Nim." license = "MIT" From 3dd3e3337da3138220e61ce25c88a69e3bfb9322 Mon Sep 17 00:00:00 2001 From: Timothee Cour Date: Sat, 3 Jul 2021 12:00:57 -0700 Subject: [PATCH 3/5] change version --- jester.nim | 2 +- jester.nimble | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/jester.nim b/jester.nim index 9bb477d..0705b1f 100644 --- a/jester.nim +++ b/jester.nim @@ -74,7 +74,7 @@ type of RouteCode: data: ResponseData -const jesterVer = "0.6.0" +const jesterVer = "0.5.1" proc toStr(headers: Option[RawHeaders]): string = return $newHttpHeaders(headers.get(@({:}))) diff --git a/jester.nimble b/jester.nimble index d17be37..a5881fa 100644 --- a/jester.nimble +++ b/jester.nimble @@ -1,6 +1,6 @@ # Package -version = "0.6.0" # Be sure to update jester.jesterVer too! +version = "0.5.1" # Be sure to update jester.jesterVer too! author = "Dominik Picheta" description = "A sinatra-like web framework for Nim." license = "MIT" From 016f339da9c2be0705e4c16cc1516aa9c38e129c Mon Sep 17 00:00:00 2001 From: Timothee Cour Date: Wed, 14 Jul 2021 17:28:21 -0700 Subject: [PATCH 4/5] forward reusePort=false to failOnExistingPort=true --- jester.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jester.nim b/jester.nim index 0705b1f..b422235 100644 --- a/jester.nim +++ b/jester.nim @@ -499,7 +499,7 @@ proc serve*( proc (req: httpbeast.Request): Future[void] = {.gcsafe.}: result = handleRequest(jes, req), - httpbeast.initSettings(self.settings.port, self.settings.bindAddr, reusePort = self.settings.reusePort) + httpbeast.initSettings(self.settings.port, self.settings.bindAddr, reusePort = true, failOnExistingPort = not self.settings.reusePort) ) else: self.httpServer = newAsyncHttpServer(reusePort = self.settings.reusePort) From 266b97b185e28c7fb8f249582e9495253c384940 Mon Sep 17 00:00:00 2001 From: Timothee Cour Date: Wed, 14 Jul 2021 18:22:22 -0700 Subject: [PATCH 5/5] update to work with https://github.com/dom96/httpbeast/pull/53 --- jester.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jester.nim b/jester.nim index b422235..d2c9d8d 100644 --- a/jester.nim +++ b/jester.nim @@ -499,7 +499,7 @@ proc serve*( proc (req: httpbeast.Request): Future[void] = {.gcsafe.}: result = handleRequest(jes, req), - httpbeast.initSettings(self.settings.port, self.settings.bindAddr, reusePort = true, failOnExistingPort = not self.settings.reusePort) + httpbeast.initSettings(self.settings.port, self.settings.bindAddr, failOnExistingPort = not self.settings.reusePort) ) else: self.httpServer = newAsyncHttpServer(reusePort = self.settings.reusePort)