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.
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 usingKlapProtocol::_send_request
. In line 140,expire_at
is set to the time in seconds when the session expires, but inKlapSession::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 :)