unsigned long long kop; /* Known outgoing payload length (see above) */
};
-/* sc_app_ops describes the application layer's operations and notification
- * callbacks when I/O activity is reported and to use to perform shutr/shutw.
- * There are very few combinations in practice (strm/chk <-> none/mux/applet).
- */
-struct sc_app_ops {
- char name[8]; /* data layer name, zero-terminated */
-};
-
/*
* This structure describes the elements of a connection relevant to a stream
*/
struct wait_event wait_event; /* We're in a wait list */
struct sedesc *sedesc; /* points to the stream endpoint descriptor */
enum obj_type *app; /* points to the applicative point (stream or check) */
- const struct sc_app_ops *app_ops; /* general operations used at the app layer */
struct sockaddr_storage *src; /* source address (pool), when known, otherwise NULL */
struct sockaddr_storage *dst; /* destination address (pool), when known, otherwise NULL */
};
static int sc_conn_recv(struct stconn *sc);
static int sc_conn_send(struct stconn *sc);
-/* stream connector operations for connections */
-struct sc_app_ops sc_app_conn_ops = {
- .name = "STRM",
-};
-
-/* stream connector operations for embedded tasks */
-struct sc_app_ops sc_app_embedded_ops = {
- .name = "NONE", /* may never be used */
-};
-
-/* stream connector operations for applets */
-struct sc_app_ops sc_app_applet_ops = {
- .name = "STRM",
-};
-
-/* stream connector for health checks on connections */
-struct sc_app_ops sc_app_check_ops = {
- .name = "CHCK",
-};
-
-struct sc_app_ops sc_app_hstream_ops = {
- .name = "HTERM",
-};
-
/* Initializes an endpoint */
void sedesc_init(struct sedesc *sedesc)
{
/* Performs a shutdown on the endpoint. This function deals with connection and
* applet endpoints. It is responsible to set SE flags corresponding to the
* given shut modes and to call right shutdown functions of the endpoint. It is
- * called from the .abort and .shut app_ops callback functions at the SC level.
+ * called from the sc_abort and sc_shutdown functions at the SC level.
*/
void se_shutdown(struct sedesc *sedesc, enum se_shut_mode mode)
{
sc->ioto = TICK_ETERNITY;
sc->room_needed = 0;
sc->app = NULL;
- sc->app_ops = NULL;
sc->src = NULL;
sc->dst = NULL;
sc->bytes_in = sc->bytes_out = 0;
sc->flags |= flags;
sc_ep_set(sc, SE_FL_DETACHED);
sc->app = &strm->obj_type;
- sc->app_ops = &sc_app_embedded_ops;
return sc;
}
sc->flags |= flags;
sc_ep_set(sc, SE_FL_DETACHED);
sc->app = &check->obj_type;
- sc->app_ops = &sc_app_check_ops;
return sc;
}
sc->wait_event.events = 0;
}
- sc->app_ops = &sc_app_conn_ops;
xref_create(&sc->sedesc->xref, &sc_opposite(sc)->sedesc->xref);
}
else if (sc_check(sc)) {
sc->wait_event.tasklet->context = sc;
sc->wait_event.events = 0;
}
-
- sc->app_ops = &sc_app_check_ops;
}
sedesc->se = sd;
sc->sedesc->se = appctx;
sc_ep_set(sc, SE_FL_T_APPLET);
sc_ep_clr(sc, SE_FL_DETACHED);
- if (sc_strm(sc)) {
- sc->app_ops = &sc_app_applet_ops;
+ if (sc_strm(sc))
xref_create(&sc->sedesc->xref, &sc_opposite(sc)->sedesc->xref);
- }
return 0;
}
sc->wait_event.tasklet->process = sc_conn_io_cb;
sc->wait_event.tasklet->context = sc;
sc->wait_event.events = 0;
-
- sc->app_ops = &sc_app_conn_ops;
- }
- else if (sc_ep_test(sc, SE_FL_T_APPLET)) {
- sc->app_ops = &sc_app_applet_ops;
- }
- else {
- sc->app_ops = &sc_app_embedded_ops;
}
return 0;
}
sc->wait_event.tasklet->process = sc_hstream_io_cb;
sc->wait_event.tasklet->context = sc;
sc->wait_event.events = 0;
-
- sc->app_ops = &sc_app_hstream_ops;
return 0;
}
* connection related for now but this will evolved
*/
sc->flags &= SC_FL_ISBACK;
- if (sc_strm(sc))
- sc->app_ops = &sc_app_embedded_ops;
- else
- sc->app_ops = NULL;
sc_free_cond(scp);
}
return;
sc->app = NULL;
- sc->app_ops = NULL;
sockaddr_free(&sc->src);
sockaddr_free(&sc->dst);
}
chunk_appendf(buf,
- "%s co0=%p ctrl=%s xprt=%s mux=%s data=%s target=%s:%p\n", pfx,
+ "%s co0=%p ctrl=%s xprt=%s mux=%s target=%s:%p\n", pfx,
conn,
conn_get_ctrl_name(conn),
conn_get_xprt_name(conn),
conn_get_mux_name(conn),
- sc_get_data_name(scf),
obj_type_name(conn->target),
obj_base_ptr(conn->target));
}
chunk_appendf(buf,
- "%s co1=%p ctrl=%s xprt=%s mux=%s data=%s target=%s:%p\n", pfx,
+ "%s co1=%p ctrl=%s xprt=%s mux=%s target=%s:%p\n", pfx,
conn,
conn_get_ctrl_name(conn),
conn_get_xprt_name(conn),
conn_get_mux_name(conn),
- sc_get_data_name(scb),
obj_type_name(conn->target),
obj_base_ptr(conn->target));