dom96/httpbeast

Inconsistent behavior on run()

waghanza opened this issue · 4 comments

Hi @dom96,

When specifying settings (port, bind address, ...), the domain is set to AF_UNSPEC. However, without settings, the domain is set to AF_INET

This make

proc run*(onRequest: OnRequest, settings: Settings) =

and
proc run*(onRequest: OnRequest) {.inline.} =

have different behavior (except if we specify domain for the first one)

Regards,


Related to the-benchmarker/web-frameworks#4554

dom96 commented

Will keep this to remind me to add an error when Settings is initialised incorrectly.

How can you override Settings @dom96 ?

exactly, but seems that you need to set by hand in https://github.com/mattaylor/whip/blob/a9fd1f04ba0167727dd0dbf9235791f708147992/whip.nim#L132 @mattaylor

@dom96 maybe a good idea to allow it to be overwritten by end-user (I mean with a compilation option or nim.cfg)