libssh2_channe..._extended_data2(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_handle_extended_data2 β€” bestie edition πŸ’–

okay so real quick: this is a page from the libssh2 manual, and we're talking about libssh2_channel_handle_extended_data2, the little function that decides what your channel does with extended data. it's giving ✨traffic control✨ for the weird extra packets. let's get into it 🫢


✨ NAME ✨

libssh2_channel_handle_extended_data2 β€” set extended data handling mode, bestie. that's literally the whole job. πŸ’…


🌸 SYNOPSIS 🌸

#include <libssh2.h>

int
libssh2_channel_handle_extended_data2(LIBSSH2_CHANNEL *channel,
                                      int ignore_mode);

look at her. two args, one int coming back. iconic behavior, no notes. πŸ‘‘


πŸ¦‹ DESCRIPTION πŸ¦‹

so the args, one at a time, because we do not skip details in this house:

  • channel β€” the active channel stream you wanna change the extended data handling on. that's the one you're messing with, girl.
  • ignore_mode β€” you gotta hand her exactly one of the three LIBSSH2_CHANNEL_EXTENDED_DATA_* constants. pick your fighter:
    • LIBSSH2_CHANNEL_EXTENDED_DATA_NORMAL: queue extended data for eventual reading. it just... waits patiently. very demure. πŸ’œ
    • LIBSSH2_CHANNEL_EXTENDED_DATA_MERGE: treat extended data and ordinary data the same. merge all substreams so that calls to libssh2_channel_read(3) will pull from all substreams on a first-in/first-out basis. one big slushie of data, fr fr. πŸ₯€
    • LIBSSH2_CHANNEL_EXTENDED_DATA_IGNORE: discard all extended data as it arrives. not me ghosting the packets 😭 they get yeeted on arrival, periodt.

and that's the whole point of the function: change how a channel deals with extended data packets. by default all extended data is queued until read by libssh2_channel_read_ex(3). so if you never call this, she's just sitting there holding it in. relatable tbh. πŸ™ˆ


πŸ’€ RETURN VALUE πŸ’€

  • returns 0 on success πŸ’–
  • returns LIBSSH2_ERROR_EAGAIN when it would otherwise block 😭

that's it. that's the tea. πŸ“


🌈 SEE ALSO 🌈

go read those too, iykyk. 🧚


okay that's the page!! this was libssh2 version 0.15, dated 1 Jun 200 (yes the date got cut off, blame the original, not me πŸ’…), and this whole manual page belongs to the libssh2_channe..._extended_data2(3) entry. love that for us. mwah, bye bestie!! πŸŽ€βœ¨πŸ¦‹