libssh2_channe...e_window_adjust(3)

πŸ“¦
version 1.11.1 Β· 3 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, debian trixie, epel 10, epel 9, fedora 43, fedora 44, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ libssh2_channel_receive_window_adjust ✨

okay bestie, welcome to the libssh2 manual, chapter adjust the channel window πŸ’… this one's a little vintage, so buckle up πŸŽ€


🌸 NAME 🌸

libssh2_channel_receive_window_adjust β€” adjust the channel window πŸ¦‹


✨ SYNOPSIS ✨

#include <libssh2.h>

unsigned long
libssh2_channel_receive_window_adjust(LIBSSH2_CHANNEL * channel,
                                      unsigned long adjustment,
                                      unsigned char force);

πŸ’– DESCRIPTION πŸ’–

girl. GIRL. This function is DEPRECATED in 1.1.0. Use the libssh2_channel_receive_window_adjust2(3) function instead! not me telling you this twice, but like, fr fr πŸ™ˆ

so what does it even do? it adjusts the receive window for a channel by adjustment bytes. that's it, that's the whole vibe πŸ’«

and here's the little detail that matters: if the amount to be adjusted is less than LIBSSH2_CHANNEL_MINADJUST and force is 0, then the adjustment amount gets queued for a later packet instead of going out right away. no cap. ⭐


🌈 RETURN VALUE 🌈

it returns the new size of the receive window, as understood by the remote end πŸ‘‘

lowkey important caveat: the window value sent over the wire is strictly 32bit, but this API is made to return a 'long', which may not be 32 bit on all platforms. so like, platform-dependent tea πŸ“


πŸ’€ ERRORS πŸ’€

in 1.0 and earlier, this function returns LIBSSH2_ERROR_EAGAIN for non-blocking channels where it would otherwise block.

and here's the messy part bestie β€” that is a negative number, and this function only returns an unsigned value. so it leads to a very strange value being returned πŸ˜­πŸ’€ iconic behavior honestly, but not in a good way.


🫢 SEE ALSO 🫢


anywayyy that's the page πŸ’œ this whole thing comes from the libssh2 manual, version 0.15, dated 15 Mar 200… (yeah the date got cut off in the footer, it's giving mysterious 🧚). mwah, go read the non-deprecated one, ily, bye πŸ‘‹πŸ’–