Re: fphttpserver: reduce the stack size of the thread spawned for threaded server
Michael Van Canneyt via fpc-pascal <[email protected]> Mon, 18 May 2026 21:59:15 +0200 (CEST)
| Newsgroups | gmane.comp.compilers.free-pascal.general |
|---|---|
| Message-ID | <[email protected]> |
On Mon, 18 May 2026, Luca Olivetti via fpc-pascal wrote: > fpc 3.2.2, for a threaded server this code > > constructor TFPHTTPConnectionThread.CreateConnection(AConnection: > TFPHTTPConnection > ); > begin > FConnection:=AConnection; > FreeOnTerminate:=True; > Inherited Create(False); > end; > > creates a thread with the default stack size. I want to reduce it. > > I'm already using a class derived from TEmbeddedHttpServer (in turn derived > from TFPCustomHttpServer) so I could simply override the > CreateConnectionThread of TFPCustomHttpServer, which is virtual. > > But the original CreateConnectionThread function is > > > function TFPCustomHttpServer.CreateConnectionThread(Conn: TFPHTTPConnection > ): TFPHTTPConnectionThread; > begin > Result:=TFPHTTPConnectionThread.CreateConnection(Conn, > FConnectionThreadList); > end; > > > and I don't have access to FConnectionThreadList > > > what other options do I have? At this moment, none. The best I can do is add a class variable to allow you to set its class-type value to a TFPHTTPConnectionThread class descendant, then that descendant would be used. Then you set this variable at the start. Another option is to create a ConnectionThreadStackSize variable that would be used to set the stack size. Michael. _______________________________________________ fpc-pascal maillist - [email protected] https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal