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

Read frame error when recv empty binary frame. #219

Open
azzbcc opened this issue Jan 19, 2025 · 0 comments
Open

Read frame error when recv empty binary frame. #219

azzbcc opened this issue Jan 19, 2025 · 0 comments

Comments

@azzbcc
Copy link
Contributor

azzbcc commented Jan 19, 2025

[ERR] kws.c:1426 Read frame error because need = -7

It seem that kws->datalen = 9 on line

libks/src/kws.c

Line 1315 in 6c94460

if ((kws->datalen = kws_string_read(kws, kws->buffer, 9 + 1, kws->block)) < 0) { // read 9 bytes into NULL terminated 10 byte buffer

And the empty binary frame only need 2 bytes.

Finally failed on line

libks/src/kws.c

Lines 1422 to 1429 in 6c94460

need = (kws->plen - (kws->datalen - need));
if (need < 0) {
/* invalid read - protocol err .. */
ks_log(KS_LOG_ERROR, "Read frame error because need = %ld\n", need);
*oc = WSOC_CLOSE;
return kws_close(kws, WS_NONE);
}

empty_binary_fram.pcap.gz

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