Releases: olliNiinivaara/GuildenStern
Releases · olliNiinivaara/GuildenStern
8.1.0
Release notes, 8.1.0 (2025-02-10)
- Servers are now pointers to objects instead of references, as a workaround to a race condition inside Nim's default memory manager
- servers now have a name field, for better logging in multi-server configurations
- websocketserver regression fix: canceling upgrade by returning false works again
8.0.1
Release notes, 8.0.1 (2025-01-22)
- epolldispatcher bug fix: always unregister sockets on close
- websocketserver bug fix: do not mess the statuscode of sendClose
- websocketserver improvement: remove a memory allocation bottleneck by casting instead of converting bytes in maskMessage proc
8.0.0
Release notes, 8.0.0 (2025-01-17)
breaking changes
- dispatcher's start proc now returns bool that has to be handled
- LogCallback takes also source as parameter (breaking only if you have been using a custom logger procedure)
- socketdata flags parameter is not directly accessible anymore, but there are new getFlags and setFlags procs (only affects those who created new server components)
- new global convenience template thesocket, so you don't need write socketcontext.socket, http.socket or ws.socket (breaking only if you were already using a variable named thesocket)
major changes
- new robust epolldispatcher available for platforms that support epoll (e.g. Linux)
- new websocketclient module available, that let's you test your websocket servers easily (for inspiration, check the new wsclienttest and wsmulticasttest files in the examples folder)
- SocketData is not anymore available in socketcontext. Instead, server, socket and customdata are directly available in the socketcontext.There is a convenience socketdata proc that makes the redirection, so existing code should not break
- OnCloseSocketCallback that offers socketdata as parameter is deprecated (but works). Switch to new OnCloseSocketCallback that offers server and socket directly as parameters
- new threadFinalizerCallback that is triggered for every worker thread just before they stop running
- various stability improvements
minor changes
- the --d:threadsafe compiler switch is not needed anymore
- all-around better logging
- log messages also include server id and thread id
- servers can work in client mode when port number 0 is used
- new dispatcher proc registerSocket for adding sockets to servers working in client mode
- dispatchers close themselves more gracefully, waiting up to 10 seconds for workerthreads to finish
- if dispatcher fails to start, returns false instead of shutting down everything
- various internal improvements for those who write new server components
- new error code EFault for detecting memory corruption (faulty pointer inputs to posix procs)
- new static func epollSupported in guildenserver for checking if epoll is supported
- suspend proc now needs also the server as parameter. The old suspend exists for backward compatibility, but it always only sleeps
- socket closing is always logged, with suitable log level depending on cause
- closeOtherSocket renamed to closeSocket (closeOthersocket is deprecated, and just redirects to closeSocket)
- HttpServers do not close the socket, if an empty request is received (because it might be a keep-alive packet)
- reply messages do not need to have and address anymore (constants accepted)
- WebsocketServer supports running in client mode (triggered, when new clientmaskkey parameter is set in *
7.3.0
Improved websocket close handshaking:
- New proc sendClose for sending a close frame to a client with a statuscode
- When a close frame from a client is received and before the socket is closed, an acknowledging close frame is now always automatically replied using the statuscode set by the client
- When websocket is closed by client, the statuscode is now available in onCloseSocketCallback via the msg parameter
- updated example
websockettest
demonstrating these improvements
7.2.1
- Compatibility with Nim version 2.2.0
- Support removed for 6.x series, please upgrade now
- Fixed "Compile error: type mismatch: got 'int64' for [...]"
7.2.0
- Compatibility with ARM architecture
- Bug fix: getUri etc. in the new compact http server mode
- Bug fix: failed read in the new compact http server mode
7.1.0
- All threads are initialized when their server is started (instead of when they are first used), making the system more fail-fast
- - is an accepted char in header field names
- WebSocketServer code clean-up: WebSocketContext removed; opcode not anymore visible to end users
- Minor fixes and improvements
7.0.0
Release notes, 7.0.0 (2024-06-01)
StreamingServer has been merged to HttpServer
- receiveInChunks iterator renamed to receiveStream
- maxrequestlength renamed to bufferlength
- newHttpServer does not anymore take hascontent parameter, but instead:
- newHttpServer takes contenttype parameter:
- Compact (the default mode): Equivalent to previous hasContent=true mode, where whole request body must fit into the buffer
- NoBody: Equivalent to previous hasContent=false mode, for optimized handling of requests like GET that do not have a body
- Streaming: Equivalent to previous StreamingServer, where you have to read the body yourself using the receiveStream iterator
- startDownload-continueDownload-finishDownload combo renamed to replyStartChunked-replyContinueChunked-replyFinishChunked
Header processing streamlined
- parseHeaders and parseAllHeaders obsoleted
- newHttpServer takes headerfields parameter, listing header fields that you need
- in request handlers http.headers StringTableRef is automatically populated with needed header key-value pairs
New MultipartServer
- handles multipart/form-data for you as neatly parsed
- operates in streaming manner, allowing huge uploads without blowing up RAM
Improvements to websockets
- If you do not accept a connection (reply false in upgradeCallback), a HTTP 400 reply is now automatically sent before the socket is closed
- PONG is now automatically replied to PINGs, sendPong proc is removed
- default reply values changed, now timeoutsecs = 10, sleepmillisecs = 10
- if all in-flight receivers are blocking, now suspends for (sleepmillisecs * in-flight receiver count) milliseconds
- fixed isMessage bug
6.1.0
- fixed nimble path
- fixed README example
- new receiveInChucks iterator in streamingserver for receiving big data, for example POST data that does not fit in main memory
- new startDownload-continueDownload-finishDownload combo in streamingserver for sending big and/or dynamic responses as Transfer-Encoding: chunked
- new and upgraded streamingserver examples as required
6.0.0
- major rewrite, breaking changes here and there, consult migration guide and code examples.
- dispatcher(s) can now be replaced just by changing import(s)
- every TCP port is now served by different server, allowing port-by-port configuration of resource usage
- non-blocking I/O with cooperative multithreading now used everywhere
- new suspend procedure for allowing other threads to run also when waiting for I/O in user code
- overall compatibility with Nim version 2.0
- single-threaded mode is no more
- TimerCtx is no more