TooTallNate / Java-WebSocket

A barebones WebSocket client and server implementation written in 100% Java.
http://tootallnate.github.io/Java-WebSocket
MIT License
10.53k stars 2.58k forks source link

websocketimpl: avoid string copy unless logging trace message #1301

Closed xkommando closed 1 year ago

xkommando commented 1 year ago

Description

avoid string copy in web socket frame decoding

Related Issue

Motivation and Context

before decoding frames, the implementation logs the first 1000 char from the socket buffer. a string object is created even if log is disabled. changes: check the logging level before creating the logging parameters

How Has This Been Tested?

Types of changes

Checklist: