dataroaring commented on code in PR #30868:
URL: https://github.com/apache/doris/pull/30868#discussion_r1479325827
##########
fe/fe-core/src/main/java/org/apache/doris/mysql/MysqlChannel.java:
##########
@@ -423,18 +426,17 @@ private void writeHeader(int length, boolean isSsl)
throws IOException {
sendBuffer.put((byte) sequenceId);
}
- private void writeBuffer(ByteBuffer buffer, boolean isSsl) throws
IOException {
+ private void writeBuffer(ByteBuffer buffer) throws IOException {
if (null == sendBuffer) {
return;
}
- long leftLength = sendBuffer.capacity() - sendBuffer.position();
// If too long for buffer, send buffered data.
- if (leftLength < buffer.remaining()) {
+ if (sendBuffer.remaining() < buffer.position()) {
Review Comment:
IMHO, here data is batched in sendBuffer, if we can not batch further, we
should flush it. I can not find why we care buffer.position here?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]