Commit acc4719f authored by Pekka Pessi's avatar Pekka Pessi
Browse files

Added nta_agent_init_sigcomp() and nta_agent_deinit_sigcomp().

darcs-hash:20060418235054-65a35-d0304f7b6603abe642b24c1af591964db14f0210.gz
parent 3c74ce8e
......@@ -9740,6 +9740,28 @@ nta_incoming_transport(nta_agent_t *agent,
return tport_incref(nta_transport_(agent, irq, msg));
}
nta_compressor_t *nta_agent_init_sigcomp(nta_agent_t *sa)
{
if (!nta_compressor_vtable || !sa)
return NULL;
if (sa->sa_compressor == NULL) {
char const * const *l = sa->sa_sigcomp_option_list;
nta_compressor_t *comp;
comp = nta_compressor_vtable->ncv_init_agent(sa, l);
sa->sa_compressor = comp;
}
return sa->sa_compressor;
}
void nta_agent_deinit_sigcomp(nta_agent_t *sa)
{
if (nta_compressor_vtable && sa && sa->sa_compressor) {
nta_compressor_vtable->ncv_deinit_agent(sa, sa->sa_compressor);
sa->sa_compressor = NULL;
}
}
struct sigcomp_compartment *
nta_incoming_compartment(nta_incoming_t *irq)
......@@ -9786,9 +9808,11 @@ agent_compression_compartment(nta_agent_t *sa,
tp_name_t const *tpn,
int new_if_needed)
{
if (nta_compressor_vtable)
if (nta_compressor_vtable) {
char const * const *l = sa->sa_sigcomp_option_list;
return nta_compressor_vtable->
ncv_compartment(sa, tp, sa->sa_compressor, tpn, new_if_needed);
ncv_compartment(sa, tp, sa->sa_compressor, tpn, l, new_if_needed);
}
else
return NULL;
}
......@@ -9798,10 +9822,11 @@ int agent_accept_compressed(nta_agent_t *sa, msg_t *msg,
struct sigcomp_compartment *cc)
{
if (nta_compressor_vtable) {
nta_compressor_t *msc = sa->sa_compressor;
tport_compressor_t *sc = NULL;
if (tport_delivered_with_comp(sa->sa_tports, msg, &sc) < 0)
return 0;
return nta_compressor_vtable->ncv_accept_compressed(sa, sc, msg, cc);
return nta_compressor_vtable->ncv_accept_compressed(sa, msc, sc, msg, cc);
}
else
return 0;
......
......@@ -537,29 +537,41 @@ typedef struct
int ncv_size;
char const *ncv_name;
struct sigcomp_compartment *(*ncv_compartment)(nta_agent_t *sa,
tport_t *tport,
nta_compressor_t *msc,
tp_name_t const *tpn,
int new_if_needed);
nta_compressor_t *(*ncv_init_agent)(nta_agent_t *sa,
char const * const *options);
struct sigcomp_compartment *(*ncv_compartment_ref)(struct sigcomp_compartment *);
void (*ncv_deinit_agent)(nta_agent_t *sa, nta_compressor_t *);
struct sigcomp_compartment *(*ncv_compartment)(nta_agent_t *sa,
tport_t *tport,
nta_compressor_t *msc,
tp_name_t const *tpn,
char const * const *options,
int new_if_needed);
void (*ncv_compartment_unref)(struct sigcomp_compartment *);
int (*ncv_accept_compressed)(nta_agent_t *sa,
nta_compressor_t *msc,
tport_compressor_t *sc,
msg_t *msg, struct sigcomp_compartment *cc);
msg_t *msg,
struct sigcomp_compartment *cc);
int (*ncv_close_compressor)(nta_agent_t *sa,
struct sigcomp_compartment *cc);
int (*ncv_zap_compressor)(nta_agent_t *sa,
struct sigcomp_compartment *cc);
struct sigcomp_compartment *(*ncv_compartment_ref)
(struct sigcomp_compartment *);
void (*ncv_compartment_unref)(struct sigcomp_compartment *);
} nta_compressor_vtable_t;
extern nta_compressor_vtable_t *nta_compressor_vtable;
SOFIAPUBFUN nta_compressor_t *nta_agent_init_sigcomp(nta_agent_t *sa);
SOFIAPUBFUN void nta_agent_deinit_sigcomp(nta_agent_t *sa);
/* ====================================================================== */
/* Debug log settings */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment