3#include "main-header.h"
4#include "command-parser.h"
5#include "command-handler.h"
21 byte inactivity_ack_ctr;
45typedef int (*stream_consume_data)(
int streamfd,
byte *b,
int size);
49typedef int (*stream_consume_close)(
int streamfd,
int reason);
53 stream_consume_data data_consumer;
54 stream_consume_close close_consumer;
67void close_stream(
int fd,
int reason);
72void stream_seterror(
int streamfd,
const char *format, ...);
void streamdata(struct command *com)
called when we receive a stream data packet TODO: this is a really simplistic, memory-consumption opt...
void stream_loop()
called periodically, checks for stale streams and/or hung ones
int stream_associate(int fd, const struct consumerinfo *c, byte *buf, int bufsize, int packetsize)
associate a stream with a consumer. return 0 if ok otherwise errorcode
void streamsetup(struct command *com)
called when we receive a stream setup packet
struct stream * alloc_stream()
find a free stream struct, alloc an fd and return struct
void print_stream_info()
print summary of current streams to console
int count_open_streams()
count number of open streams
void stream_enable()
enable all stream handling (default)
void stream_disable()
disable all stream handling