-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
net,tls,test: remove writeQueueSize and fix bufferSize #15006
Conversation
When use TLSSocket, bufferSize is always +1, this affects users who rely on this property to make judgments. This commit removed legacy code and corrected the calculation of bufferSize. Fixes: nodejs#15005
hmm... would this end up being a semver-major?? It's really not clear. |
I'm afraid this may not be a correct change. |
@indutny do you have a suggestion how to handle this properly? |
Ping @indutny |
Ping @nodejs/crypto @mcollina |
I cannot help but I trust @indutny. |
@indutny would you be so kind and give a hint how the correct approach would look like? |
@BridgeAR sorry for delay. Technically it might be possible to keep the number of pending bytes in that property. Perhaps it should be approached in a way of fixing it rather than removing it? |
As far as I see it the proper fix for the |
Hm... on a second thought this might be a right way to do it indeed. Still the check if |
@@ -767,7 +767,7 @@ Socket.prototype._writeGeneric = function(writev, data, encoding, cb) { | |||
|
|||
// If it was entirely flushed, we can write some more right now. | |||
// However, if more is left in the queue, then wait until that clears. | |||
if (req.async && this._handle.writeQueueSize !== 0) |
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.
This condition should be left as it is.
Ping @micooz |
Make writeQueueSize represent the actual size of the write queue within the TLS socket. Add tls test to confirm that bufferSize works as expected. Fixes: nodejs#15005 Refs: nodejs#15006
Make writeQueueSize represent the actual size of the write queue within the TLS socket. Add tls test to confirm that bufferSize works as expected. PR-URL: #15791 Fixes: #15005 Refs: #15006 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Fedor Indutny <[email protected]>
Make writeQueueSize represent the actual size of the write queue within the TLS socket. Add tls test to confirm that bufferSize works as expected. PR-URL: #15791 Fixes: #15005 Refs: #15006 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Fedor Indutny <[email protected]>
Make writeQueueSize represent the actual size of the write queue within the TLS socket. Add tls test to confirm that bufferSize works as expected. PR-URL: nodejs#15791 Fixes: nodejs#15005 Refs: nodejs#15006 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Fedor Indutny <[email protected]>
Make writeQueueSize represent the actual size of the write queue within the TLS socket. Add tls test to confirm that bufferSize works as expected. PR-URL: nodejs/node#15791 Fixes: nodejs/node#15005 Refs: nodejs/node#15006 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Fedor Indutny <[email protected]>
Make writeQueueSize represent the actual size of the write queue within the TLS socket. Add tls test to confirm that bufferSize works as expected. PR-URL: nodejs/node#15791 Fixes: nodejs/node#15005 Refs: nodejs/node#15006 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Fedor Indutny <[email protected]>
Make writeQueueSize represent the actual size of the write queue within the TLS socket. Add tls test to confirm that bufferSize works as expected. PR-URL: nodejs#15791 Fixes: nodejs#15005 Refs: nodejs#15006 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Fedor Indutny <[email protected]>
Make writeQueueSize represent the actual size of the write queue within the TLS socket. Add tls test to confirm that bufferSize works as expected. Backport-PR-URL: #16420 PR-URL: #15791 Fixes: #15005 Refs: #15006 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Fedor Indutny <[email protected]>
Make writeQueueSize represent the actual size of the write queue within the TLS socket. Add tls test to confirm that bufferSize works as expected. Backport-PR-URL: #16420 PR-URL: #15791 Fixes: #15005 Refs: #15006 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Fedor Indutny <[email protected]>
When use TLSSocket, bufferSize is always +1, this affects users who
rely on this property to make judgments. This commit removed legacy
code and corrected the calculation of bufferSize.
Fixes: #15005
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
net, tls, test