websockets-rs / websockets-rs/rust-websocket

Large Binary message isn't being sent correctly

Open
#231 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
1.6k
Forks
225
PR merge metrics
No merged PRs in 30d

Description

I'm using the sync client of websockets-rs to connect to a server written in actix-web over localhost. I've got a 181KB chunk of binary that I'm requesting from my server, then sending back. I'm getting the chunk just fine from the server, but when I try to send it back the server never registers a message. Looking at wireshark, there's some packets that have 0 length. I'm sending the data like this:
let bin_message = OwnedMessage::Binary(data); client.send_message(&bin_message)
where data is a Vec<u8>.
A binary chunk of 1264 bytes went back and forth just fine. Do I need to handle the byte streaming myself? Why does this work on the receiving end and not the sending? I've verified my server with a python websocket client, I know it's working on that end.
.pcap of the traffic is attached.
dumpfile.zip

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the sync client's send_message path shown in the report and inspect how it frames an OwnedMessage::Binary containing a Vec. Compare the 181KB and 1264-byte cases with the attached dumpfile.zip in Wireshark, then verify that the server receives the complete binary message rather than zero-length packets.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.