From: Willy Tarreau Date: Mon, 20 Aug 2012 15:01:35 +0000 (+0200) Subject: REORG: sock_raw: rename the files raw_sock* X-Git-Tag: v1.5-dev12~80 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=75bf2c925fa28c280a52715be2fd5e3ea22a9174;p=thirdparty%2Fhaproxy.git REORG: sock_raw: rename the files raw_sock* The "raw_sock" prefix will be more convenient for naming functions as it will be prefixed with the data layer and suffixed with the data direction. So let's rename the files now to avoid any further confusion. The #include directive was also removed from a number of files which do not need it anymore. --- diff --git a/Makefile b/Makefile index f73c8da238..72b8888b0a 100644 --- a/Makefile +++ b/Makefile @@ -544,7 +544,7 @@ OBJS = src/haproxy.o src/sessionhash.o src/base64.o src/protocols.o \ src/time.o src/fd.o src/pipe.o src/regex.o src/cfgparse.o src/server.o \ src/checks.o src/queue.o src/frontend.o src/proxy.o src/peers.o \ src/arg.o src/stick_table.o src/proto_uxst.o src/connection.o \ - src/proto_http.o src/sock_raw.o src/appsession.o src/backend.o \ + src/proto_http.o src/raw_sock.o src/appsession.o src/backend.o \ src/lb_chash.o src/lb_fwlc.o src/lb_fwrr.o src/lb_map.o src/lb_fas.o \ src/stream_interface.o src/dumpstats.o src/proto_tcp.o \ src/session.o src/hdr_idx.o src/ev_select.o src/signal.o \ diff --git a/Makefile.bsd b/Makefile.bsd index acfdd2a0a9..9fc9b61657 100644 --- a/Makefile.bsd +++ b/Makefile.bsd @@ -109,7 +109,7 @@ OBJS = src/haproxy.o src/sessionhash.o src/base64.o src/protocols.o \ src/uri_auth.o src/standard.o src/buffers.o src/log.o src/task.o \ src/time.o src/fd.o src/pipe.o src/regex.o src/cfgparse.o src/server.o \ src/checks.o src/queue.o src/frontend.o src/proxy.o src/proto_uxst.o \ - src/proto_http.o src/sock_raw.o src/appsession.o src/backend.o \ + src/proto_http.o src/raw_sock.o src/appsession.o src/backend.o \ src/peers.o src/stream_interface.o src/dumpstats.o src/proto_tcp.o \ src/session.o src/hdr_idx.o src/ev_select.o src/signal.o \ src/lb_chash.o src/lb_fwlc.o src/lb_fwrr.o src/lb_map.o src/lb_fas.o \ diff --git a/Makefile.osx b/Makefile.osx index 31a7f99d72..9469be9650 100644 --- a/Makefile.osx +++ b/Makefile.osx @@ -106,7 +106,7 @@ OBJS = src/haproxy.o src/sessionhash.o src/base64.o src/protocols.o \ src/uri_auth.o src/standard.o src/buffers.o src/log.o src/task.o \ src/time.o src/fd.o src/pipe.o src/regex.o src/cfgparse.o src/server.o \ src/checks.o src/queue.o src/frontend.o src/proxy.o src/proto_uxst.o \ - src/proto_http.o src/sock_raw.o src/appsession.o src/backend.o \ + src/proto_http.o src/raw_sock.o src/appsession.o src/backend.o \ src/peers.o src/stream_interface.o src/dumpstats.o src/proto_tcp.o \ src/session.o src/hdr_idx.o src/ev_select.o src/signal.o \ src/lb_chash.o src/lb_fwlc.o src/lb_fwrr.o src/lb_map.o src/lb_fas.o \ diff --git a/include/proto/sock_raw.h b/include/proto/raw_sock.h similarity index 86% rename from include/proto/sock_raw.h rename to include/proto/raw_sock.h index 0d8b8780b5..36d4dec23f 100644 --- a/include/proto/sock_raw.h +++ b/include/proto/raw_sock.h @@ -1,5 +1,5 @@ /* - * include/proto/sock_raw.h + * include/proto/raw_sock.h * This file contains definition for raw stream socket operations * * Copyright (C) 2000-2012 Willy Tarreau - w@1wt.eu @@ -19,14 +19,14 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef _PROTO_SOCK_RAW_H -#define _PROTO_SOCK_RAW_H +#ifndef _PROTO_RAW_SOCK_H +#define _PROTO_RAW_SOCK_H #include -extern struct sock_ops sock_raw; +extern struct sock_ops raw_sock; -#endif /* _PROTO_SOCK_RAW_H */ +#endif /* _PROTO_RAW_SOCK_H */ /* * Local variables: diff --git a/src/backend.c b/src/backend.c index f9cbaf29e5..d5c4a99bca 100644 --- a/src/backend.c +++ b/src/backend.c @@ -43,7 +43,7 @@ #include #include #include -#include +#include #include #include @@ -988,9 +988,9 @@ int connect_server(struct session *s) stream_interface_prepare(s->req->cons, target_srv(&s->target)->sock); } else if (s->target.type == TARG_TYPE_PROXY) { - /* proxies exclusively run on sock_raw right now */ + /* proxies exclusively run on raw_sock right now */ s->req->cons->conn.ctrl = protocol_by_family(s->req->cons->addr.to.ss_family); - stream_interface_prepare(s->req->cons, &sock_raw); + stream_interface_prepare(s->req->cons, &raw_sock); if (!si_ctrl(s->req->cons)) return SN_ERR_INTERNAL; } diff --git a/src/cfgparse.c b/src/cfgparse.c index c623927b33..ea3b6cf77b 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -61,7 +61,7 @@ #include #include #include -#include +#include #include #include @@ -266,7 +266,7 @@ static int str2listener(char *str, struct proxy *curproxy, const char *file, int l->fd = -1; l->addr = ss; - l->sock = &sock_raw; + l->sock = &raw_sock; l->state = LI_INIT; if (ss.ss_family == AF_INET) { @@ -1275,7 +1275,7 @@ int cfg_parse_peers(const char *file, int linenum, char **args, int kwm) } newpeer->addr = *sk; newpeer->proto = protocol_by_family(newpeer->addr.ss_family); - newpeer->sock = &sock_raw; + newpeer->sock = &raw_sock; newpeer->sock_init_arg = NULL; if (!sk) { @@ -4093,7 +4093,7 @@ stats_error_parsing: } newsrv->addr = *sk; newsrv->proto = protocol_by_family(newsrv->addr.ss_family); - newsrv->sock = &sock_raw; + newsrv->sock = &raw_sock; newsrv->sock_init_arg = NULL; if (!sk) { diff --git a/src/dumpstats.c b/src/dumpstats.c index 4d7b90c4ea..9112d2d46a 100644 --- a/src/dumpstats.c +++ b/src/dumpstats.c @@ -52,7 +52,7 @@ #include #include #include -#include +#include #include #include @@ -277,7 +277,7 @@ static int stats_parse_global(char **args, int section_type, struct proxy *curpx } } - global.stats_sock.sock = &sock_raw; + global.stats_sock.sock = &raw_sock; uxst_add_listener(&global.stats_sock); global.maxsock++; } diff --git a/src/frontend.c b/src/frontend.c index a4f094016e..b07d3d1f84 100644 --- a/src/frontend.c +++ b/src/frontend.c @@ -41,7 +41,6 @@ #include #include #include -#include #include #include diff --git a/src/haproxy.c b/src/haproxy.c index 499d3985de..f1047405b3 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -85,7 +85,6 @@ #include #include #include -#include #include #ifdef CONFIG_HAP_CTTPROXY diff --git a/src/log.c b/src/log.c index b1f532a672..bdb0060d54 100644 --- a/src/log.c +++ b/src/log.c @@ -32,7 +32,6 @@ #include #include -#include #include const char *log_facilities[NB_LOG_FACILITIES] = { diff --git a/src/peers.c b/src/peers.c index c168ec495f..4be52a2421 100644 --- a/src/peers.c +++ b/src/peers.c @@ -37,7 +37,6 @@ #include #include #include -#include #include #include #include diff --git a/src/proto_http.c b/src/proto_http.c index c9383b41ea..de1cec6807 100644 --- a/src/proto_http.c +++ b/src/proto_http.c @@ -59,7 +59,6 @@ #include #include #include -#include #include #include diff --git a/src/proto_tcp.c b/src/proto_tcp.c index be246e1921..86fd6bd512 100644 --- a/src/proto_tcp.c +++ b/src/proto_tcp.c @@ -49,7 +49,6 @@ #include #include #include -#include #include #include #include diff --git a/src/proto_uxst.c b/src/proto_uxst.c index bd0d7886c4..e4aaeedfeb 100644 --- a/src/proto_uxst.c +++ b/src/proto_uxst.c @@ -39,7 +39,6 @@ #include #include #include -#include #include static int uxst_bind_listener(struct listener *listener, char *errmsg, int errlen); diff --git a/src/sock_raw.c b/src/raw_sock.c similarity index 99% rename from src/sock_raw.c rename to src/raw_sock.c index 96debe9f3c..28ee222358 100644 --- a/src/sock_raw.c +++ b/src/raw_sock.c @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include #include @@ -591,7 +591,7 @@ static int sock_raw_write_loop(struct connection *conn) /* stream sock operations */ -struct sock_ops sock_raw = { +struct sock_ops raw_sock = { .update = stream_int_update_conn, .shutr = NULL, .shutw = NULL, diff --git a/src/session.c b/src/session.c index fa5efae1aa..fa3c4dcb52 100644 --- a/src/session.c +++ b/src/session.c @@ -41,7 +41,6 @@ #include #include #include -#include #include #include #include diff --git a/src/stream_interface.c b/src/stream_interface.c index bdbf2e7fa4..ca06949fd5 100644 --- a/src/stream_interface.c +++ b/src/stream_interface.c @@ -30,7 +30,6 @@ #include #include #include -#include #include #include