compression.c File Reference

XEP-0138 Stream Compression. More...

## Data Structures

struct | zlib_compression
struct | xmpp_compression

## Macros

#define | STROPHE_COMPRESSION_BUFFER_SIZE 4096
| Max buffer size for compressed data (send & receive).

## Functions

static int | _conn_decompress (struct xmpp_compression *comp, size_t c_len, void *buff, size_t len)
static int | compression_read (struct conn_interface *intf, void *buff, size_t len)
static int | _try_compressed_write_to_network (xmpp_conn_t *conn, int force)
static int | _compression_write (xmpp_conn_t *conn, const void *buff, size_t len, int flush)
static int | compression_write (struct conn_interface *intf, const void *buff, size_t len)
static int | compression_flush (struct conn_interface *intf)
static int | compression_pending (struct conn_interface *intf)
static int | compression_get_error (struct conn_interface *intf)
static int | compression_is_recoverable (struct conn_interface *intf, int err)
static void * | _zlib_alloc (void *opaque, unsigned int items, unsigned int size)
static void | _init_zlib_compression (xmpp_ctx_t *ctx, struct zlib_compression *s)
int | compression_init (xmpp_conn_t *conn)
void | compression_free (xmpp_conn_t *conn)
void | compression_handle_feature_children (xmpp_conn_t *conn, const char *text)

## Variables

static const struct conn_interface | compression_intf

## Detailed Description

XEP-0138 Stream Compression.

## Macro Definition Documentation

## STROPHE_COMPRESSION_BUFFER_SIZE

#define STROPHE_COMPRESSION_BUFFER_SIZE 4096

Max buffer size for compressed data (send & receive).

## Function Documentation

## _conn_decompress()

static int _conn_decompress | ( | struct xmpp_compression * | comp,
|  | size_t | c_len,
|  | void * | buff,
|  | size_t | len
| ) |  |

static

## compression_read()

static int compression_read | ( | struct conn_interface * | intf,
|  | void * | buff,
|  | size_t | len
| ) |  |

static

## _try_compressed_write_to_network()

static int _try_compressed_write_to_network | ( | xmpp_conn_t * | conn,
|  | int | force
| ) |  |

static

## _compression_write()

static int _compression_write | ( | xmpp_conn_t * | conn,
|  | const void * | buff,
|  | size_t | len,
|  | int | flush
| ) |  |

static

## compression_write()

static int compression_write | ( | struct conn_interface * | intf,
|  | const void * | buff,
|  | size_t | len
| ) |  |

static

## compression_flush()

static int compression_flush | ( | struct conn_interface * | intf | ) |

static

## compression_pending()

static int compression_pending | ( | struct conn_interface * | intf | ) |

static

## compression_get_error()

static int compression_get_error | ( | struct conn_interface * | intf | ) |

static

## compression_is_recoverable()

static int compression_is_recoverable | ( | struct conn_interface * | intf,
|  | int | err
| ) |  |

static

## _zlib_alloc()

static void * _zlib_alloc | ( | void * | opaque,
|  | unsigned int | items,
|  | unsigned int | size
| ) |  |

static

## _init_zlib_compression()

static void _init_zlib_compression | ( | xmpp_ctx_t * | ctx,
|  | struct zlib_compression * | s
| ) |  |

static

## compression_init()

int compression_init | ( | xmpp_conn_t * | conn | ) |

## compression_free()

void compression_free | ( | xmpp_conn_t * | conn | ) |

## compression_handle_feature_children()

void compression_handle_feature_children | ( | xmpp_conn_t * | conn,
|  | const char * | text
| ) |  |

## Variable Documentation

## compression_intf

const struct conn_interface compression_intf

static

Initial value:
= {
compression_read,
compression_write,
compression_flush,
compression_pending,
compression_get_error,
compression_is_recoverable,
NULL,
}
compression_read
static int compression_read(struct conn_interface *intf, void *buff, size_t len)
Definition compression.c:73
compression_flush
static int compression_flush(struct conn_interface *intf)
Definition compression.c:153
compression_write
static int compression_write(struct conn_interface *intf, const void *buff, size_t len)
Definition compression.c:148
compression_pending
static int compression_pending(struct conn_interface *intf)
Definition compression.c:162
compression_get_error
static int compression_get_error(struct conn_interface *intf)
Definition compression.c:170
compression_is_recoverable
static int compression_is_recoverable(struct conn_interface *intf, int err)
Definition compression.c:176