diff options
author | Trumeet <yuuta@yuuta.moe> | 2022-07-28 15:38:34 -0700 |
---|---|---|
committer | Trumeet <yuuta@yuuta.moe> | 2022-07-28 15:38:34 -0700 |
commit | 0506ca8bdf8584858c0e462a24712c651a7e4e59 (patch) | |
tree | e8fd11d7fe7615536ec3f244bd5f90d39b396450 /client/libacron/README.md | |
parent | 35caf0da7fbf4ece60def1df1d88d34bf16185aa (diff) | |
download | acron-0506ca8bdf8584858c0e462a24712c651a7e4e59.tar acron-0506ca8bdf8584858c0e462a24712c651a7e4e59.tar.gz acron-0506ca8bdf8584858c0e462a24712c651a7e4e59.tar.bz2 acron-0506ca8bdf8584858c0e462a24712c651a7e4e59.zip |
fix(libacron): memory leak when received more than one frames
API:CHANGE
Diffstat (limited to 'client/libacron/README.md')
-rw-r--r-- | client/libacron/README.md | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/client/libacron/README.md b/client/libacron/README.md index 5fba5c6..14d37ad 100644 --- a/client/libacron/README.md +++ b/client/libacron/README.md @@ -214,6 +214,16 @@ while (!(r = ac_receive(connection, buffer, bytes, &obj))) { } ``` +> **Note**: +> +> In some cases, the buffer may contain more than one valid WebSocket frames. In such cases, +> `ac_receive` will backlog the additional parsed messages, and they will return the second time +> calling `ac_receive` with buffer = bytes = 0. +> +> This will happen only `ac_receive` returns zero with a non-NULL obj output. If that is true, +> the client must additionally call `ac_receive` infinite times with buffer = bytes = 0, until either +> `ac_receive` returns an error or obj output is NULL. + The program can make requests using `ac_request()`: ```c |