#include <proto/sample.h>
#include <proto/server.h>
#include <proto/stream.h>
-#include <proto/raw_sock.h>
#include <proto/stream_interface.h>
#include <proto/task.h>
}
else if (obj_type(s->target) == OBJ_TYPE_PROXY) {
/* proxies exclusively run on raw_sock right now */
- conn_prepare(srv_conn, protocol_by_family(srv_conn->addr.to.ss_family), &raw_sock);
+ conn_prepare(srv_conn, protocol_by_family(srv_conn->addr.to.ss_family), xprt_get(XPRT_RAW));
if (!objt_conn(s->si[1].end) || !objt_conn(s->si[1].end)->ctrl)
return SF_ERR_INTERNAL;
}
#include <proto/session.h>
#include <proto/server.h>
#include <proto/stream.h>
-#include <proto/raw_sock.h>
#include <proto/stick_table.h>
#include <proto/task.h>
#include <proto/tcp_rules.h>
newpeer->addr = *sk;
newpeer->proto = proto;
- newpeer->xprt = &raw_sock;
+ newpeer->xprt = xprt_get(XPRT_RAW);
newpeer->sock_init_arg = NULL;
if (strcmp(newpeer->id, localpeer) == 0) {
curpeers->peers_fe->conf.args.line = curpeers->peers_fe->conf.line = linenum;
peers_setup_frontend(curpeers->peers_fe);
- bind_conf = bind_conf_alloc(curpeers->peers_fe, file, linenum, args[2], &raw_sock);
+ bind_conf = bind_conf_alloc(curpeers->peers_fe, file, linenum, args[2], xprt_get(XPRT_RAW));
if (!str2listener(args[2], curpeers->peers_fe, bind_conf, file, linenum, &errmsg)) {
if (errmsg && *errmsg) {
newmailer->addr = *sk;
newmailer->proto = proto;
- newmailer->xprt = &raw_sock;
+ newmailer->xprt = xprt_get(XPRT_RAW);
newmailer->sock_init_arg = NULL;
}
else if (strcmp(args[0], "timeout") == 0) {
goto out;
}
- bind_conf = bind_conf_alloc(curproxy, file, linenum, args[1], &raw_sock);
+ bind_conf = bind_conf_alloc(curproxy, file, linenum, args[1], xprt_get(XPRT_RAW));
/* use default settings for unix sockets */
bind_conf->ux.uid = global.unix_bind.ux.uid;
#include <types/dns.h>
#include <types/stats.h>
-#ifdef USE_OPENSSL
-#include <types/ssl_sock.h>
-#include <proto/ssl_sock.h>
-#endif /* USE_OPENSSL */
-
#include <proto/backend.h>
#include <proto/checks.h>
#include <proto/stats.h>
#include <proto/proto_tcp.h>
#include <proto/protocol.h>
#include <proto/proxy.h>
-#include <proto/raw_sock.h>
#include <proto/server.h>
#include <proto/signal.h>
#include <proto/stream_interface.h>
else if (check->port)
set_host_port(&conn->addr.to, check->port);
-#ifdef USE_OPENSSL
if (check->current_step->conn_opts & TCPCHK_OPT_SSL) {
- xprt = &ssl_sock;
+ xprt = xprt_get(XPRT_SSL);
}
else {
- xprt = &raw_sock;
+ xprt = xprt_get(XPRT_RAW);
}
-#else /* USE_OPENSSL */
- xprt = &raw_sock;
-#endif /* USE_OPENSSL */
conn_prepare(conn, proto, xprt);
ret = SF_ERR_INTERNAL;
#include <proto/session.h>
#include <proto/stream.h>
#include <proto/server.h>
-#include <proto/raw_sock.h>
#include <proto/stream_interface.h>
#include <proto/task.h>
}
}
- bind_conf = bind_conf_alloc(global.stats_fe, file, line, args[2], &raw_sock);
+ bind_conf = bind_conf_alloc(global.stats_fe, file, line, args[2], xprt_get(XPRT_RAW));
bind_conf->level = ACCESS_LVL_OPER; /* default access level */
if (!str2listener(args[2], global.stats_fe, bind_conf, file, line, err)) {
#include <proto/pattern.h>
#include <proto/payload.h>
#include <proto/proto_http.h>
-#include <proto/raw_sock.h>
#include <proto/sample.h>
#include <proto/server.h>
#include <proto/session.h>
socket_tcp.agent.health = socket_tcp.agent.rise; /* socket, but will fall down at first failure */
socket_tcp.agent.server = &socket_tcp;
- socket_tcp.xprt = &raw_sock;
+ socket_tcp.xprt = xprt_get(XPRT_RAW);
#ifdef USE_OPENSSL
/* Init TCP server: unchanged parameters */
socket_ssl.agent.server = &socket_ssl;
socket_ssl.use_ssl = 1;
- socket_ssl.xprt = &ssl_sock;
+ socket_ssl.xprt = xprt_get(XPRT_SSL);
for (idx = 0; args[idx] != NULL; idx++) {
if ((kw = srv_find_kw(args[idx])) != NULL) { /* Maybe it's registered server keyword */
if (iret == 0)
goto out;
tmplog += iret;
-#ifdef USE_OPENSSL
- if (sess->listener->bind_conf->xprt == &ssl_sock)
+ if (sess->listener->bind_conf->xprt == xprt_get(XPRT_SSL))
LOGCHAR('~');
-#endif
if (tmp->options & LOG_OPT_QUOTE)
LOGCHAR('"');
last_isspace = 0;
src = NULL;
conn = objt_conn(sess->origin);
if (conn) {
- if (sess->listener->bind_conf->xprt == &ssl_sock)
+ if (sess->listener->bind_conf->xprt == xprt_get(XPRT_SSL))
src = ssl_sock_get_cipher_name(conn);
}
ret = lf_text(tmplog, src, dst + maxsize - tmplog, tmp);
src = NULL;
conn = objt_conn(sess->origin);
if (conn) {
- if (sess->listener->bind_conf->xprt == &ssl_sock)
+ if (sess->listener->bind_conf->xprt == xprt_get(XPRT_SSL))
src = ssl_sock_get_proto_version(conn);
}
ret = lf_text(tmplog, src, dst + maxsize - tmplog, tmp);
#include <proto/port_range.h>
#include <proto/protocol.h>
#include <proto/queue.h>
-#include <proto/raw_sock.h>
#include <proto/server.h>
#include <proto/stream.h>
#include <proto/stream_interface.h>
skip_name_resolution:
newsrv->addr = *sk;
- newsrv->xprt = newsrv->check.xprt = newsrv->agent.xprt = &raw_sock;
+ newsrv->xprt = newsrv->check.xprt = newsrv->agent.xprt = xprt_get(XPRT_RAW);
if (!protocol_by_family(newsrv->addr.ss_family)) {
Alert("parsing [%s:%d] : Unknown protocol family %d '%s'\n",
#include <proto/log.h>
#include <proto/proto_http.h>
#include <proto/proxy.h>
-#include <proto/raw_sock.h>
#include <proto/session.h>
#include <proto/stream.h>
#include <proto/tcp_rules.h>
conn_xprt_close(cli_conn);
conn_free(cli_conn);
out_close:
- if (ret < 0 && l->bind_conf->xprt == &raw_sock && p->mode == PR_MODE_HTTP) {
+ if (ret < 0 && l->bind_conf->xprt == xprt_get(XPRT_RAW) && p->mode == PR_MODE_HTTP) {
/* critical error, no more memory, try to emit a 500 response */
struct chunk *err_msg = &p->errmsg[HTTP_ERR_500];
if (!err_msg->str)