New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
An ability to disable HTTP/1.1 KeepAlive support added #78
An ability to disable HTTP/1.1 KeepAlive support added #78
Conversation
There was a few problems with the loop to wait for thread in a pool to become ready and the most important - exit from Exeute method after the first successfull call to fThreadPoolPush inside the loop
This is the imlementation of changes discussed previously in https://synopse.info/forum/viewtopic.php?id=4334
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand the logic change behind it... only difference seems that terminated will increase fThreadPoolContentionAbortCount counter...
SynCrtSock.pas
Outdated
// HTTP/1.0 compatibility | ||
// Only threads from thread pool will be used to process requests | ||
// when this flag set to true | ||
property DisableKeepAliveSupport: boolean read fDisableKeepAliveSupport; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add "write" attribute too?
this may be enough, and no need to add a boolean parameter to the constructor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's don't forget that this is a thread so execution starts immediately. It could be too late to set this flag after execution started and first requests came
On the other side, IMHO it is non-practical to switch such behavior on the fly.
SynCrtSock.pas
Outdated
@@ -1843,6 +1845,11 @@ THttpServer = class(THttpServerGeneric) | |||
// a THttpServerResp thread is created for handling this THttpServerSocket | |||
property Sock: TCrtSocket read fSock; | |||
published | |||
/// flag to disable HTTP/1.1 keep alive features and fall back to | |||
// HTTP/1.0 compatibility | |||
// Only threads from thread pool will be used to process requests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing traiiling "-" character in comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change committed. Did I understand you correctly?
The primary point of change in the loop is to change this part: |
now I understood the problem of the threadpool contention loop ! |
I've made some changes to how the contention is handled - especially changed ThreadPoolContentionCount into ThreadPoolContentionTime and enhanced the doc |
the commit broke the TWebSocketServer.Create signature, by the way
|
the commit also broke THttpServerSocket.GetRequest with no associated server |
No description provided.