mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-06 07:07:04 +02:00
CLEANUP: tree-wide: Remove any ref to stream-interfaces
Stream-interfaces are gone. Corresponding files can be safely be removed. In addition, comments are updated accordingly.
This commit is contained in:
parent
09b3c5559e
commit
6b0a0fb2f9
2
Makefile
2
Makefile
@ -929,7 +929,7 @@ OBJS += src/mux_h2.o src/mux_fcgi.o src/http_ana.o src/mux_h1.o \
|
||||
src/resolvers.o src/backend.o src/cfgparse.o src/http_htx.o src/cli.o \
|
||||
src/proxy.o src/pattern.o src/connection.o src/check.o \
|
||||
src/cfgparse-listen.o src/cache.o src/haproxy.o src/http_act.o \
|
||||
src/http_fetch.o src/stream_interface.o src/dns.o src/listener.o \
|
||||
src/http_fetch.o src/dns.o src/listener.o \
|
||||
src/http_client.o src/vars.o src/tcp_rules.o src/debug.o src/sink.o \
|
||||
src/server_state.o src/filters.o src/h2.o src/fcgi-app.o src/task.o \
|
||||
src/payload.o src/h1_htx.o src/mjson.o src/h1.o src/map.o \
|
||||
|
@ -35,7 +35,6 @@
|
||||
#include <haproxy/server.h>
|
||||
#include <haproxy/stats.h>
|
||||
#include <haproxy/stream.h>
|
||||
#include <haproxy/stream_interface.h>
|
||||
#include <haproxy/task.h>
|
||||
#include <haproxy/tools.h>
|
||||
#include <haproxy/version.h>
|
||||
|
@ -32,14 +32,14 @@
|
||||
* before doing further I/O :
|
||||
* CF_*_NULL, CF_*_PARTIAL
|
||||
*
|
||||
* - pure status flags, reported by stream-interface layer, which must also
|
||||
* - pure status flags, reported by conn-stream layer, which must also
|
||||
* be cleared before doing further I/O :
|
||||
* CF_*_TIMEOUT, CF_*_ERROR
|
||||
*
|
||||
* - read-only indicators reported by lower data levels :
|
||||
* CF_STREAMER, CF_STREAMER_FAST
|
||||
*
|
||||
* - write-once status flags reported by the stream-interface layer :
|
||||
* - write-once status flags reported by the conn-stream layer :
|
||||
* CF_SHUTR, CF_SHUTW
|
||||
*
|
||||
* - persistent control flags managed only by application level :
|
||||
@ -48,7 +48,7 @@
|
||||
* The flags have been arranged for readability, so that the read and write
|
||||
* bits have the same position in a byte (read being the lower byte and write
|
||||
* the second one). All flag names are relative to the channel. For instance,
|
||||
* 'write' indicates the direction from the channel to the stream interface.
|
||||
* 'write' indicates the direction from the channel to the conn-stream.
|
||||
*/
|
||||
|
||||
#define CF_READ_NULL 0x00000001 /* last read detected on producer side */
|
||||
|
@ -28,11 +28,11 @@
|
||||
#include <haproxy/global.h>
|
||||
#include <haproxy/htx.h>
|
||||
#include <haproxy/stream.h>
|
||||
#include <haproxy/stream_interface-t.h>
|
||||
#include <haproxy/task.h>
|
||||
#include <haproxy/ticks.h>
|
||||
#include <haproxy/tools-t.h>
|
||||
|
||||
struct conn_stream;
|
||||
|
||||
/* perform minimal intializations, report 0 in case of error, 1 if OK. */
|
||||
int init_channel();
|
||||
@ -477,7 +477,7 @@ static inline int channel_htx_may_recv(const struct channel *chn, const struct h
|
||||
* are considered as available since they're supposed to leave the buffer. The
|
||||
* test is optimized to avoid as many operations as possible for the fast case
|
||||
* and to be used as an "if" condition. Just like channel_recv_limit(), we
|
||||
* never allow to overwrite the reserve until the output stream interface is
|
||||
* never allow to overwrite the reserve until the output conn-stream is
|
||||
* connected, otherwise we could spin on a POST with http-send-name-header.
|
||||
*/
|
||||
static inline int channel_may_recv(const struct channel *chn)
|
||||
|
@ -236,7 +236,7 @@ static inline struct conn_stream *cs_conn_get_first(const struct connection *con
|
||||
}
|
||||
|
||||
|
||||
/* Returns non-zero if the stream interface's Rx path is blocked */
|
||||
/* Returns non-zero if the conn-stream's Rx path is blocked */
|
||||
static inline int cs_rx_blocked(const struct conn_stream *cs)
|
||||
{
|
||||
return !!(cs->endp->flags & CS_EP_RXBLK_ANY);
|
||||
|
@ -29,9 +29,9 @@
|
||||
#include <haproxy/task-t.h>
|
||||
#include <haproxy/connection.h>
|
||||
#include <haproxy/conn_stream.h>
|
||||
#include <haproxy/channel.h>
|
||||
#include <haproxy/session.h>
|
||||
#include <haproxy/stream.h>
|
||||
#include <haproxy/stream_interface.h>
|
||||
|
||||
void cs_update_rx(struct conn_stream *cs);
|
||||
void cs_update_tx(struct conn_stream *cs);
|
||||
@ -151,7 +151,7 @@ static inline int cs_is_conn_error(const struct conn_stream *cs)
|
||||
* failure, non-zero otherwise. If no buffer is available, the requester,
|
||||
* represented by the <wait> pointer, will be added in the list of objects
|
||||
* waiting for an available buffer, and CS_EP_RXBLK_BUFF will be set on the
|
||||
* stream-int and CS_EP_RX_WAIT_EP cleared. The requester will be responsible
|
||||
* conn-stream and CS_EP_RX_WAIT_EP cleared. The requester will be responsible
|
||||
* for calling this function to try again once woken up.
|
||||
*/
|
||||
static inline int cs_alloc_ibuf(struct conn_stream *cs, struct buffer_wait *wait)
|
||||
@ -288,7 +288,7 @@ static inline void cs_shutw(struct conn_stream *cs)
|
||||
|
||||
/* This is to be used after making some room available in a channel. It will
|
||||
* return without doing anything if the conn-stream's RX path is blocked.
|
||||
* It will automatically mark the stream interface as busy processing the end
|
||||
* It will automatically mark the conn-stream as busy processing the end
|
||||
* point in order to avoid useless repeated wakeups.
|
||||
* It will then call ->chk_rcv() to enable receipt of new data.
|
||||
*/
|
||||
@ -320,7 +320,7 @@ static inline void cs_update(struct conn_stream *cs)
|
||||
cs_update_tx(cs);
|
||||
}
|
||||
|
||||
/* for debugging, reports the stream interface state name */
|
||||
/* for debugging, reports the conn-stream state name */
|
||||
static inline const char *cs_state_str(int state)
|
||||
{
|
||||
switch (state) {
|
||||
|
@ -32,7 +32,6 @@
|
||||
#include <haproxy/proxy-t.h>
|
||||
#include <haproxy/server-t.h>
|
||||
#include <haproxy/stream-t.h>
|
||||
#include <haproxy/stream_interface-t.h>
|
||||
|
||||
static inline enum obj_type obj_type(const enum obj_type *t)
|
||||
{
|
||||
|
@ -26,7 +26,6 @@
|
||||
#include <haproxy/api.h>
|
||||
#include <haproxy/stats-t.h>
|
||||
|
||||
struct stream_interface;
|
||||
struct channel;
|
||||
struct buffer;
|
||||
struct proxy;
|
||||
@ -58,7 +57,6 @@ int stats_fill_sv_stats(struct proxy *px, struct server *sv, int flags,
|
||||
int stats_fill_be_stats(struct proxy *px, int flags, struct field *stats, int len,
|
||||
enum stat_field *selected_field);
|
||||
|
||||
void stats_io_handler(struct stream_interface *si);
|
||||
int stats_emit_raw_data_field(struct buffer *out, const struct field *f);
|
||||
int stats_emit_typed_data_field(struct buffer *out, const struct field *f);
|
||||
int stats_emit_field_tags(struct buffer *out, const struct field *f,
|
||||
|
@ -31,7 +31,6 @@
|
||||
#include <haproxy/filters-t.h>
|
||||
#include <haproxy/obj_type-t.h>
|
||||
#include <haproxy/stick_table-t.h>
|
||||
#include <haproxy/stream_interface-t.h>
|
||||
#include <haproxy/vars-t.h>
|
||||
|
||||
|
||||
|
@ -1,63 +0,0 @@
|
||||
/*
|
||||
* include/haproxy/stream_interface-t.h
|
||||
* This file describes the stream_interface struct and associated constants.
|
||||
*
|
||||
* Copyright (C) 2000-2014 Willy Tarreau - w@1wt.eu
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation, version 2.1
|
||||
* exclusively.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef _HAPROXY_STREAM_INTERFACE_T_H
|
||||
#define _HAPROXY_STREAM_INTERFACE_T_H
|
||||
|
||||
#include <haproxy/api-t.h>
|
||||
#include <haproxy/buf-t.h>
|
||||
#include <haproxy/connection-t.h>
|
||||
|
||||
struct conn_stream;
|
||||
|
||||
/* flags set after I/O (32 bit) */
|
||||
enum {
|
||||
SI_FL_NONE = 0x00000000, /* nothing */
|
||||
/* unused: 0x00000001, 0x00000002 */
|
||||
SI_FL_ISBACK = 0x00000010, /* 0 for front-side SI, 1 for back-side */
|
||||
};
|
||||
|
||||
/* A stream interface has 3 parts :
|
||||
* - the buffer side, which interfaces to the buffers.
|
||||
* - the remote side, which describes the state and address of the other side.
|
||||
* - the functions, which are used by the buffer side to communicate with the
|
||||
* remote side from the buffer side.
|
||||
*/
|
||||
|
||||
/* Note that if an applet is registered, the update function will not be called
|
||||
* by the session handler, so it may be used to resync flags at the end of the
|
||||
* applet handler.
|
||||
*/
|
||||
struct stream_interface {
|
||||
/* struct members used by the "buffer" side */
|
||||
/* 16-bit hole here */
|
||||
unsigned int flags; /* SI_FL_* */
|
||||
struct conn_stream *cs; /* points to the conn-streams that owns the endpoint (connection or applet) */
|
||||
};
|
||||
|
||||
#endif /* _HAPROXY_STREAM_INTERFACE_T_H */
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* c-indent-level: 8
|
||||
* c-basic-offset: 8
|
||||
* End:
|
||||
*/
|
@ -1,52 +0,0 @@
|
||||
/*
|
||||
* include/haproxy/stream_interface.h
|
||||
* This file contains stream_interface function prototypes
|
||||
*
|
||||
* Copyright (C) 2000-2014 Willy Tarreau - w@1wt.eu
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation, version 2.1
|
||||
* exclusively.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef _HAPROXY_STREAM_INTERFACE_H
|
||||
#define _HAPROXY_STREAM_INTERFACE_H
|
||||
|
||||
#include <haproxy/api.h>
|
||||
#include <haproxy/applet.h>
|
||||
#include <haproxy/channel.h>
|
||||
#include <haproxy/connection.h>
|
||||
#include <haproxy/conn_stream.h>
|
||||
#include <haproxy/obj_type.h>
|
||||
|
||||
struct stream_interface *si_new(struct conn_stream *cs);
|
||||
void si_free(struct stream_interface *si);
|
||||
|
||||
/* initializes a stream interface and create the event
|
||||
* tasklet.
|
||||
*/
|
||||
static inline int si_init(struct stream_interface *si)
|
||||
{
|
||||
si->flags &= SI_FL_ISBACK;
|
||||
si->cs = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* _HAPROXY_STREAM_INTERFACE_H */
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* c-indent-level: 8
|
||||
* c-basic-offset: 8
|
||||
* End:
|
||||
*/
|
@ -19,7 +19,6 @@
|
||||
#include <haproxy/conn_stream.h>
|
||||
#include <haproxy/cs_utils.h>
|
||||
#include <haproxy/freq_ctr.h>
|
||||
#include <haproxy/stream_interface.h>
|
||||
#include <haproxy/tools.h>
|
||||
#include <haproxy/xxhash.h>
|
||||
|
||||
|
@ -20,7 +20,6 @@
|
||||
#include <haproxy/cs_utils.h>
|
||||
#include <haproxy/list.h>
|
||||
#include <haproxy/stream.h>
|
||||
#include <haproxy/stream_interface.h>
|
||||
#include <haproxy/task.h>
|
||||
|
||||
unsigned int nb_applets = 0;
|
||||
@ -94,7 +93,7 @@ struct appctx *appctx_new(struct applet *applet, struct cs_endpoint *endp)
|
||||
|
||||
/* Callback used to wake up an applet when a buffer is available. The applet
|
||||
* <appctx> is woken up if an input buffer was requested for the associated
|
||||
* stream interface. In this case the buffer is immediately allocated and the
|
||||
* conn-stream. In this case the buffer is immediately allocated and the
|
||||
* function returns 1. Otherwise it returns 0. Note that this automatically
|
||||
* covers multiple wake-up attempts by ensuring that the same buffer will not
|
||||
* be accounted for multiple times.
|
||||
|
@ -55,7 +55,6 @@
|
||||
#include <haproxy/session.h>
|
||||
#include <haproxy/ssl_sock.h>
|
||||
#include <haproxy/stream.h>
|
||||
#include <haproxy/stream_interface.h>
|
||||
#include <haproxy/task.h>
|
||||
#include <haproxy/ticks.h>
|
||||
#include <haproxy/time.h>
|
||||
@ -1274,7 +1273,7 @@ static int do_connect_server(struct stream *s, struct connection *conn)
|
||||
|
||||
/*
|
||||
* This function initiates a connection to the server assigned to this stream
|
||||
* (s->target, (s->csb->si)->addr.to). It will assign a server if none
|
||||
* (s->target, (s->csb)->addr.to). It will assign a server if none
|
||||
* is assigned yet.
|
||||
* It can return one of :
|
||||
* - SF_ERR_NONE if everything's OK
|
||||
@ -1284,8 +1283,7 @@ static int do_connect_server(struct stream *s, struct connection *conn)
|
||||
* - SF_ERR_RESOURCE if a system resource is lacking (eg: fd limits, ports, ...)
|
||||
* - SF_ERR_INTERNAL for any other purely internal errors
|
||||
* Additionally, in the case of SF_ERR_RESOURCE, an emergency log will be emitted.
|
||||
* The server-facing stream interface is expected to hold a pre-allocated connection
|
||||
* in s->csb->si->conn.
|
||||
* The server-facing conn-stream is expected to hold a pre-allocated connection.
|
||||
*/
|
||||
static int connect_server(struct stream *s)
|
||||
{
|
||||
@ -1590,7 +1588,7 @@ static int connect_server(struct stream *s)
|
||||
srv_conn->proxy_netns = cli_conn ? cli_conn->proxy_netns : NULL;
|
||||
|
||||
if (!srv_conn->xprt) {
|
||||
/* set the correct protocol on the output stream interface */
|
||||
/* set the correct protocol on the output conn-stream */
|
||||
if (srv) {
|
||||
if (conn_prepare(srv_conn, protocol_lookup(srv_conn->dst->ss_family, PROTO_TYPE_STREAM, 0), srv->xprt)) {
|
||||
conn_free(srv_conn);
|
||||
@ -1780,7 +1778,7 @@ static int connect_server(struct stream *s)
|
||||
s->be->lbprm.server_take_conn(srv);
|
||||
}
|
||||
|
||||
/* Now handle synchronously connected sockets. We know the stream-int
|
||||
/* Now handle synchronously connected sockets. We know the conn-stream
|
||||
* is at least in state CS_ST_CON. These ones typically are UNIX
|
||||
* sockets, socket pairs, andoccasionally TCP connections on the
|
||||
* loopback on a heavily loaded system.
|
||||
@ -1921,7 +1919,7 @@ static int back_may_abort_req(struct channel *req, struct stream *s)
|
||||
(channel_is_empty(req) || (s->be->options & PR_O_ABRT_CLOSE))));
|
||||
}
|
||||
|
||||
/* Update back stream interface status for input states CS_ST_ASS, CS_ST_QUE,
|
||||
/* Update back conn-stream status for input states CS_ST_ASS, CS_ST_QUE,
|
||||
* CS_ST_TAR. Other input states are simply ignored.
|
||||
* Possible output states are CS_ST_CLO, CS_ST_TAR, CS_ST_ASS, CS_ST_REQ, CS_ST_CON
|
||||
* and CS_ST_EST. Flags must have previously been updated for timeouts and other
|
||||
@ -2112,7 +2110,7 @@ void back_try_conn_req(struct stream *s)
|
||||
return;
|
||||
}
|
||||
|
||||
/* This function initiates a server connection request on a stream interface
|
||||
/* This function initiates a server connection request on a conn-stream
|
||||
* already in CS_ST_REQ state. Upon success, the state goes to CS_ST_ASS for
|
||||
* a real connection to a server, indicating that a server has been assigned,
|
||||
* or CS_ST_EST for a successful connection to an applet. It may also return
|
||||
@ -2332,7 +2330,7 @@ void back_handle_st_cer(struct stream *s)
|
||||
* resources as soon as possible and to not catch errors from the lower
|
||||
* layers in an unexpected state (i.e < ST_CONN).
|
||||
*
|
||||
* Note: the stream-interface will be switched to ST_REQ, ST_ASS or
|
||||
* Note: the conn-stream will be switched to ST_REQ, ST_ASS or
|
||||
* ST_TAR and CS_EP_ERROR and SF_CONN_EXP flags will be unset.
|
||||
*/
|
||||
if (cs_reset_endp(cs) < 0) {
|
||||
|
@ -33,7 +33,6 @@
|
||||
#include <haproxy/sample.h>
|
||||
#include <haproxy/shctx.h>
|
||||
#include <haproxy/stream.h>
|
||||
#include <haproxy/stream_interface.h>
|
||||
#include <haproxy/tools.h>
|
||||
|
||||
#define CACHE_FLT_F_IMPLICIT_DECL 0x00000001 /* The cache filtre was implicitly declared (ie without
|
||||
|
@ -260,7 +260,7 @@ int co_getdelim(const struct channel *chn, char *str, int len, const char *delim
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Gets one text word out of a channel's buffer from a stream interface.
|
||||
/* Gets one text word out of a channel's buffer from a conn-stream.
|
||||
* Return values :
|
||||
* >0 : number of bytes read. Includes the sep if present before len or end.
|
||||
* =0 : no sep before end found. <str> is left undefined.
|
||||
@ -311,7 +311,7 @@ int co_getword(const struct channel *chn, char *str, int len, char sep)
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Gets one text line out of a channel's buffer from a stream interface.
|
||||
/* Gets one text line out of a channel's buffer from a conn-stream.
|
||||
* Return values :
|
||||
* >0 : number of bytes read. Includes the \n if present before len or end.
|
||||
* =0 : no '\n' before end found. <str> is left undefined.
|
||||
@ -426,7 +426,7 @@ int co_getblk_nc(const struct channel *chn, const char **blk1, size_t *len1, con
|
||||
return b_getblk_nc(&chn->buf, blk1, len1, blk2, len2, 0, co_data(chn));
|
||||
}
|
||||
|
||||
/* Gets one text line out of a channel's output buffer from a stream interface.
|
||||
/* Gets one text line out of a channel's output buffer from a conn-stream.
|
||||
* Return values :
|
||||
* >0 : number of blocks returned (1 or 2). blk1 is always filled before blk2.
|
||||
* =0 : not enough data available.
|
||||
@ -502,7 +502,7 @@ int ci_getblk_nc(const struct channel *chn,
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Gets one text line out of a channel's input buffer from a stream interface.
|
||||
/* Gets one text line out of a channel's input buffer from a conn-stream.
|
||||
* Return values :
|
||||
* >0 : number of blocks returned (1 or 2). blk1 is always filled before blk2.
|
||||
* =0 : not enough data available.
|
||||
|
@ -36,7 +36,7 @@
|
||||
#include <haproxy/check.h>
|
||||
#include <haproxy/chunk.h>
|
||||
#include <haproxy/dgram.h>
|
||||
#include <haproxy/dynbuf-t.h>
|
||||
#include <haproxy/dynbuf.h>
|
||||
#include <haproxy/extcheck.h>
|
||||
#include <haproxy/fd.h>
|
||||
#include <haproxy/global.h>
|
||||
@ -59,7 +59,6 @@
|
||||
#include <haproxy/server.h>
|
||||
#include <haproxy/ssl_sock.h>
|
||||
#include <haproxy/stats-t.h>
|
||||
#include <haproxy/stream_interface.h>
|
||||
#include <haproxy/task.h>
|
||||
#include <haproxy/tcpcheck.h>
|
||||
#include <haproxy/thread.h>
|
||||
@ -117,7 +116,7 @@ static const struct name_desc check_trace_decoding[] = {
|
||||
#define CHK_VERB_CLEAN 1
|
||||
{ .name="clean", .desc="only user-friendly stuff, generally suitable for level \"user\"" },
|
||||
#define CHK_VERB_MINIMAL 2
|
||||
{ .name="minimal", .desc="report info on stream and stream-interfaces" },
|
||||
{ .name="minimal", .desc="report info on stream and conn-streams" },
|
||||
#define CHK_VERB_SIMPLE 3
|
||||
{ .name="simple", .desc="add info on request and response channels" },
|
||||
#define CHK_VERB_ADVANCED 4
|
||||
|
11
src/cli.c
11
src/cli.c
@ -28,7 +28,7 @@
|
||||
|
||||
#include <haproxy/activity.h>
|
||||
#include <haproxy/api.h>
|
||||
#include <haproxy/applet-t.h>
|
||||
#include <haproxy/applet.h>
|
||||
#include <haproxy/base64.h>
|
||||
#include <haproxy/cfgparse.h>
|
||||
#include <haproxy/channel.h>
|
||||
@ -59,7 +59,6 @@
|
||||
#include <haproxy/sock.h>
|
||||
#include <haproxy/stats-t.h>
|
||||
#include <haproxy/stream.h>
|
||||
#include <haproxy/stream_interface.h>
|
||||
#include <haproxy/task.h>
|
||||
#include <haproxy/ticks.h>
|
||||
#include <haproxy/time.h>
|
||||
@ -866,7 +865,7 @@ static int cli_output_msg(struct channel *chn, const char *msg, int severity, in
|
||||
return ci_putblk(chn, tmp->area, strlen(tmp->area));
|
||||
}
|
||||
|
||||
/* This I/O handler runs as an applet embedded in a stream interface. It is
|
||||
/* This I/O handler runs as an applet embedded in a conn-stream. It is
|
||||
* used to processes I/O from/to the stats unix socket. The system relies on a
|
||||
* state machine handling requests and various responses. We read a request,
|
||||
* then we process it and send the response, and we possibly display a prompt.
|
||||
@ -1147,7 +1146,7 @@ static void cli_io_handler(struct appctx *appctx)
|
||||
}
|
||||
|
||||
if ((res->flags & CF_SHUTR) && (cs->state == CS_ST_EST)) {
|
||||
DPRINTF(stderr, "%s@%d: si to buf closed. req=%08x, res=%08x, st=%d\n",
|
||||
DPRINTF(stderr, "%s@%d: cs to buf closed. req=%08x, res=%08x, st=%d\n",
|
||||
__FUNCTION__, __LINE__, req->flags, res->flags, cs->state);
|
||||
/* Other side has closed, let's abort if we have no more processing to do
|
||||
* and nothing more to consume. This is comparable to a broken pipe, so
|
||||
@ -1158,7 +1157,7 @@ static void cli_io_handler(struct appctx *appctx)
|
||||
}
|
||||
|
||||
if ((req->flags & CF_SHUTW) && (cs->state == CS_ST_EST) && (appctx->st0 < CLI_ST_OUTPUT)) {
|
||||
DPRINTF(stderr, "%s@%d: buf to si closed. req=%08x, res=%08x, st=%d\n",
|
||||
DPRINTF(stderr, "%s@%d: buf to cs closed. req=%08x, res=%08x, st=%d\n",
|
||||
__FUNCTION__, __LINE__, req->flags, res->flags, cs->state);
|
||||
/* We have no more processing to do, and nothing more to send, and
|
||||
* the client side has closed. So we'll forward this state downstream
|
||||
@ -1174,7 +1173,7 @@ static void cli_io_handler(struct appctx *appctx)
|
||||
cs->state, req->flags, res->flags, ci_data(req), co_data(req), ci_data(res), co_data(res));
|
||||
}
|
||||
|
||||
/* This is called when the stream interface is closed. For instance, upon an
|
||||
/* This is called when the conn-stream is closed. For instance, upon an
|
||||
* external abort, we won't call the i/o handler anymore so we may need to
|
||||
* remove back references to the stream currently being dumped.
|
||||
*/
|
||||
|
@ -436,7 +436,7 @@ void cs_applet_release(struct conn_stream *cs)
|
||||
* This function performs a shutdown-read on a detached conn-stream in a
|
||||
* connected or init state (it does nothing for other states). It either shuts
|
||||
* the read side or marks itself as closed. The buffer flags are updated to
|
||||
* reflect the new state. If the stream interface has CS_FL_NOHALF, we also
|
||||
* reflect the new state. If the conn-stream has CS_FL_NOHALF, we also
|
||||
* forward the close to the write side. The owner task is woken up if it exists.
|
||||
*/
|
||||
static void cs_app_shutr(struct conn_stream *cs)
|
||||
@ -470,7 +470,7 @@ static void cs_app_shutr(struct conn_stream *cs)
|
||||
* This function performs a shutdown-write on a detached conn-stream in a
|
||||
* connected or init state (it does nothing for other states). It either shuts
|
||||
* the write side or marks itself as closed. The buffer flags are updated to
|
||||
* reflect the new state. It does also close everything if the SI was marked as
|
||||
* reflect the new state. It does also close everything if the CS was marked as
|
||||
* being in error state. The owner task is woken up if it exists.
|
||||
*/
|
||||
static void cs_app_shutw(struct conn_stream *cs)
|
||||
@ -575,7 +575,7 @@ static void cs_app_chk_snd(struct conn_stream *cs)
|
||||
* This function performs a shutdown-read on a conn-stream attached to
|
||||
* a connection in a connected or init state (it does nothing for other
|
||||
* states). It either shuts the read side or marks itself as closed. The buffer
|
||||
* flags are updated to reflect the new state. If the stream interface has
|
||||
* flags are updated to reflect the new state. If the conn-stream has
|
||||
* CS_FL_NOHALF, we also forward the close to the write side. If a control
|
||||
* layer is defined, then it is supposed to be a socket layer and file
|
||||
* descriptors are then shutdown or closed accordingly. The function
|
||||
@ -612,7 +612,7 @@ static void cs_app_shutr_conn(struct conn_stream *cs)
|
||||
* a connection in a connected or init state (it does nothing for other
|
||||
* states). It either shuts the write side or marks itself as closed. The
|
||||
* buffer flags are updated to reflect the new state. It does also close
|
||||
* everything if the SI was marked as being in error state. If there is a
|
||||
* everything if the CS was marked as being in error state. If there is a
|
||||
* data-layer shutdown, it is called.
|
||||
*/
|
||||
static void cs_app_shutw_conn(struct conn_stream *cs)
|
||||
@ -693,7 +693,7 @@ static void cs_app_shutw_conn(struct conn_stream *cs)
|
||||
* consumer to inform the producer side that it may be interested in checking
|
||||
* for free space in the buffer. Note that it intentionally does not update
|
||||
* timeouts, so that we can still check them later at wake-up. This function is
|
||||
* dedicated to connection-based stream interfaces.
|
||||
* dedicated to connection-based conn-streams.
|
||||
*/
|
||||
static void cs_app_chk_rcv_conn(struct conn_stream *cs)
|
||||
{
|
||||
@ -804,7 +804,7 @@ static void cs_app_chk_snd_conn(struct conn_stream *cs)
|
||||
* This function performs a shutdown-read on a conn-stream attached to an
|
||||
* applet in a connected or init state (it does nothing for other states). It
|
||||
* either shuts the read side or marks itself as closed. The buffer flags are
|
||||
* updated to reflect the new state. If the stream interface has CS_FL_NOHALF,
|
||||
* updated to reflect the new state. If the conn-stream has CS_FL_NOHALF,
|
||||
* we also forward the close to the write side. The owner task is woken up if
|
||||
* it exists.
|
||||
*/
|
||||
@ -1170,7 +1170,7 @@ static void cs_notify(struct conn_stream *cs)
|
||||
|
||||
/*
|
||||
* This function propagates a null read received on a socket-based connection.
|
||||
* It updates the stream interface. If the stream interface has CS_FL_NOHALF,
|
||||
* It updates the conn-stream. If the conn-stream has CS_FL_NOHALF,
|
||||
* the close is also forwarded to the write side as an abort.
|
||||
*/
|
||||
static void cs_conn_read0(struct conn_stream *cs)
|
||||
@ -1430,7 +1430,7 @@ static int cs_conn_recv(struct conn_stream *cs)
|
||||
ic->total += ret;
|
||||
|
||||
/* End-of-input reached, we can leave. In this case, it is
|
||||
* important to break the loop to not block the SI because of
|
||||
* important to break the loop to not block the CS because of
|
||||
* the channel's policies.This way, we are still able to receive
|
||||
* shutdowns.
|
||||
*/
|
||||
@ -1546,7 +1546,7 @@ static int cs_conn_recv(struct conn_stream *cs)
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* This tries to perform a synchronous receive on the stream interface to
|
||||
/* This tries to perform a synchronous receive on the conn-stream to
|
||||
* try to collect last arrived data. In practice it's only implemented on
|
||||
* conn_streams. Returns 0 if nothing was done, non-zero if new data or a
|
||||
* shutdown were collected. This may result on some delayed receive calls
|
||||
@ -1587,7 +1587,7 @@ static int cs_conn_send(struct conn_stream *cs)
|
||||
if (cs->endp->flags & (CS_EP_ERROR|CS_EP_ERR_PENDING) || cs_is_conn_error(cs)) {
|
||||
/* We're probably there because the tasklet was woken up,
|
||||
* but process_stream() ran before, detected there were an
|
||||
* error and put the si back to CS_ST_TAR. There's still
|
||||
* error and put the CS back to CS_ST_TAR. There's still
|
||||
* CO_FL_ERROR on the connection but we don't want to add
|
||||
* CS_EP_ERROR back, so give up
|
||||
*/
|
||||
@ -1717,7 +1717,7 @@ static int cs_conn_send(struct conn_stream *cs)
|
||||
return did_send;
|
||||
}
|
||||
|
||||
/* perform a synchronous send() for the stream interface. The CF_WRITE_NULL and
|
||||
/* perform a synchronous send() for the conn-stream. The CF_WRITE_NULL and
|
||||
* CF_WRITE_PARTIAL flags are cleared prior to the attempt, and will possibly
|
||||
* be updated in case of success.
|
||||
*/
|
||||
@ -1743,9 +1743,9 @@ void cs_conn_sync_send(struct conn_stream *cs)
|
||||
}
|
||||
|
||||
/* Called by I/O handlers after completion.. It propagates
|
||||
* connection flags to the stream interface, updates the stream (which may or
|
||||
* connection flags to the conn-stream, updates the stream (which may or
|
||||
* may not take this opportunity to try to forward data), then update the
|
||||
* connection's polling based on the channels and stream interface's final
|
||||
* connection's polling based on the channels and conn-stream's final
|
||||
* states. The function always returns 0.
|
||||
*/
|
||||
static int cs_conn_process(struct conn_stream *cs)
|
||||
@ -1822,9 +1822,9 @@ static int cs_conn_process(struct conn_stream *cs)
|
||||
if ((cs->endp->flags & CS_EP_EOI) && !(ic->flags & CF_EOI))
|
||||
ic->flags |= (CF_EOI|CF_READ_PARTIAL);
|
||||
|
||||
/* Second step : update the stream-int and channels, try to forward any
|
||||
/* Second step : update the conn-stream and channels, try to forward any
|
||||
* pending data, then possibly wake the stream up based on the new
|
||||
* stream-int status.
|
||||
* conn-stream status.
|
||||
*/
|
||||
cs_notify(cs);
|
||||
stream_release_buffers(__cs_strm(cs));
|
||||
@ -1832,9 +1832,9 @@ static int cs_conn_process(struct conn_stream *cs)
|
||||
}
|
||||
|
||||
/* This is the ->process() function for any conn-stream's wait_event task.
|
||||
* It's assigned during the stream-interface's initialization, for any type of
|
||||
* stream interface. Thus it is always safe to perform a tasklet_wakeup() on a
|
||||
* stream interface, as the presence of the CS is checked there.
|
||||
* It's assigned during the conn-stream's initialization, for any type of
|
||||
* conn-stream. Thus it is always safe to perform a tasklet_wakeup() on a
|
||||
* conn-stream, as the presence of the CS is checked there.
|
||||
*/
|
||||
struct task *cs_conn_io_cb(struct task *t, void *ctx, unsigned int state)
|
||||
{
|
||||
@ -1857,7 +1857,7 @@ struct task *cs_conn_io_cb(struct task *t, void *ctx, unsigned int state)
|
||||
|
||||
/* Callback to be used by applet handlers upon completion. It updates the stream
|
||||
* (which may or may not take this opportunity to try to forward data), then
|
||||
* may re-enable the applet's based on the channels and stream interface's final
|
||||
* may re-enable the applet's based on the channels and conn-stream's final
|
||||
* states.
|
||||
*/
|
||||
static int cs_applet_process(struct conn_stream *cs)
|
||||
@ -1878,7 +1878,7 @@ static int cs_applet_process(struct conn_stream *cs)
|
||||
if (cs_rx_blocked(cs))
|
||||
cs_rx_endp_more(cs);
|
||||
|
||||
/* update the stream-int, channels, and possibly wake the stream up */
|
||||
/* update the conn-stream, channels, and possibly wake the stream up */
|
||||
cs_notify(cs);
|
||||
stream_release_buffers(__cs_strm(cs));
|
||||
|
||||
|
@ -29,7 +29,6 @@
|
||||
#include <haproxy/proto_tcp.h>
|
||||
#include <haproxy/sample.h>
|
||||
#include <haproxy/session.h>
|
||||
#include <haproxy/stream_interface.h>
|
||||
#include <haproxy/ssl_sock.h>
|
||||
#include <haproxy/tools.h>
|
||||
#include <haproxy/xxhash.h>
|
||||
@ -504,7 +503,7 @@ void conn_free(struct connection *conn)
|
||||
|
||||
/* By convention we always place a NULL where the ctx points to if the
|
||||
* mux is null. It may have been used to store the connection as a
|
||||
* stream_interface's end point for example.
|
||||
* conn-stream's end point for example.
|
||||
*/
|
||||
if (conn->ctx != NULL && conn->mux == NULL)
|
||||
*(void **)conn->ctx = NULL;
|
||||
@ -1169,7 +1168,7 @@ int conn_recv_proxy(struct connection *conn, int flag)
|
||||
* flags (the bit is provided in <flag> by the caller). It is designed to be
|
||||
* called by the connection handler and relies on it to commit polling changes.
|
||||
* Note that it can emit a PROXY line by relying on the other end's address
|
||||
* when the connection is attached to a stream interface, or by resolving the
|
||||
* when the connection is attached to a conn-stream, or by resolving the
|
||||
* local address otherwise (also called a LOCAL line).
|
||||
*/
|
||||
int conn_send_proxy(struct connection *conn, unsigned int flag)
|
||||
@ -1196,7 +1195,7 @@ int conn_send_proxy(struct connection *conn, unsigned int flag)
|
||||
* (which is recomputed every time since it's constant). If
|
||||
* it is positive, it means we have to send from the start.
|
||||
* We can only send a "normal" PROXY line when the connection
|
||||
* is attached to a stream interface. Otherwise we can only
|
||||
* is attached to a conn-stream. Otherwise we can only
|
||||
* send a LOCAL line (eg: for use with health checks).
|
||||
*/
|
||||
|
||||
|
@ -27,6 +27,7 @@
|
||||
#endif
|
||||
|
||||
#include <haproxy/api.h>
|
||||
#include <haproxy/applet.h>
|
||||
#include <haproxy/buf.h>
|
||||
#include <haproxy/cli.h>
|
||||
#include <haproxy/conn_stream.h>
|
||||
|
@ -21,6 +21,7 @@
|
||||
|
||||
#include <haproxy/action.h>
|
||||
#include <haproxy/api.h>
|
||||
#include <haproxy/applet.h>
|
||||
#include <haproxy/cfgparse.h>
|
||||
#include <haproxy/channel.h>
|
||||
#include <haproxy/check.h>
|
||||
@ -34,7 +35,6 @@
|
||||
#include <haproxy/log.h>
|
||||
#include <haproxy/ring.h>
|
||||
#include <haproxy/stream.h>
|
||||
#include <haproxy/stream_interface.h>
|
||||
#include <haproxy/tools.h>
|
||||
|
||||
static THREAD_LOCAL char *dns_msg_trash;
|
||||
|
@ -23,7 +23,6 @@
|
||||
#include <haproxy/namespace.h>
|
||||
#include <haproxy/proxy.h>
|
||||
#include <haproxy/stream.h>
|
||||
#include <haproxy/stream_interface.h>
|
||||
#include <haproxy/tools.h>
|
||||
#include <haproxy/trace.h>
|
||||
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include <errno.h>
|
||||
|
||||
#include <haproxy/acl.h>
|
||||
#include <haproxy/applet.h>
|
||||
#include <haproxy/action-t.h>
|
||||
#include <haproxy/api.h>
|
||||
#include <haproxy/arg.h>
|
||||
@ -34,7 +35,6 @@
|
||||
#include <haproxy/sink.h>
|
||||
#include <haproxy/spoe.h>
|
||||
#include <haproxy/stream.h>
|
||||
#include <haproxy/stream_interface.h>
|
||||
#include <haproxy/task.h>
|
||||
#include <haproxy/tcp_rules.h>
|
||||
#include <haproxy/thread.h>
|
||||
|
@ -37,7 +37,6 @@
|
||||
#include <haproxy/proxy.h>
|
||||
#include <haproxy/sample.h>
|
||||
#include <haproxy/stream.h>
|
||||
#include <haproxy/stream_interface.h>
|
||||
#include <haproxy/task.h>
|
||||
#include <haproxy/ticks.h>
|
||||
#include <haproxy/tools.h>
|
||||
|
@ -59,7 +59,6 @@
|
||||
#include <haproxy/ssl_sock.h>
|
||||
#include <haproxy/stats-t.h>
|
||||
#include <haproxy/stream.h>
|
||||
#include <haproxy/stream_interface.h>
|
||||
#include <haproxy/task.h>
|
||||
#include <haproxy/tcp_rules.h>
|
||||
#include <haproxy/thread.h>
|
||||
@ -2966,7 +2965,7 @@ __LJMP static int hlua_socket_new(lua_State *L)
|
||||
/* Initialise cross reference between stream and Lua socket object. */
|
||||
xref_create(&socket->xref, &appctx->ctx.hlua_cosocket.xref);
|
||||
|
||||
/* Configure "right" stream interface. this "si" is used to connect
|
||||
/* Configure "right" conn-stream. this "si" is used to connect
|
||||
* and retrieve data from the server. The connection is initialized
|
||||
* with the "struct server".
|
||||
*/
|
||||
|
@ -35,7 +35,6 @@
|
||||
#include <haproxy/pool.h>
|
||||
#include <haproxy/regex.h>
|
||||
#include <haproxy/sample.h>
|
||||
#include <haproxy/stream_interface.h>
|
||||
#include <haproxy/tools.h>
|
||||
#include <haproxy/uri_auth-t.h>
|
||||
#include <haproxy/uri_normalizer.h>
|
||||
|
@ -35,7 +35,6 @@
|
||||
#include <haproxy/server-t.h>
|
||||
#include <haproxy/stats.h>
|
||||
#include <haproxy/stream.h>
|
||||
#include <haproxy/stream_interface.h>
|
||||
#include <haproxy/trace.h>
|
||||
#include <haproxy/uri_auth-t.h>
|
||||
#include <haproxy/vars.h>
|
||||
|
@ -31,7 +31,6 @@
|
||||
#include <haproxy/proxy.h>
|
||||
#include <haproxy/server.h>
|
||||
#include <haproxy/ssl_sock-t.h>
|
||||
#include <haproxy/stream_interface.h>
|
||||
#include <haproxy/tools.h>
|
||||
|
||||
#include <string.h>
|
||||
|
@ -36,7 +36,6 @@
|
||||
#include <haproxy/pool.h>
|
||||
#include <haproxy/sample.h>
|
||||
#include <haproxy/stream.h>
|
||||
#include <haproxy/stream_interface.h>
|
||||
#include <haproxy/tools.h>
|
||||
#include <haproxy/version.h>
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
#include <sys/uio.h>
|
||||
|
||||
#include <haproxy/api.h>
|
||||
#include <haproxy/applet-t.h>
|
||||
#include <haproxy/applet.h>
|
||||
#include <haproxy/cfgparse.h>
|
||||
#include <haproxy/clock.h>
|
||||
#include <haproxy/conn_stream.h>
|
||||
@ -42,7 +42,6 @@
|
||||
#include <haproxy/sink.h>
|
||||
#include <haproxy/ssl_sock.h>
|
||||
#include <haproxy/stream.h>
|
||||
#include <haproxy/stream_interface.h>
|
||||
#include <haproxy/time.h>
|
||||
#include <haproxy/tools.h>
|
||||
|
||||
|
@ -24,7 +24,6 @@
|
||||
#include <haproxy/regex.h>
|
||||
#include <haproxy/sample.h>
|
||||
#include <haproxy/stats-t.h>
|
||||
#include <haproxy/stream_interface.h>
|
||||
#include <haproxy/tools.h>
|
||||
|
||||
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include <haproxy/connection.h>
|
||||
#include <haproxy/conn_stream.h>
|
||||
#include <haproxy/cs_utils.h>
|
||||
#include <haproxy/dynbuf.h>
|
||||
#include <haproxy/errors.h>
|
||||
#include <haproxy/fcgi-app.h>
|
||||
#include <haproxy/fcgi.h>
|
||||
@ -33,7 +34,6 @@
|
||||
#include <haproxy/regex.h>
|
||||
#include <haproxy/session-t.h>
|
||||
#include <haproxy/stream.h>
|
||||
#include <haproxy/stream_interface.h>
|
||||
#include <haproxy/trace.h>
|
||||
#include <haproxy/version.h>
|
||||
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include <haproxy/cfgparse.h>
|
||||
#include <haproxy/connection.h>
|
||||
#include <haproxy/conn_stream.h>
|
||||
#include <haproxy/dynbuf.h>
|
||||
#include <haproxy/h1.h>
|
||||
#include <haproxy/h1_htx.h>
|
||||
#include <haproxy/h2.h>
|
||||
@ -28,7 +29,6 @@
|
||||
#include <haproxy/session-t.h>
|
||||
#include <haproxy/stats.h>
|
||||
#include <haproxy/stream.h>
|
||||
#include <haproxy/stream_interface.h>
|
||||
#include <haproxy/trace.h>
|
||||
|
||||
/*
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include <haproxy/cfgparse.h>
|
||||
#include <haproxy/connection.h>
|
||||
#include <haproxy/conn_stream.h>
|
||||
#include <haproxy/dynbuf.h>
|
||||
#include <haproxy/h2.h>
|
||||
#include <haproxy/hpack-dec.h>
|
||||
#include <haproxy/hpack-enc.h>
|
||||
@ -28,7 +29,6 @@
|
||||
#include <haproxy/session-t.h>
|
||||
#include <haproxy/stats.h>
|
||||
#include <haproxy/stream.h>
|
||||
#include <haproxy/stream_interface.h>
|
||||
#include <haproxy/trace.h>
|
||||
|
||||
|
||||
|
@ -38,7 +38,6 @@
|
||||
#include <haproxy/proxy.h>
|
||||
#include <haproxy/signal.h>
|
||||
#include <haproxy/stream.h>
|
||||
#include <haproxy/stream_interface.h>
|
||||
#include <haproxy/tools.h>
|
||||
#include <haproxy/version.h>
|
||||
|
||||
|
@ -43,7 +43,6 @@
|
||||
#include <haproxy/stats-t.h>
|
||||
#include <haproxy/stick_table.h>
|
||||
#include <haproxy/stream.h>
|
||||
#include <haproxy/stream_interface.h>
|
||||
#include <haproxy/task.h>
|
||||
#include <haproxy/thread.h>
|
||||
#include <haproxy/time.h>
|
||||
|
@ -26,7 +26,6 @@
|
||||
#include <haproxy/list.h>
|
||||
#include <haproxy/pool.h>
|
||||
#include <haproxy/stats-t.h>
|
||||
#include <haproxy/stream_interface.h>
|
||||
#include <haproxy/thread.h>
|
||||
#include <haproxy/tools.h>
|
||||
|
||||
@ -1000,7 +999,7 @@ int pool_parse_debugging(const char *str, char **err)
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* This function dumps memory usage information onto the stream interface's
|
||||
/* This function dumps memory usage information onto the conn-stream's
|
||||
* read buffer. It returns 0 as long as it does not complete, non-zero upon
|
||||
* completion. No state is used.
|
||||
*/
|
||||
|
@ -46,7 +46,6 @@
|
||||
#include <haproxy/signal.h>
|
||||
#include <haproxy/stats-t.h>
|
||||
#include <haproxy/stream.h>
|
||||
#include <haproxy/stream_interface.h>
|
||||
#include <haproxy/task.h>
|
||||
#include <haproxy/tcpcheck.h>
|
||||
#include <haproxy/time.h>
|
||||
@ -3074,7 +3073,7 @@ static int cli_parse_show_errors(char **args, char *payload, struct appctx *appc
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* This function dumps all captured errors onto the stream interface's
|
||||
/* This function dumps all captured errors onto the conn-stream's
|
||||
* read buffer. It returns 0 if the output buffer is full and it needs
|
||||
* to be called again, otherwise non-zero.
|
||||
*/
|
||||
|
@ -78,7 +78,6 @@ s * queue's lock.
|
||||
#include <haproxy/sample.h>
|
||||
#include <haproxy/server-t.h>
|
||||
#include <haproxy/stream.h>
|
||||
#include <haproxy/stream_interface.h>
|
||||
#include <haproxy/task.h>
|
||||
#include <haproxy/tcp_rules.h>
|
||||
#include <haproxy/thread.h>
|
||||
|
@ -29,7 +29,6 @@
|
||||
#include <haproxy/freq_ctr.h>
|
||||
#include <haproxy/global.h>
|
||||
#include <haproxy/pipe.h>
|
||||
#include <haproxy/stream_interface.h>
|
||||
#include <haproxy/tools.h>
|
||||
|
||||
|
||||
|
@ -42,7 +42,6 @@
|
||||
#include <haproxy/sample.h>
|
||||
#include <haproxy/server.h>
|
||||
#include <haproxy/stats.h>
|
||||
#include <haproxy/stream_interface.h>
|
||||
#include <haproxy/task.h>
|
||||
#include <haproxy/tcp_rules.h>
|
||||
#include <haproxy/ticks.h>
|
||||
|
@ -26,7 +26,6 @@
|
||||
#include <haproxy/conn_stream.h>
|
||||
#include <haproxy/cs_utils.h>
|
||||
#include <haproxy/ring.h>
|
||||
#include <haproxy/stream_interface.h>
|
||||
#include <haproxy/thread.h>
|
||||
|
||||
/* Initialize a pre-allocated ring with the buffer area
|
||||
|
@ -42,7 +42,6 @@
|
||||
#include <haproxy/server.h>
|
||||
#include <haproxy/stats.h>
|
||||
#include <haproxy/stream.h>
|
||||
#include <haproxy/stream_interface.h>
|
||||
#include <haproxy/task.h>
|
||||
#include <haproxy/tcpcheck.h>
|
||||
#include <haproxy/time.h>
|
||||
|
@ -20,6 +20,7 @@
|
||||
|
||||
#include <import/ist.h>
|
||||
#include <haproxy/api.h>
|
||||
#include <haproxy/applet.h>
|
||||
#include <haproxy/cfgparse.h>
|
||||
#include <haproxy/cli.h>
|
||||
#include <haproxy/conn_stream.h>
|
||||
@ -31,7 +32,6 @@
|
||||
#include <haproxy/ring.h>
|
||||
#include <haproxy/signal.h>
|
||||
#include <haproxy/sink.h>
|
||||
#include <haproxy/stream_interface.h>
|
||||
#include <haproxy/time.h>
|
||||
#include <haproxy/tools.h>
|
||||
|
||||
|
@ -35,7 +35,6 @@
|
||||
#include <haproxy/ssl_ckch.h>
|
||||
#include <haproxy/ssl_sock.h>
|
||||
#include <haproxy/ssl_utils.h>
|
||||
#include <haproxy/stream_interface.h>
|
||||
#include <haproxy/tools.h>
|
||||
|
||||
/* Uncommitted CKCH transaction */
|
||||
|
@ -28,7 +28,6 @@
|
||||
#include <haproxy/ssl_ckch.h>
|
||||
#include <haproxy/ssl_crtlist.h>
|
||||
#include <haproxy/ssl_sock.h>
|
||||
#include <haproxy/stream_interface.h>
|
||||
#include <haproxy/tools.h>
|
||||
|
||||
|
||||
|
@ -74,7 +74,6 @@
|
||||
#include <haproxy/sample.h>
|
||||
#include <haproxy/stats.h>
|
||||
#include <haproxy/stream-t.h>
|
||||
#include <haproxy/stream_interface.h>
|
||||
#include <haproxy/task.h>
|
||||
#include <haproxy/ticks.h>
|
||||
#include <haproxy/time.h>
|
||||
|
@ -60,7 +60,6 @@
|
||||
#include <haproxy/session.h>
|
||||
#include <haproxy/stats.h>
|
||||
#include <haproxy/stream.h>
|
||||
#include <haproxy/stream_interface.h>
|
||||
#include <haproxy/task.h>
|
||||
#include <haproxy/ticks.h>
|
||||
#include <haproxy/time.h>
|
||||
@ -4260,7 +4259,7 @@ static int stats_send_http_redirect(struct conn_stream *cs, struct htx *htx)
|
||||
}
|
||||
|
||||
|
||||
/* This I/O handler runs as an applet embedded in a stream interface. It is
|
||||
/* This I/O handler runs as an applet embedded in a conn-stream. It is
|
||||
* used to send HTTP stats over a TCP socket. The mechanism is very simple.
|
||||
* appctx->st0 contains the operation in progress (dump, done). The handler
|
||||
* automatically unregisters itself once transfer is complete.
|
||||
@ -4556,7 +4555,7 @@ static int stats_dump_info_to_buffer(struct conn_stream *cs)
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* This function dumps the schema onto the stream interface's read buffer.
|
||||
/* This function dumps the schema onto the conn-stream's read buffer.
|
||||
* It returns 0 as long as it does not complete, non-zero upon completion.
|
||||
* No state is used.
|
||||
*
|
||||
@ -4766,7 +4765,7 @@ static void stats_dump_json_schema(struct buffer *out)
|
||||
}
|
||||
}
|
||||
|
||||
/* This function dumps the schema onto the stream interface's read buffer.
|
||||
/* This function dumps the schema onto the conn-stream's read buffer.
|
||||
* It returns 0 as long as it does not complete, non-zero upon completion.
|
||||
* No state is used.
|
||||
*/
|
||||
|
@ -39,7 +39,6 @@
|
||||
#include <haproxy/stats-t.h>
|
||||
#include <haproxy/stick_table.h>
|
||||
#include <haproxy/stream.h>
|
||||
#include <haproxy/stream_interface.h>
|
||||
#include <haproxy/task.h>
|
||||
#include <haproxy/tcp_rules.h>
|
||||
#include <haproxy/ticks.h>
|
||||
@ -4234,7 +4233,7 @@ enum {
|
||||
STK_CLI_ACT_SHOW,
|
||||
};
|
||||
|
||||
/* Dump the status of a table to a stream interface's
|
||||
/* Dump the status of a table to a conn-stream's
|
||||
* read buffer. It returns 0 if the output buffer is full
|
||||
* and needs to be called again, otherwise non-zero.
|
||||
*/
|
||||
@ -4260,7 +4259,7 @@ static int table_dump_head_to_buffer(struct buffer *msg,
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Dump a table entry to a stream interface's
|
||||
/* Dump a table entry to a conn-stream's
|
||||
* read buffer. It returns 0 if the output buffer is full
|
||||
* and needs to be called again, otherwise non-zero.
|
||||
*/
|
||||
|
24
src/stream.c
24
src/stream.c
@ -55,7 +55,6 @@
|
||||
#include <haproxy/stats-t.h>
|
||||
#include <haproxy/stick_table.h>
|
||||
#include <haproxy/stream.h>
|
||||
#include <haproxy/stream_interface.h>
|
||||
#include <haproxy/task.h>
|
||||
#include <haproxy/tcp_rules.h>
|
||||
#include <haproxy/thread.h>
|
||||
@ -81,7 +80,7 @@ static void strm_trace(enum trace_level level, uint64_t mask,
|
||||
|
||||
/* The event representation is split like this :
|
||||
* strm - stream
|
||||
* si - stream interface
|
||||
* cs - conn-stream
|
||||
* http - http analyzis
|
||||
* tcp - tcp analyzis
|
||||
*
|
||||
@ -118,7 +117,7 @@ static const struct name_desc strm_trace_decoding[] = {
|
||||
#define STRM_VERB_CLEAN 1
|
||||
{ .name="clean", .desc="only user-friendly stuff, generally suitable for level \"user\"" },
|
||||
#define STRM_VERB_MINIMAL 2
|
||||
{ .name="minimal", .desc="report info on stream and stream-interfaces" },
|
||||
{ .name="minimal", .desc="report info on stream and conn-streams" },
|
||||
#define STRM_VERB_SIMPLE 3
|
||||
{ .name="simple", .desc="add info on request and response channels" },
|
||||
#define STRM_VERB_ADVANCED 4
|
||||
@ -173,7 +172,7 @@ static void strm_trace(enum trace_level level, uint64_t mask, const struct trace
|
||||
b_putist(&trace_buf, s->unique_id);
|
||||
}
|
||||
|
||||
/* Front and back stream-int state */
|
||||
/* Front and back conn-stream state */
|
||||
chunk_appendf(&trace_buf, " CS=(%s,%s)",
|
||||
cs_state_str(s->csf->state), cs_state_str(s->csb->state));
|
||||
|
||||
@ -305,7 +304,7 @@ int stream_upgrade_from_cs(struct conn_stream *cs, struct buffer *input)
|
||||
}
|
||||
|
||||
/* Callback used to wake up a stream when an input buffer is available. The
|
||||
* stream <s>'s stream interfaces are checked for a failed buffer allocation
|
||||
* stream <s>'s conn-streams are checked for a failed buffer allocation
|
||||
* as indicated by the presence of the CS_EP_RXBLK_ROOM flag and the lack of a
|
||||
* buffer, and and input buffer is assigned there (at most one). The function
|
||||
* returns 1 and wakes the stream up if a buffer was taken, otherwise zero.
|
||||
@ -715,7 +714,6 @@ static void stream_free(struct stream *s)
|
||||
/* FIXME: Handle it in appctx_free ??? */
|
||||
must_free_sess = objt_appctx(sess->origin) && sess->origin == __cs_endp_target(s->csf);
|
||||
|
||||
/* FIXME: ATTENTION, si CSF est libere avant, ca plante !!!! */
|
||||
cs_detach_endp(s->csb);
|
||||
cs_detach_endp(s->csf);
|
||||
cs_detach_app(s->csb);
|
||||
@ -1555,7 +1553,7 @@ static void stream_update_both_cs(struct stream *s)
|
||||
if (cs_state_in(csb->state, CS_SB_RDY|CS_SB_EST))
|
||||
cs_update(csb);
|
||||
|
||||
/* stream ints are processed outside of process_stream() and must be
|
||||
/* conn-streams are processed outside of process_stream() and must be
|
||||
* handled at the latest moment.
|
||||
*/
|
||||
if (cs_appctx(csf)) {
|
||||
@ -1683,12 +1681,12 @@ struct task *process_stream(struct task *t, void *context, unsigned int state)
|
||||
s->pending_events |= (state & TASK_WOKEN_ANY);
|
||||
|
||||
/* 1a: Check for low level timeouts if needed. We just set a flag on
|
||||
* stream interfaces when their timeouts have expired.
|
||||
* conn-streams when their timeouts have expired.
|
||||
*/
|
||||
if (unlikely(s->pending_events & TASK_WOKEN_TIMER)) {
|
||||
stream_check_conn_timeout(s);
|
||||
|
||||
/* check channel timeouts, and close the corresponding stream interfaces
|
||||
/* check channel timeouts, and close the corresponding conn-streams
|
||||
* for future reads or writes. Note: this will also concern upper layers
|
||||
* but we do not touch any other flag. We must be careful and correctly
|
||||
* detect state changes when calling them.
|
||||
@ -1762,7 +1760,7 @@ struct task *process_stream(struct task *t, void *context, unsigned int state)
|
||||
sess_set_term_flags(s);
|
||||
}
|
||||
|
||||
/* 1b: check for low-level errors reported at the stream interface.
|
||||
/* 1b: check for low-level errors reported at the conn-stream.
|
||||
* First we check if it's a retryable error (in which case we don't
|
||||
* want to tell the buffer). Otherwise we report the error one level
|
||||
* upper by setting flags into the buffers. Note that the side towards
|
||||
@ -2121,7 +2119,7 @@ struct task *process_stream(struct task *t, void *context, unsigned int state)
|
||||
sess_set_term_flags(s);
|
||||
|
||||
/* Abort the request if a client error occurred while
|
||||
* the backend stream-interface is in the CS_ST_INI
|
||||
* the backend conn-stream is in the CS_ST_INI
|
||||
* state. It is switched into the CS_ST_CLO state and
|
||||
* the request channel is erased. */
|
||||
if (csb->state == CS_ST_INI) {
|
||||
@ -3149,7 +3147,7 @@ void list_services(FILE *out)
|
||||
fprintf(out, " none\n");
|
||||
}
|
||||
|
||||
/* This function dumps a complete stream state onto the stream interface's
|
||||
/* This function dumps a complete stream state onto the conn-stream's
|
||||
* read buffer. The stream has to be set in strm. It returns 0 if the output
|
||||
* buffer is full and it needs to be called again, otherwise non-zero. It is
|
||||
* designed to be called from stats_dump_strm_to_buffer() below.
|
||||
@ -3514,7 +3512,7 @@ static int cli_parse_show_sess(char **args, char *payload, struct appctx *appctx
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* This function dumps all streams' states onto the stream interface's
|
||||
/* This function dumps all streams' states onto the conn-stream's
|
||||
* read buffer. It returns 0 if the output buffer is full and it needs
|
||||
* to be called again, otherwise non-zero. It proceeds in an isolated
|
||||
* thread so there is no thread safety issue here.
|
||||
|
@ -1,73 +0,0 @@
|
||||
/*
|
||||
* Functions managing stream_interface structures
|
||||
*
|
||||
* Copyright 2000-2012 Willy Tarreau <w@1wt.eu>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version
|
||||
* 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <sys/socket.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <haproxy/api.h>
|
||||
#include <haproxy/applet.h>
|
||||
#include <haproxy/channel.h>
|
||||
#include <haproxy/connection.h>
|
||||
#include <haproxy/conn_stream.h>
|
||||
#include <haproxy/cs_utils.h>
|
||||
#include <haproxy/dynbuf.h>
|
||||
#include <haproxy/http_ana.h>
|
||||
#include <haproxy/http_htx.h>
|
||||
#include <haproxy/pipe-t.h>
|
||||
#include <haproxy/pipe.h>
|
||||
#include <haproxy/pool.h>
|
||||
#include <haproxy/proxy.h>
|
||||
#include <haproxy/stream-t.h>
|
||||
#include <haproxy/stream_interface.h>
|
||||
#include <haproxy/task.h>
|
||||
#include <haproxy/ticks.h>
|
||||
#include <haproxy/tools.h>
|
||||
|
||||
|
||||
DECLARE_POOL(pool_head_streaminterface, "stream_interface", sizeof(struct stream_interface));
|
||||
|
||||
struct stream_interface *si_new(struct conn_stream *cs)
|
||||
{
|
||||
struct stream_interface *si;
|
||||
|
||||
si = pool_alloc(pool_head_streaminterface);
|
||||
if (unlikely(!si))
|
||||
return NULL;
|
||||
si->flags = SI_FL_NONE;
|
||||
if (si_init(si) < 0) {
|
||||
pool_free(pool_head_streaminterface, si);
|
||||
return NULL;
|
||||
}
|
||||
si->cs = cs;
|
||||
return si;
|
||||
}
|
||||
|
||||
void si_free(struct stream_interface *si)
|
||||
{
|
||||
if (!si)
|
||||
return;
|
||||
|
||||
pool_free(pool_head_streaminterface, si);
|
||||
}
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* c-indent-level: 8
|
||||
* c-basic-offset: 8
|
||||
* End:
|
||||
*/
|
@ -37,7 +37,6 @@
|
||||
#include <haproxy/proxy-t.h>
|
||||
#include <haproxy/sample.h>
|
||||
#include <haproxy/session.h>
|
||||
#include <haproxy/stream_interface.h>
|
||||
#include <haproxy/tcp_rules.h>
|
||||
#include <haproxy/tools.h>
|
||||
|
||||
|
@ -26,7 +26,6 @@
|
||||
#include <haproxy/sample.h>
|
||||
#include <haproxy/stick_table.h>
|
||||
#include <haproxy/stream-t.h>
|
||||
#include <haproxy/stream_interface.h>
|
||||
#include <haproxy/tcp_rules.h>
|
||||
#include <haproxy/ticks.h>
|
||||
#include <haproxy/tools.h>
|
||||
@ -473,7 +472,7 @@ int tcp_inspect_response(struct stream *s, struct channel *rep, int an_bit)
|
||||
/* This function performs the TCP layer4 analysis on the current request. It
|
||||
* returns 0 if a reject rule matches, otherwise 1 if either an accept rule
|
||||
* matches or if no more rule matches. It can only use rules which don't need
|
||||
* any data. This only works on connection-based client-facing stream interfaces.
|
||||
* any data. This only works on connection-based client-facing conn-streams.
|
||||
*/
|
||||
int tcp_exec_l4_rules(struct session *sess)
|
||||
{
|
||||
@ -570,7 +569,7 @@ int tcp_exec_l4_rules(struct session *sess)
|
||||
/* This function performs the TCP layer5 analysis on the current request. It
|
||||
* returns 0 if a reject rule matches, otherwise 1 if either an accept rule
|
||||
* matches or if no more rule matches. It can only use rules which don't need
|
||||
* any data. This only works on session-based client-facing stream interfaces.
|
||||
* any data. This only works on session-based client-facing conn-streams.
|
||||
* An example of valid use case is to track a stick-counter on the source
|
||||
* address extracted from the proxy protocol.
|
||||
*/
|
||||
|
@ -41,7 +41,6 @@
|
||||
#include <haproxy/proxy-t.h>
|
||||
#include <haproxy/sample.h>
|
||||
#include <haproxy/session.h>
|
||||
#include <haproxy/stream_interface.h>
|
||||
#include <haproxy/tools.h>
|
||||
|
||||
/* Fetch the connection's source IPv4/IPv6 address. Depending on the keyword, it
|
||||
@ -323,7 +322,7 @@ static inline int get_tcp_info(const struct arg *args, struct sample *smp,
|
||||
if (!smp->strm)
|
||||
return 0;
|
||||
|
||||
/* get the object associated with the stream interface.The
|
||||
/* get the object associated with the conn-stream.The
|
||||
* object can be other thing than a connection. For example,
|
||||
* it be a appctx. */
|
||||
conn = (dir == 0 ? cs_conn(smp->strm->csf) : cs_conn(smp->strm->csb));
|
||||
|
@ -51,6 +51,7 @@ extern void *__elf_aux_vector;
|
||||
#include <import/eb32tree.h>
|
||||
|
||||
#include <haproxy/api.h>
|
||||
#include <haproxy/applet.h>
|
||||
#include <haproxy/chunk.h>
|
||||
#include <haproxy/conn_stream.h>
|
||||
#include <haproxy/cs_utils.h>
|
||||
|
@ -50,7 +50,6 @@
|
||||
#include <haproxy/quic_tls.h>
|
||||
#include <haproxy/sink.h>
|
||||
#include <haproxy/ssl_sock.h>
|
||||
#include <haproxy/stream_interface.h>
|
||||
#include <haproxy/task.h>
|
||||
#include <haproxy/trace.h>
|
||||
#include <haproxy/xprt_quic.h>
|
||||
|
Loading…
Reference in New Issue
Block a user