Skip to content

Commit

Permalink
Optimize sending memory management when the audit-proxy config is null
Browse files Browse the repository at this point in the history
  • Loading branch information
doleyzi committed Mar 6, 2024
1 parent 36d7e92 commit 0122b44
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ public SenderGroup(SenderManager senderManager) {
* @return
*/
public SenderResult send(ByteBuf dataBuf) {
if (dataBuf == null) {
return new SenderResult("dataBuf is null", 0, false);
}
LinkedBlockingQueue<SenderChannel> channels = channelGroups.get(mIndex);
SenderChannel channel = null;
boolean dataBufReleased = false;
Expand Down Expand Up @@ -163,7 +166,7 @@ public SenderResult send(ByteBuf dataBuf) {
channel.release();
channels.offer(channel);
}
if (!dataBufReleased && dataBuf != null) {
if (!dataBufReleased) {
dataBuf.release();
}
}
Expand Down

0 comments on commit 0122b44

Please sign in to comment.