Skip to content
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

KLAP handshake every time a request is sent #197

Open
warp03 opened this issue Aug 18, 2024 · 0 comments
Open

KLAP handshake every time a request is sent #197

warp03 opened this issue Aug 18, 2024 · 0 comments

Comments

@warp03
Copy link

warp03 commented Aug 18, 2024

Hi

while using your library I noticed that it performs the entire KLAP handshake process every time a request is sent. This doesn't affect functionality, but impacts performance and creates a lot of unnecessary requests.

Looking into the code (plugp100/protocol/klap/klap_protocol.py), it seems like the issue is that it always thinks the KlapSession is expired, when sending a request using KlapProtocol::_send_request. In line 140, expire_at is set to the time in seconds when the session expires, but in KlapSession::is_handshake_session_expired (line 277), the comparison is done as if it is the time in milliseconds.

I'm not very familiar with the code, but removing both * 1000 in line 278 of klap_protocol.py seems to fix the issue.

Thanks and have a nice day :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant