Skip to content

websocketimpl: avoid string copy unless logging trace message#1301

Merged
PhilipRoman merged 1 commit intoTooTallNate:masterfrom
xkommando:master
Mar 5, 2023
Merged

websocketimpl: avoid string copy unless logging trace message#1301
PhilipRoman merged 1 commit intoTooTallNate:masterfrom
xkommando:master

Conversation

@xkommando
Copy link
Copy Markdown
Contributor

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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
    [x] minor improvement

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@PhilipRoman PhilipRoman merged commit 5f4eca3 into TooTallNate:master Mar 5, 2023
@marci4 marci4 added this to the Release 1.5.4 milestone Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants