/src/haproxy/include/haproxy/applet.h
Line | Count | Source |
1 | | /* |
2 | | * include/haproxy/applet.h |
3 | | * This file contains applet function prototypes |
4 | | * |
5 | | * Copyright (C) 2000-2015 Willy Tarreau - w@1wt.eu |
6 | | * |
7 | | * This library is free software; you can redistribute it and/or |
8 | | * modify it under the terms of the GNU Lesser General Public |
9 | | * License as published by the Free Software Foundation, version 2.1 |
10 | | * exclusively. |
11 | | * |
12 | | * This library is distributed in the hope that it will be useful, |
13 | | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
15 | | * Lesser General Public License for more details. |
16 | | * |
17 | | * You should have received a copy of the GNU Lesser General Public |
18 | | * License along with this library; if not, write to the Free Software |
19 | | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
20 | | */ |
21 | | |
22 | | #ifndef _HAPROXY_APPLET_H |
23 | | #define _HAPROXY_APPLET_H |
24 | | |
25 | | #include <stdlib.h> |
26 | | |
27 | | #include <haproxy/api.h> |
28 | | #include <haproxy/applet-t.h> |
29 | | #include <haproxy/channel.h> |
30 | | #include <haproxy/list.h> |
31 | | #include <haproxy/pool.h> |
32 | | #include <haproxy/sc_strm.h> |
33 | | #include <haproxy/session.h> |
34 | | #include <haproxy/stconn.h> |
35 | | #include <haproxy/task.h> |
36 | | |
37 | | extern unsigned int nb_applets; |
38 | | extern struct pool_head *pool_head_appctx; |
39 | | |
40 | | struct task *task_run_applet(struct task *t, void *context, unsigned int state); |
41 | | struct task *task_process_applet(struct task *t, void *context, unsigned int state); |
42 | | int appctx_buf_available(void *arg); |
43 | | void *applet_reserve_svcctx(struct appctx *appctx, size_t size); |
44 | | void applet_reset_svcctx(struct appctx *appctx); |
45 | | void appctx_shut(struct appctx *appctx); |
46 | | |
47 | | struct appctx *appctx_new_on(struct applet *applet, struct sedesc *sedesc, int thr); |
48 | | int appctx_finalize_startup(struct appctx *appctx, struct proxy *px, struct buffer *input); |
49 | | void appctx_free_on_early_error(struct appctx *appctx); |
50 | | void appctx_free(struct appctx *appctx); |
51 | | |
52 | | size_t appctx_htx_rcv_buf(struct appctx *appctx, struct buffer *buf, size_t count, unsigned int flags); |
53 | | size_t appctx_raw_rcv_buf(struct appctx *appctx, struct buffer *buf, size_t count, unsigned int flags); |
54 | | size_t appctx_rcv_buf(struct stconn *sc, struct buffer *buf, size_t count, unsigned int flags); |
55 | | |
56 | | size_t appctx_htx_snd_buf(struct appctx *appctx, struct buffer *buf, size_t count, unsigned int flags); |
57 | | size_t appctx_raw_snd_buf(struct appctx *appctx, struct buffer *buf, size_t count, unsigned int flags); |
58 | | size_t appctx_snd_buf(struct stconn *sc, struct buffer *buf, size_t count, unsigned int flags); |
59 | | |
60 | | int appctx_fastfwd(struct stconn *sc, unsigned int count, unsigned int flags); |
61 | | ssize_t applet_append_line(void *ctx, struct ist v1, struct ist v2, size_t ofs, size_t len, char delim); |
62 | | static forceinline void applet_fl_set(struct appctx *appctx, uint on); |
63 | | static forceinline void applet_fl_clr(struct appctx *appctx, uint off); |
64 | | |
65 | | |
66 | | static forceinline uint appctx_app_test(const struct appctx *appctx, uint test) |
67 | 0 | { |
68 | 0 | return (appctx->applet->flags & test); |
69 | 0 | } Unexecuted instantiation: cli.c:appctx_app_test Unexecuted instantiation: debug.c:appctx_app_test Unexecuted instantiation: errors.c:appctx_app_test Unexecuted instantiation: haproxy.c:appctx_app_test Unexecuted instantiation: http_ana.c:appctx_app_test Unexecuted instantiation: log.c:appctx_app_test Unexecuted instantiation: mworker.c:appctx_app_test Unexecuted instantiation: peers.c:appctx_app_test Unexecuted instantiation: pool.c:appctx_app_test Unexecuted instantiation: proxy.c:appctx_app_test Unexecuted instantiation: resolvers.c:appctx_app_test Unexecuted instantiation: ring.c:appctx_app_test Unexecuted instantiation: server.c:appctx_app_test Unexecuted instantiation: sink.c:appctx_app_test Unexecuted instantiation: stats-html.c:appctx_app_test Unexecuted instantiation: stats.c:appctx_app_test Unexecuted instantiation: stconn.c:appctx_app_test Unexecuted instantiation: stick_table.c:appctx_app_test Unexecuted instantiation: stream.c:appctx_app_test Unexecuted instantiation: tools.c:appctx_app_test Unexecuted instantiation: trace.c:appctx_app_test Unexecuted instantiation: vars.c:appctx_app_test Unexecuted instantiation: activity.c:appctx_app_test Unexecuted instantiation: applet.c:appctx_app_test Unexecuted instantiation: dns.c:appctx_app_test Unexecuted instantiation: dns_ring.c:appctx_app_test Unexecuted instantiation: stats-json.c:appctx_app_test Unexecuted instantiation: cache.c:appctx_app_test Unexecuted instantiation: flt_spoe.c:appctx_app_test |
70 | | |
71 | | static inline struct appctx *appctx_new_here(struct applet *applet, struct sedesc *sedesc) |
72 | 0 | { |
73 | 0 | return appctx_new_on(applet, sedesc, tid); |
74 | 0 | } Unexecuted instantiation: cli.c:appctx_new_here Unexecuted instantiation: debug.c:appctx_new_here Unexecuted instantiation: errors.c:appctx_new_here Unexecuted instantiation: haproxy.c:appctx_new_here Unexecuted instantiation: http_ana.c:appctx_new_here Unexecuted instantiation: log.c:appctx_new_here Unexecuted instantiation: mworker.c:appctx_new_here Unexecuted instantiation: peers.c:appctx_new_here Unexecuted instantiation: pool.c:appctx_new_here Unexecuted instantiation: proxy.c:appctx_new_here Unexecuted instantiation: resolvers.c:appctx_new_here Unexecuted instantiation: ring.c:appctx_new_here Unexecuted instantiation: server.c:appctx_new_here Unexecuted instantiation: sink.c:appctx_new_here Unexecuted instantiation: stats-html.c:appctx_new_here Unexecuted instantiation: stats.c:appctx_new_here Unexecuted instantiation: stconn.c:appctx_new_here Unexecuted instantiation: stick_table.c:appctx_new_here Unexecuted instantiation: stream.c:appctx_new_here Unexecuted instantiation: tools.c:appctx_new_here Unexecuted instantiation: trace.c:appctx_new_here Unexecuted instantiation: vars.c:appctx_new_here Unexecuted instantiation: activity.c:appctx_new_here Unexecuted instantiation: applet.c:appctx_new_here Unexecuted instantiation: dns.c:appctx_new_here Unexecuted instantiation: dns_ring.c:appctx_new_here Unexecuted instantiation: stats-json.c:appctx_new_here Unexecuted instantiation: cache.c:appctx_new_here Unexecuted instantiation: flt_spoe.c:appctx_new_here |
75 | | |
76 | | static inline struct appctx *appctx_new_anywhere(struct applet *applet, struct sedesc *sedesc) |
77 | 0 | { |
78 | 0 | return appctx_new_on(applet, sedesc, -1); |
79 | 0 | } Unexecuted instantiation: cli.c:appctx_new_anywhere Unexecuted instantiation: debug.c:appctx_new_anywhere Unexecuted instantiation: errors.c:appctx_new_anywhere Unexecuted instantiation: haproxy.c:appctx_new_anywhere Unexecuted instantiation: http_ana.c:appctx_new_anywhere Unexecuted instantiation: log.c:appctx_new_anywhere Unexecuted instantiation: mworker.c:appctx_new_anywhere Unexecuted instantiation: peers.c:appctx_new_anywhere Unexecuted instantiation: pool.c:appctx_new_anywhere Unexecuted instantiation: proxy.c:appctx_new_anywhere Unexecuted instantiation: resolvers.c:appctx_new_anywhere Unexecuted instantiation: ring.c:appctx_new_anywhere Unexecuted instantiation: server.c:appctx_new_anywhere Unexecuted instantiation: sink.c:appctx_new_anywhere Unexecuted instantiation: stats-html.c:appctx_new_anywhere Unexecuted instantiation: stats.c:appctx_new_anywhere Unexecuted instantiation: stconn.c:appctx_new_anywhere Unexecuted instantiation: stick_table.c:appctx_new_anywhere Unexecuted instantiation: stream.c:appctx_new_anywhere Unexecuted instantiation: tools.c:appctx_new_anywhere Unexecuted instantiation: trace.c:appctx_new_anywhere Unexecuted instantiation: vars.c:appctx_new_anywhere Unexecuted instantiation: activity.c:appctx_new_anywhere Unexecuted instantiation: applet.c:appctx_new_anywhere Unexecuted instantiation: dns.c:appctx_new_anywhere Unexecuted instantiation: dns_ring.c:appctx_new_anywhere Unexecuted instantiation: stats-json.c:appctx_new_anywhere Unexecuted instantiation: cache.c:appctx_new_anywhere Unexecuted instantiation: flt_spoe.c:appctx_new_anywhere |
80 | | |
81 | | |
82 | | /* |
83 | | * Release a buffer, if any, and try to wake up entities waiting in the buffer |
84 | | * wait queue. |
85 | | */ |
86 | | static inline void appctx_release_buf(struct appctx *appctx, struct buffer *bptr) |
87 | 0 | { |
88 | 0 | if (bptr->size) { |
89 | 0 | b_free(bptr); |
90 | 0 | offer_buffers(appctx->buffer_wait.target, 1); |
91 | 0 | } |
92 | 0 | } Unexecuted instantiation: cli.c:appctx_release_buf Unexecuted instantiation: debug.c:appctx_release_buf Unexecuted instantiation: errors.c:appctx_release_buf Unexecuted instantiation: haproxy.c:appctx_release_buf Unexecuted instantiation: http_ana.c:appctx_release_buf Unexecuted instantiation: log.c:appctx_release_buf Unexecuted instantiation: mworker.c:appctx_release_buf Unexecuted instantiation: peers.c:appctx_release_buf Unexecuted instantiation: pool.c:appctx_release_buf Unexecuted instantiation: proxy.c:appctx_release_buf Unexecuted instantiation: resolvers.c:appctx_release_buf Unexecuted instantiation: ring.c:appctx_release_buf Unexecuted instantiation: server.c:appctx_release_buf Unexecuted instantiation: sink.c:appctx_release_buf Unexecuted instantiation: stats-html.c:appctx_release_buf Unexecuted instantiation: stats.c:appctx_release_buf Unexecuted instantiation: stconn.c:appctx_release_buf Unexecuted instantiation: stick_table.c:appctx_release_buf Unexecuted instantiation: stream.c:appctx_release_buf Unexecuted instantiation: tools.c:appctx_release_buf Unexecuted instantiation: trace.c:appctx_release_buf Unexecuted instantiation: vars.c:appctx_release_buf Unexecuted instantiation: activity.c:appctx_release_buf Unexecuted instantiation: applet.c:appctx_release_buf Unexecuted instantiation: dns.c:appctx_release_buf Unexecuted instantiation: dns_ring.c:appctx_release_buf Unexecuted instantiation: stats-json.c:appctx_release_buf Unexecuted instantiation: cache.c:appctx_release_buf Unexecuted instantiation: flt_spoe.c:appctx_release_buf |
93 | | |
94 | | /* |
95 | | * Allocate a buffer. If if fails, it adds the appctx in buffer wait queue and |
96 | | * sets the relevant blocking flag depending on the side (assuming that bptr is |
97 | | * either &appctx->inbuf or &appctx->outbuf). Upon success it will also clear |
98 | | * the equivalent MAYALLOC flags. |
99 | | */ |
100 | | static inline struct buffer *appctx_get_buf(struct appctx *appctx, struct buffer *bptr) |
101 | 0 | { |
102 | 0 | struct buffer *buf = NULL; |
103 | 0 | int is_inbuf = (bptr == &appctx->inbuf); |
104 | |
|
105 | 0 | if (likely(!LIST_INLIST(&appctx->buffer_wait.list))) { |
106 | 0 | if (unlikely((buf = b_alloc(bptr, is_inbuf ? DB_MUX_TX : DB_SE_RX)) == NULL)) { |
107 | 0 | b_queue(is_inbuf ? DB_MUX_TX : DB_SE_RX, &appctx->buffer_wait, appctx, appctx_buf_available); |
108 | 0 | applet_fl_set(appctx, is_inbuf ? APPCTX_FL_INBLK_ALLOC : APPCTX_FL_OUTBLK_ALLOC); |
109 | 0 | } else { |
110 | 0 | applet_fl_clr(appctx, is_inbuf ? APPCTX_FL_IN_MAYALLOC : APPCTX_FL_OUT_MAYALLOC); |
111 | 0 | } |
112 | 0 | } |
113 | 0 | return buf; |
114 | 0 | } Unexecuted instantiation: cli.c:appctx_get_buf Unexecuted instantiation: debug.c:appctx_get_buf Unexecuted instantiation: errors.c:appctx_get_buf Unexecuted instantiation: haproxy.c:appctx_get_buf Unexecuted instantiation: http_ana.c:appctx_get_buf Unexecuted instantiation: log.c:appctx_get_buf Unexecuted instantiation: mworker.c:appctx_get_buf Unexecuted instantiation: peers.c:appctx_get_buf Unexecuted instantiation: pool.c:appctx_get_buf Unexecuted instantiation: proxy.c:appctx_get_buf Unexecuted instantiation: resolvers.c:appctx_get_buf Unexecuted instantiation: ring.c:appctx_get_buf Unexecuted instantiation: server.c:appctx_get_buf Unexecuted instantiation: sink.c:appctx_get_buf Unexecuted instantiation: stats-html.c:appctx_get_buf Unexecuted instantiation: stats.c:appctx_get_buf Unexecuted instantiation: stconn.c:appctx_get_buf Unexecuted instantiation: stick_table.c:appctx_get_buf Unexecuted instantiation: stream.c:appctx_get_buf Unexecuted instantiation: tools.c:appctx_get_buf Unexecuted instantiation: trace.c:appctx_get_buf Unexecuted instantiation: vars.c:appctx_get_buf Unexecuted instantiation: activity.c:appctx_get_buf Unexecuted instantiation: applet.c:appctx_get_buf Unexecuted instantiation: dns.c:appctx_get_buf Unexecuted instantiation: dns_ring.c:appctx_get_buf Unexecuted instantiation: stats-json.c:appctx_get_buf Unexecuted instantiation: cache.c:appctx_get_buf Unexecuted instantiation: flt_spoe.c:appctx_get_buf |
115 | | |
116 | | /* Helper function to call .init applet callback function, if it exists. Returns 0 |
117 | | * on success and -1 on error. |
118 | | */ |
119 | | static inline int appctx_init(struct appctx *appctx) |
120 | 0 | { |
121 | | /* Set appctx affinity to the current thread. Because, after this call, |
122 | | * the appctx will be fully initialized. The session and the stream will |
123 | | * eventually be created. The affinity must be set now ! |
124 | | */ |
125 | 0 | BUG_ON(appctx->t->tid != -1 && appctx->t->tid != tid); |
126 | 0 | task_set_thread(appctx->t, tid); |
127 | |
|
128 | 0 | if (appctx->applet->init) |
129 | 0 | return appctx->applet->init(appctx); |
130 | 0 | return 0; |
131 | 0 | } Unexecuted instantiation: cli.c:appctx_init Unexecuted instantiation: debug.c:appctx_init Unexecuted instantiation: errors.c:appctx_init Unexecuted instantiation: haproxy.c:appctx_init Unexecuted instantiation: http_ana.c:appctx_init Unexecuted instantiation: log.c:appctx_init Unexecuted instantiation: mworker.c:appctx_init Unexecuted instantiation: peers.c:appctx_init Unexecuted instantiation: pool.c:appctx_init Unexecuted instantiation: proxy.c:appctx_init Unexecuted instantiation: resolvers.c:appctx_init Unexecuted instantiation: ring.c:appctx_init Unexecuted instantiation: server.c:appctx_init Unexecuted instantiation: sink.c:appctx_init Unexecuted instantiation: stats-html.c:appctx_init Unexecuted instantiation: stats.c:appctx_init Unexecuted instantiation: stconn.c:appctx_init Unexecuted instantiation: stick_table.c:appctx_init Unexecuted instantiation: stream.c:appctx_init Unexecuted instantiation: tools.c:appctx_init Unexecuted instantiation: trace.c:appctx_init Unexecuted instantiation: vars.c:appctx_init Unexecuted instantiation: activity.c:appctx_init Unexecuted instantiation: applet.c:appctx_init Unexecuted instantiation: dns.c:appctx_init Unexecuted instantiation: dns_ring.c:appctx_init Unexecuted instantiation: stats-json.c:appctx_init Unexecuted instantiation: cache.c:appctx_init Unexecuted instantiation: flt_spoe.c:appctx_init |
132 | | |
133 | | /* Releases an appctx previously allocated by appctx_new(). */ |
134 | | static inline void __appctx_free(struct appctx *appctx) |
135 | 0 | { |
136 | 0 | appctx_release_buf(appctx, &appctx->inbuf); |
137 | 0 | appctx_release_buf(appctx, &appctx->outbuf); |
138 | |
|
139 | 0 | task_destroy(appctx->t); |
140 | 0 | b_dequeue(&appctx->buffer_wait); |
141 | 0 | if (appctx->sess) |
142 | 0 | session_free(appctx->sess); |
143 | 0 | BUG_ON(appctx->sedesc && !se_fl_test(appctx->sedesc, SE_FL_ORPHAN)); |
144 | 0 | sedesc_free(appctx->sedesc); |
145 | 0 | pool_free(pool_head_appctx, appctx); |
146 | 0 | _HA_ATOMIC_DEC(&nb_applets); |
147 | 0 | } Unexecuted instantiation: cli.c:__appctx_free Unexecuted instantiation: debug.c:__appctx_free Unexecuted instantiation: errors.c:__appctx_free Unexecuted instantiation: haproxy.c:__appctx_free Unexecuted instantiation: http_ana.c:__appctx_free Unexecuted instantiation: log.c:__appctx_free Unexecuted instantiation: mworker.c:__appctx_free Unexecuted instantiation: peers.c:__appctx_free Unexecuted instantiation: pool.c:__appctx_free Unexecuted instantiation: proxy.c:__appctx_free Unexecuted instantiation: resolvers.c:__appctx_free Unexecuted instantiation: ring.c:__appctx_free Unexecuted instantiation: server.c:__appctx_free Unexecuted instantiation: sink.c:__appctx_free Unexecuted instantiation: stats-html.c:__appctx_free Unexecuted instantiation: stats.c:__appctx_free Unexecuted instantiation: stconn.c:__appctx_free Unexecuted instantiation: stick_table.c:__appctx_free Unexecuted instantiation: stream.c:__appctx_free Unexecuted instantiation: tools.c:__appctx_free Unexecuted instantiation: trace.c:__appctx_free Unexecuted instantiation: vars.c:__appctx_free Unexecuted instantiation: activity.c:__appctx_free Unexecuted instantiation: applet.c:__appctx_free Unexecuted instantiation: dns.c:__appctx_free Unexecuted instantiation: dns_ring.c:__appctx_free Unexecuted instantiation: stats-json.c:__appctx_free Unexecuted instantiation: cache.c:__appctx_free Unexecuted instantiation: flt_spoe.c:__appctx_free |
148 | | |
149 | | /* wakes up an applet when conditions have changed. We're using a macro here in |
150 | | * order to retrieve the caller's place. |
151 | | */ |
152 | | #define appctx_wakeup(ctx) \ |
153 | 0 | _task_wakeup((ctx)->t, TASK_WOKEN_OTHER, MK_CALLER(WAKEUP_TYPE_APPCTX_WAKEUP, 0, 0)) |
154 | | |
155 | | #define appctx_schedule(ctx, w) \ |
156 | 0 | _task_schedule((ctx)->t, w, MK_CALLER(WAKEUP_TYPE_TASK_SCHEDULE, 0, 0)) |
157 | | |
158 | | /* returns the stream connector the appctx is attached to, via the sedesc */ |
159 | | static inline struct stconn *appctx_sc(const struct appctx *appctx) |
160 | 0 | { |
161 | 0 | return appctx->sedesc->sc; |
162 | 0 | } Unexecuted instantiation: cli.c:appctx_sc Unexecuted instantiation: debug.c:appctx_sc Unexecuted instantiation: errors.c:appctx_sc Unexecuted instantiation: haproxy.c:appctx_sc Unexecuted instantiation: http_ana.c:appctx_sc Unexecuted instantiation: log.c:appctx_sc Unexecuted instantiation: mworker.c:appctx_sc Unexecuted instantiation: peers.c:appctx_sc Unexecuted instantiation: pool.c:appctx_sc Unexecuted instantiation: proxy.c:appctx_sc Unexecuted instantiation: resolvers.c:appctx_sc Unexecuted instantiation: ring.c:appctx_sc Unexecuted instantiation: server.c:appctx_sc Unexecuted instantiation: sink.c:appctx_sc Unexecuted instantiation: stats-html.c:appctx_sc Unexecuted instantiation: stats.c:appctx_sc Unexecuted instantiation: stconn.c:appctx_sc Unexecuted instantiation: stick_table.c:appctx_sc Unexecuted instantiation: stream.c:appctx_sc Unexecuted instantiation: tools.c:appctx_sc Unexecuted instantiation: trace.c:appctx_sc Unexecuted instantiation: vars.c:appctx_sc Unexecuted instantiation: activity.c:appctx_sc Unexecuted instantiation: applet.c:appctx_sc Unexecuted instantiation: dns.c:appctx_sc Unexecuted instantiation: dns_ring.c:appctx_sc Unexecuted instantiation: stats-json.c:appctx_sc Unexecuted instantiation: cache.c:appctx_sc Unexecuted instantiation: flt_spoe.c:appctx_sc |
163 | | |
164 | | /* returns the stream the appctx is attached to. Note that a stream *must* |
165 | | * be attached, as we use an unchecked dereference via __sc_strm(). |
166 | | */ |
167 | | static inline struct stream *appctx_strm(const struct appctx *appctx) |
168 | 0 | { |
169 | 0 | return __sc_strm(appctx->sedesc->sc); |
170 | 0 | } Unexecuted instantiation: cli.c:appctx_strm Unexecuted instantiation: debug.c:appctx_strm Unexecuted instantiation: errors.c:appctx_strm Unexecuted instantiation: haproxy.c:appctx_strm Unexecuted instantiation: http_ana.c:appctx_strm Unexecuted instantiation: log.c:appctx_strm Unexecuted instantiation: mworker.c:appctx_strm Unexecuted instantiation: peers.c:appctx_strm Unexecuted instantiation: pool.c:appctx_strm Unexecuted instantiation: proxy.c:appctx_strm Unexecuted instantiation: resolvers.c:appctx_strm Unexecuted instantiation: ring.c:appctx_strm Unexecuted instantiation: server.c:appctx_strm Unexecuted instantiation: sink.c:appctx_strm Unexecuted instantiation: stats-html.c:appctx_strm Unexecuted instantiation: stats.c:appctx_strm Unexecuted instantiation: stconn.c:appctx_strm Unexecuted instantiation: stick_table.c:appctx_strm Unexecuted instantiation: stream.c:appctx_strm Unexecuted instantiation: tools.c:appctx_strm Unexecuted instantiation: trace.c:appctx_strm Unexecuted instantiation: vars.c:appctx_strm Unexecuted instantiation: activity.c:appctx_strm Unexecuted instantiation: applet.c:appctx_strm Unexecuted instantiation: dns.c:appctx_strm Unexecuted instantiation: dns_ring.c:appctx_strm Unexecuted instantiation: stats-json.c:appctx_strm Unexecuted instantiation: cache.c:appctx_strm Unexecuted instantiation: flt_spoe.c:appctx_strm |
171 | | |
172 | | /* returns 1 if the appctx is attached on the backend side or 0 if it is |
173 | | * attached on the frontend side. Note that only frontend appctx may have no SC. |
174 | | */ |
175 | | static inline int appctx_is_back(const struct appctx *appctx) |
176 | 0 | { |
177 | 0 | struct stconn *sc = appctx_sc(appctx); |
178 | |
|
179 | 0 | return !!(sc && (sc->flags & SC_FL_ISBACK)); |
180 | 0 | } Unexecuted instantiation: cli.c:appctx_is_back Unexecuted instantiation: debug.c:appctx_is_back Unexecuted instantiation: errors.c:appctx_is_back Unexecuted instantiation: haproxy.c:appctx_is_back Unexecuted instantiation: http_ana.c:appctx_is_back Unexecuted instantiation: log.c:appctx_is_back Unexecuted instantiation: mworker.c:appctx_is_back Unexecuted instantiation: peers.c:appctx_is_back Unexecuted instantiation: pool.c:appctx_is_back Unexecuted instantiation: proxy.c:appctx_is_back Unexecuted instantiation: resolvers.c:appctx_is_back Unexecuted instantiation: ring.c:appctx_is_back Unexecuted instantiation: server.c:appctx_is_back Unexecuted instantiation: sink.c:appctx_is_back Unexecuted instantiation: stats-html.c:appctx_is_back Unexecuted instantiation: stats.c:appctx_is_back Unexecuted instantiation: stconn.c:appctx_is_back Unexecuted instantiation: stick_table.c:appctx_is_back Unexecuted instantiation: stream.c:appctx_is_back Unexecuted instantiation: tools.c:appctx_is_back Unexecuted instantiation: trace.c:appctx_is_back Unexecuted instantiation: vars.c:appctx_is_back Unexecuted instantiation: activity.c:appctx_is_back Unexecuted instantiation: applet.c:appctx_is_back Unexecuted instantiation: dns.c:appctx_is_back Unexecuted instantiation: dns_ring.c:appctx_is_back Unexecuted instantiation: stats-json.c:appctx_is_back Unexecuted instantiation: cache.c:appctx_is_back Unexecuted instantiation: flt_spoe.c:appctx_is_back |
181 | | |
182 | | static forceinline void applet_fl_zero(struct appctx *appctx) |
183 | 0 | { |
184 | 0 | appctx->flags = 0; |
185 | 0 | } Unexecuted instantiation: cli.c:applet_fl_zero Unexecuted instantiation: debug.c:applet_fl_zero Unexecuted instantiation: errors.c:applet_fl_zero Unexecuted instantiation: haproxy.c:applet_fl_zero Unexecuted instantiation: http_ana.c:applet_fl_zero Unexecuted instantiation: log.c:applet_fl_zero Unexecuted instantiation: mworker.c:applet_fl_zero Unexecuted instantiation: peers.c:applet_fl_zero Unexecuted instantiation: pool.c:applet_fl_zero Unexecuted instantiation: proxy.c:applet_fl_zero Unexecuted instantiation: resolvers.c:applet_fl_zero Unexecuted instantiation: ring.c:applet_fl_zero Unexecuted instantiation: server.c:applet_fl_zero Unexecuted instantiation: sink.c:applet_fl_zero Unexecuted instantiation: stats-html.c:applet_fl_zero Unexecuted instantiation: stats.c:applet_fl_zero Unexecuted instantiation: stconn.c:applet_fl_zero Unexecuted instantiation: stick_table.c:applet_fl_zero Unexecuted instantiation: stream.c:applet_fl_zero Unexecuted instantiation: tools.c:applet_fl_zero Unexecuted instantiation: trace.c:applet_fl_zero Unexecuted instantiation: vars.c:applet_fl_zero Unexecuted instantiation: activity.c:applet_fl_zero Unexecuted instantiation: applet.c:applet_fl_zero Unexecuted instantiation: dns.c:applet_fl_zero Unexecuted instantiation: dns_ring.c:applet_fl_zero Unexecuted instantiation: stats-json.c:applet_fl_zero Unexecuted instantiation: cache.c:applet_fl_zero Unexecuted instantiation: flt_spoe.c:applet_fl_zero |
186 | | |
187 | | static forceinline void applet_fl_setall(struct appctx *appctx, uint all) |
188 | 0 | { |
189 | 0 | appctx->flags = all; |
190 | 0 | } Unexecuted instantiation: cli.c:applet_fl_setall Unexecuted instantiation: debug.c:applet_fl_setall Unexecuted instantiation: errors.c:applet_fl_setall Unexecuted instantiation: haproxy.c:applet_fl_setall Unexecuted instantiation: http_ana.c:applet_fl_setall Unexecuted instantiation: log.c:applet_fl_setall Unexecuted instantiation: mworker.c:applet_fl_setall Unexecuted instantiation: peers.c:applet_fl_setall Unexecuted instantiation: pool.c:applet_fl_setall Unexecuted instantiation: proxy.c:applet_fl_setall Unexecuted instantiation: resolvers.c:applet_fl_setall Unexecuted instantiation: ring.c:applet_fl_setall Unexecuted instantiation: server.c:applet_fl_setall Unexecuted instantiation: sink.c:applet_fl_setall Unexecuted instantiation: stats-html.c:applet_fl_setall Unexecuted instantiation: stats.c:applet_fl_setall Unexecuted instantiation: stconn.c:applet_fl_setall Unexecuted instantiation: stick_table.c:applet_fl_setall Unexecuted instantiation: stream.c:applet_fl_setall Unexecuted instantiation: tools.c:applet_fl_setall Unexecuted instantiation: trace.c:applet_fl_setall Unexecuted instantiation: vars.c:applet_fl_setall Unexecuted instantiation: activity.c:applet_fl_setall Unexecuted instantiation: applet.c:applet_fl_setall Unexecuted instantiation: dns.c:applet_fl_setall Unexecuted instantiation: dns_ring.c:applet_fl_setall Unexecuted instantiation: stats-json.c:applet_fl_setall Unexecuted instantiation: cache.c:applet_fl_setall Unexecuted instantiation: flt_spoe.c:applet_fl_setall |
191 | | |
192 | | static forceinline void applet_fl_set(struct appctx *appctx, uint on) |
193 | 0 | { |
194 | 0 | if (((on & (APPCTX_FL_EOS|APPCTX_FL_EOI)) && appctx->flags & APPCTX_FL_ERR_PENDING) || |
195 | 0 | ((on & APPCTX_FL_ERR_PENDING) && appctx->flags & (APPCTX_FL_EOI|APPCTX_FL_EOS))) |
196 | 0 | on |= APPCTX_FL_ERROR; |
197 | 0 | appctx->flags |= on; |
198 | 0 | } Unexecuted instantiation: cli.c:applet_fl_set Unexecuted instantiation: debug.c:applet_fl_set Unexecuted instantiation: errors.c:applet_fl_set Unexecuted instantiation: haproxy.c:applet_fl_set Unexecuted instantiation: http_ana.c:applet_fl_set Unexecuted instantiation: log.c:applet_fl_set Unexecuted instantiation: mworker.c:applet_fl_set Unexecuted instantiation: peers.c:applet_fl_set Unexecuted instantiation: pool.c:applet_fl_set Unexecuted instantiation: proxy.c:applet_fl_set Unexecuted instantiation: resolvers.c:applet_fl_set Unexecuted instantiation: ring.c:applet_fl_set Unexecuted instantiation: server.c:applet_fl_set Unexecuted instantiation: sink.c:applet_fl_set Unexecuted instantiation: stats-html.c:applet_fl_set Unexecuted instantiation: stats.c:applet_fl_set Unexecuted instantiation: stconn.c:applet_fl_set Unexecuted instantiation: stick_table.c:applet_fl_set Unexecuted instantiation: stream.c:applet_fl_set Unexecuted instantiation: tools.c:applet_fl_set Unexecuted instantiation: trace.c:applet_fl_set Unexecuted instantiation: vars.c:applet_fl_set Unexecuted instantiation: activity.c:applet_fl_set Unexecuted instantiation: applet.c:applet_fl_set Unexecuted instantiation: dns.c:applet_fl_set Unexecuted instantiation: dns_ring.c:applet_fl_set Unexecuted instantiation: stats-json.c:applet_fl_set Unexecuted instantiation: cache.c:applet_fl_set Unexecuted instantiation: flt_spoe.c:applet_fl_set |
199 | | |
200 | | static forceinline void applet_fl_clr(struct appctx *appctx, uint off) |
201 | 0 | { |
202 | 0 | appctx->flags &= ~off; |
203 | 0 | } Unexecuted instantiation: cli.c:applet_fl_clr Unexecuted instantiation: debug.c:applet_fl_clr Unexecuted instantiation: errors.c:applet_fl_clr Unexecuted instantiation: haproxy.c:applet_fl_clr Unexecuted instantiation: http_ana.c:applet_fl_clr Unexecuted instantiation: log.c:applet_fl_clr Unexecuted instantiation: mworker.c:applet_fl_clr Unexecuted instantiation: peers.c:applet_fl_clr Unexecuted instantiation: pool.c:applet_fl_clr Unexecuted instantiation: proxy.c:applet_fl_clr Unexecuted instantiation: resolvers.c:applet_fl_clr Unexecuted instantiation: ring.c:applet_fl_clr Unexecuted instantiation: server.c:applet_fl_clr Unexecuted instantiation: sink.c:applet_fl_clr Unexecuted instantiation: stats-html.c:applet_fl_clr Unexecuted instantiation: stats.c:applet_fl_clr Unexecuted instantiation: stconn.c:applet_fl_clr Unexecuted instantiation: stick_table.c:applet_fl_clr Unexecuted instantiation: stream.c:applet_fl_clr Unexecuted instantiation: tools.c:applet_fl_clr Unexecuted instantiation: trace.c:applet_fl_clr Unexecuted instantiation: vars.c:applet_fl_clr Unexecuted instantiation: activity.c:applet_fl_clr Unexecuted instantiation: applet.c:applet_fl_clr Unexecuted instantiation: dns.c:applet_fl_clr Unexecuted instantiation: dns_ring.c:applet_fl_clr Unexecuted instantiation: stats-json.c:applet_fl_clr Unexecuted instantiation: cache.c:applet_fl_clr Unexecuted instantiation: flt_spoe.c:applet_fl_clr |
204 | | |
205 | | static forceinline uint applet_fl_test(const struct appctx *appctx, uint test) |
206 | 0 | { |
207 | 0 | return !!(appctx->flags & test); |
208 | 0 | } Unexecuted instantiation: cli.c:applet_fl_test Unexecuted instantiation: debug.c:applet_fl_test Unexecuted instantiation: errors.c:applet_fl_test Unexecuted instantiation: haproxy.c:applet_fl_test Unexecuted instantiation: http_ana.c:applet_fl_test Unexecuted instantiation: log.c:applet_fl_test Unexecuted instantiation: mworker.c:applet_fl_test Unexecuted instantiation: peers.c:applet_fl_test Unexecuted instantiation: pool.c:applet_fl_test Unexecuted instantiation: proxy.c:applet_fl_test Unexecuted instantiation: resolvers.c:applet_fl_test Unexecuted instantiation: ring.c:applet_fl_test Unexecuted instantiation: server.c:applet_fl_test Unexecuted instantiation: sink.c:applet_fl_test Unexecuted instantiation: stats-html.c:applet_fl_test Unexecuted instantiation: stats.c:applet_fl_test Unexecuted instantiation: stconn.c:applet_fl_test Unexecuted instantiation: stick_table.c:applet_fl_test Unexecuted instantiation: stream.c:applet_fl_test Unexecuted instantiation: tools.c:applet_fl_test Unexecuted instantiation: trace.c:applet_fl_test Unexecuted instantiation: vars.c:applet_fl_test Unexecuted instantiation: activity.c:applet_fl_test Unexecuted instantiation: applet.c:applet_fl_test Unexecuted instantiation: dns.c:applet_fl_test Unexecuted instantiation: dns_ring.c:applet_fl_test Unexecuted instantiation: stats-json.c:applet_fl_test Unexecuted instantiation: cache.c:applet_fl_test Unexecuted instantiation: flt_spoe.c:applet_fl_test |
209 | | |
210 | | static forceinline uint applet_fl_get(const struct appctx *appctx) |
211 | 0 | { |
212 | 0 | return appctx->flags; |
213 | 0 | } Unexecuted instantiation: cli.c:applet_fl_get Unexecuted instantiation: debug.c:applet_fl_get Unexecuted instantiation: errors.c:applet_fl_get Unexecuted instantiation: haproxy.c:applet_fl_get Unexecuted instantiation: http_ana.c:applet_fl_get Unexecuted instantiation: log.c:applet_fl_get Unexecuted instantiation: mworker.c:applet_fl_get Unexecuted instantiation: peers.c:applet_fl_get Unexecuted instantiation: pool.c:applet_fl_get Unexecuted instantiation: proxy.c:applet_fl_get Unexecuted instantiation: resolvers.c:applet_fl_get Unexecuted instantiation: ring.c:applet_fl_get Unexecuted instantiation: server.c:applet_fl_get Unexecuted instantiation: sink.c:applet_fl_get Unexecuted instantiation: stats-html.c:applet_fl_get Unexecuted instantiation: stats.c:applet_fl_get Unexecuted instantiation: stconn.c:applet_fl_get Unexecuted instantiation: stick_table.c:applet_fl_get Unexecuted instantiation: stream.c:applet_fl_get Unexecuted instantiation: tools.c:applet_fl_get Unexecuted instantiation: trace.c:applet_fl_get Unexecuted instantiation: vars.c:applet_fl_get Unexecuted instantiation: activity.c:applet_fl_get Unexecuted instantiation: applet.c:applet_fl_get Unexecuted instantiation: dns.c:applet_fl_get Unexecuted instantiation: dns_ring.c:applet_fl_get Unexecuted instantiation: stats-json.c:applet_fl_get Unexecuted instantiation: cache.c:applet_fl_get Unexecuted instantiation: flt_spoe.c:applet_fl_get |
214 | | |
215 | | static inline void applet_set_eoi(struct appctx *appctx) |
216 | 0 | { |
217 | 0 | applet_fl_set(appctx, APPCTX_FL_EOI); |
218 | 0 | } Unexecuted instantiation: cli.c:applet_set_eoi Unexecuted instantiation: debug.c:applet_set_eoi Unexecuted instantiation: errors.c:applet_set_eoi Unexecuted instantiation: haproxy.c:applet_set_eoi Unexecuted instantiation: http_ana.c:applet_set_eoi Unexecuted instantiation: log.c:applet_set_eoi Unexecuted instantiation: mworker.c:applet_set_eoi Unexecuted instantiation: peers.c:applet_set_eoi Unexecuted instantiation: pool.c:applet_set_eoi Unexecuted instantiation: proxy.c:applet_set_eoi Unexecuted instantiation: resolvers.c:applet_set_eoi Unexecuted instantiation: ring.c:applet_set_eoi Unexecuted instantiation: server.c:applet_set_eoi Unexecuted instantiation: sink.c:applet_set_eoi Unexecuted instantiation: stats-html.c:applet_set_eoi Unexecuted instantiation: stats.c:applet_set_eoi Unexecuted instantiation: stconn.c:applet_set_eoi Unexecuted instantiation: stick_table.c:applet_set_eoi Unexecuted instantiation: stream.c:applet_set_eoi Unexecuted instantiation: tools.c:applet_set_eoi Unexecuted instantiation: trace.c:applet_set_eoi Unexecuted instantiation: vars.c:applet_set_eoi Unexecuted instantiation: activity.c:applet_set_eoi Unexecuted instantiation: applet.c:applet_set_eoi Unexecuted instantiation: dns.c:applet_set_eoi Unexecuted instantiation: dns_ring.c:applet_set_eoi Unexecuted instantiation: stats-json.c:applet_set_eoi Unexecuted instantiation: cache.c:applet_set_eoi Unexecuted instantiation: flt_spoe.c:applet_set_eoi |
219 | | |
220 | | static inline void applet_set_eos(struct appctx *appctx) |
221 | 0 | { |
222 | 0 | applet_fl_set(appctx, APPCTX_FL_EOS); |
223 | 0 | } Unexecuted instantiation: cli.c:applet_set_eos Unexecuted instantiation: debug.c:applet_set_eos Unexecuted instantiation: errors.c:applet_set_eos Unexecuted instantiation: haproxy.c:applet_set_eos Unexecuted instantiation: http_ana.c:applet_set_eos Unexecuted instantiation: log.c:applet_set_eos Unexecuted instantiation: mworker.c:applet_set_eos Unexecuted instantiation: peers.c:applet_set_eos Unexecuted instantiation: pool.c:applet_set_eos Unexecuted instantiation: proxy.c:applet_set_eos Unexecuted instantiation: resolvers.c:applet_set_eos Unexecuted instantiation: ring.c:applet_set_eos Unexecuted instantiation: server.c:applet_set_eos Unexecuted instantiation: sink.c:applet_set_eos Unexecuted instantiation: stats-html.c:applet_set_eos Unexecuted instantiation: stats.c:applet_set_eos Unexecuted instantiation: stconn.c:applet_set_eos Unexecuted instantiation: stick_table.c:applet_set_eos Unexecuted instantiation: stream.c:applet_set_eos Unexecuted instantiation: tools.c:applet_set_eos Unexecuted instantiation: trace.c:applet_set_eos Unexecuted instantiation: vars.c:applet_set_eos Unexecuted instantiation: activity.c:applet_set_eos Unexecuted instantiation: applet.c:applet_set_eos Unexecuted instantiation: dns.c:applet_set_eos Unexecuted instantiation: dns_ring.c:applet_set_eos Unexecuted instantiation: stats-json.c:applet_set_eos Unexecuted instantiation: cache.c:applet_set_eos Unexecuted instantiation: flt_spoe.c:applet_set_eos |
224 | | |
225 | | static inline void applet_set_error(struct appctx *appctx) |
226 | 0 | { |
227 | 0 | if (applet_fl_test(appctx, (APPCTX_FL_EOS|APPCTX_FL_EOI))) |
228 | 0 | applet_fl_set(appctx, APPCTX_FL_ERROR); |
229 | 0 | else |
230 | 0 | applet_fl_set(appctx, APPCTX_FL_ERR_PENDING); |
231 | 0 | } Unexecuted instantiation: cli.c:applet_set_error Unexecuted instantiation: debug.c:applet_set_error Unexecuted instantiation: errors.c:applet_set_error Unexecuted instantiation: haproxy.c:applet_set_error Unexecuted instantiation: http_ana.c:applet_set_error Unexecuted instantiation: log.c:applet_set_error Unexecuted instantiation: mworker.c:applet_set_error Unexecuted instantiation: peers.c:applet_set_error Unexecuted instantiation: pool.c:applet_set_error Unexecuted instantiation: proxy.c:applet_set_error Unexecuted instantiation: resolvers.c:applet_set_error Unexecuted instantiation: ring.c:applet_set_error Unexecuted instantiation: server.c:applet_set_error Unexecuted instantiation: sink.c:applet_set_error Unexecuted instantiation: stats-html.c:applet_set_error Unexecuted instantiation: stats.c:applet_set_error Unexecuted instantiation: stconn.c:applet_set_error Unexecuted instantiation: stick_table.c:applet_set_error Unexecuted instantiation: stream.c:applet_set_error Unexecuted instantiation: tools.c:applet_set_error Unexecuted instantiation: trace.c:applet_set_error Unexecuted instantiation: vars.c:applet_set_error Unexecuted instantiation: activity.c:applet_set_error Unexecuted instantiation: applet.c:applet_set_error Unexecuted instantiation: dns.c:applet_set_error Unexecuted instantiation: dns_ring.c:applet_set_error Unexecuted instantiation: stats-json.c:applet_set_error Unexecuted instantiation: cache.c:applet_set_error Unexecuted instantiation: flt_spoe.c:applet_set_error |
232 | | |
233 | | /* The applet announces it has more data to deliver to the stream's input |
234 | | * buffer. |
235 | | */ |
236 | | static inline void applet_have_more_data(struct appctx *appctx) |
237 | 0 | { |
238 | 0 | se_fl_clr(appctx->sedesc, SE_FL_HAVE_NO_DATA); |
239 | 0 | } Unexecuted instantiation: cli.c:applet_have_more_data Unexecuted instantiation: debug.c:applet_have_more_data Unexecuted instantiation: errors.c:applet_have_more_data Unexecuted instantiation: haproxy.c:applet_have_more_data Unexecuted instantiation: http_ana.c:applet_have_more_data Unexecuted instantiation: log.c:applet_have_more_data Unexecuted instantiation: mworker.c:applet_have_more_data Unexecuted instantiation: peers.c:applet_have_more_data Unexecuted instantiation: pool.c:applet_have_more_data Unexecuted instantiation: proxy.c:applet_have_more_data Unexecuted instantiation: resolvers.c:applet_have_more_data Unexecuted instantiation: ring.c:applet_have_more_data Unexecuted instantiation: server.c:applet_have_more_data Unexecuted instantiation: sink.c:applet_have_more_data Unexecuted instantiation: stats-html.c:applet_have_more_data Unexecuted instantiation: stats.c:applet_have_more_data Unexecuted instantiation: stconn.c:applet_have_more_data Unexecuted instantiation: stick_table.c:applet_have_more_data Unexecuted instantiation: stream.c:applet_have_more_data Unexecuted instantiation: tools.c:applet_have_more_data Unexecuted instantiation: trace.c:applet_have_more_data Unexecuted instantiation: vars.c:applet_have_more_data Unexecuted instantiation: activity.c:applet_have_more_data Unexecuted instantiation: applet.c:applet_have_more_data Unexecuted instantiation: dns.c:applet_have_more_data Unexecuted instantiation: dns_ring.c:applet_have_more_data Unexecuted instantiation: stats-json.c:applet_have_more_data Unexecuted instantiation: cache.c:applet_have_more_data Unexecuted instantiation: flt_spoe.c:applet_have_more_data |
240 | | |
241 | | /* The applet announces it doesn't have more data for the stream's input |
242 | | * buffer. |
243 | | */ |
244 | | static inline void applet_have_no_more_data(struct appctx *appctx) |
245 | 0 | { |
246 | 0 | se_fl_set(appctx->sedesc, SE_FL_HAVE_NO_DATA); |
247 | 0 | } Unexecuted instantiation: cli.c:applet_have_no_more_data Unexecuted instantiation: debug.c:applet_have_no_more_data Unexecuted instantiation: errors.c:applet_have_no_more_data Unexecuted instantiation: haproxy.c:applet_have_no_more_data Unexecuted instantiation: http_ana.c:applet_have_no_more_data Unexecuted instantiation: log.c:applet_have_no_more_data Unexecuted instantiation: mworker.c:applet_have_no_more_data Unexecuted instantiation: peers.c:applet_have_no_more_data Unexecuted instantiation: pool.c:applet_have_no_more_data Unexecuted instantiation: proxy.c:applet_have_no_more_data Unexecuted instantiation: resolvers.c:applet_have_no_more_data Unexecuted instantiation: ring.c:applet_have_no_more_data Unexecuted instantiation: server.c:applet_have_no_more_data Unexecuted instantiation: sink.c:applet_have_no_more_data Unexecuted instantiation: stats-html.c:applet_have_no_more_data Unexecuted instantiation: stats.c:applet_have_no_more_data Unexecuted instantiation: stconn.c:applet_have_no_more_data Unexecuted instantiation: stick_table.c:applet_have_no_more_data Unexecuted instantiation: stream.c:applet_have_no_more_data Unexecuted instantiation: tools.c:applet_have_no_more_data Unexecuted instantiation: trace.c:applet_have_no_more_data Unexecuted instantiation: vars.c:applet_have_no_more_data Unexecuted instantiation: activity.c:applet_have_no_more_data Unexecuted instantiation: applet.c:applet_have_no_more_data Unexecuted instantiation: dns.c:applet_have_no_more_data Unexecuted instantiation: dns_ring.c:applet_have_no_more_data Unexecuted instantiation: stats-json.c:applet_have_no_more_data Unexecuted instantiation: cache.c:applet_have_no_more_data Unexecuted instantiation: flt_spoe.c:applet_have_no_more_data |
248 | | |
249 | | /* The applet indicates that it's ready to consume data from the stream's |
250 | | * output buffer. Rely on the corresponding SE function |
251 | | */ |
252 | | static inline void applet_will_consume(struct appctx *appctx) |
253 | 0 | { |
254 | 0 | se_will_consume(appctx->sedesc); |
255 | 0 | } Unexecuted instantiation: cli.c:applet_will_consume Unexecuted instantiation: debug.c:applet_will_consume Unexecuted instantiation: errors.c:applet_will_consume Unexecuted instantiation: haproxy.c:applet_will_consume Unexecuted instantiation: http_ana.c:applet_will_consume Unexecuted instantiation: log.c:applet_will_consume Unexecuted instantiation: mworker.c:applet_will_consume Unexecuted instantiation: peers.c:applet_will_consume Unexecuted instantiation: pool.c:applet_will_consume Unexecuted instantiation: proxy.c:applet_will_consume Unexecuted instantiation: resolvers.c:applet_will_consume Unexecuted instantiation: ring.c:applet_will_consume Unexecuted instantiation: server.c:applet_will_consume Unexecuted instantiation: sink.c:applet_will_consume Unexecuted instantiation: stats-html.c:applet_will_consume Unexecuted instantiation: stats.c:applet_will_consume Unexecuted instantiation: stconn.c:applet_will_consume Unexecuted instantiation: stick_table.c:applet_will_consume Unexecuted instantiation: stream.c:applet_will_consume Unexecuted instantiation: tools.c:applet_will_consume Unexecuted instantiation: trace.c:applet_will_consume Unexecuted instantiation: vars.c:applet_will_consume Unexecuted instantiation: activity.c:applet_will_consume Unexecuted instantiation: applet.c:applet_will_consume Unexecuted instantiation: dns.c:applet_will_consume Unexecuted instantiation: dns_ring.c:applet_will_consume Unexecuted instantiation: stats-json.c:applet_will_consume Unexecuted instantiation: cache.c:applet_will_consume Unexecuted instantiation: flt_spoe.c:applet_will_consume |
256 | | |
257 | | /* The applet indicates that it's not willing to consume data from the stream's |
258 | | * output buffer. Rely on the corresponding SE function |
259 | | */ |
260 | | static inline void applet_wont_consume(struct appctx *appctx) |
261 | 0 | { |
262 | 0 | se_wont_consume(appctx->sedesc); |
263 | 0 | } Unexecuted instantiation: cli.c:applet_wont_consume Unexecuted instantiation: debug.c:applet_wont_consume Unexecuted instantiation: errors.c:applet_wont_consume Unexecuted instantiation: haproxy.c:applet_wont_consume Unexecuted instantiation: http_ana.c:applet_wont_consume Unexecuted instantiation: log.c:applet_wont_consume Unexecuted instantiation: mworker.c:applet_wont_consume Unexecuted instantiation: peers.c:applet_wont_consume Unexecuted instantiation: pool.c:applet_wont_consume Unexecuted instantiation: proxy.c:applet_wont_consume Unexecuted instantiation: resolvers.c:applet_wont_consume Unexecuted instantiation: ring.c:applet_wont_consume Unexecuted instantiation: server.c:applet_wont_consume Unexecuted instantiation: sink.c:applet_wont_consume Unexecuted instantiation: stats-html.c:applet_wont_consume Unexecuted instantiation: stats.c:applet_wont_consume Unexecuted instantiation: stconn.c:applet_wont_consume Unexecuted instantiation: stick_table.c:applet_wont_consume Unexecuted instantiation: stream.c:applet_wont_consume Unexecuted instantiation: tools.c:applet_wont_consume Unexecuted instantiation: trace.c:applet_wont_consume Unexecuted instantiation: vars.c:applet_wont_consume Unexecuted instantiation: activity.c:applet_wont_consume Unexecuted instantiation: applet.c:applet_wont_consume Unexecuted instantiation: dns.c:applet_wont_consume Unexecuted instantiation: dns_ring.c:applet_wont_consume Unexecuted instantiation: stats-json.c:applet_wont_consume Unexecuted instantiation: cache.c:applet_wont_consume Unexecuted instantiation: flt_spoe.c:applet_wont_consume |
264 | | |
265 | | /* The applet indicates that it's willing to consume data from the stream's |
266 | | * output buffer, but that there's not enough, so it doesn't want to be woken |
267 | | * up until more are presented. Rely on the corresponding SE function |
268 | | */ |
269 | | static inline void applet_need_more_data(struct appctx *appctx) |
270 | 0 | { |
271 | 0 | se_need_more_data(appctx->sedesc); |
272 | 0 | } Unexecuted instantiation: cli.c:applet_need_more_data Unexecuted instantiation: debug.c:applet_need_more_data Unexecuted instantiation: errors.c:applet_need_more_data Unexecuted instantiation: haproxy.c:applet_need_more_data Unexecuted instantiation: http_ana.c:applet_need_more_data Unexecuted instantiation: log.c:applet_need_more_data Unexecuted instantiation: mworker.c:applet_need_more_data Unexecuted instantiation: peers.c:applet_need_more_data Unexecuted instantiation: pool.c:applet_need_more_data Unexecuted instantiation: proxy.c:applet_need_more_data Unexecuted instantiation: resolvers.c:applet_need_more_data Unexecuted instantiation: ring.c:applet_need_more_data Unexecuted instantiation: server.c:applet_need_more_data Unexecuted instantiation: sink.c:applet_need_more_data Unexecuted instantiation: stats-html.c:applet_need_more_data Unexecuted instantiation: stats.c:applet_need_more_data Unexecuted instantiation: stconn.c:applet_need_more_data Unexecuted instantiation: stick_table.c:applet_need_more_data Unexecuted instantiation: stream.c:applet_need_more_data Unexecuted instantiation: tools.c:applet_need_more_data Unexecuted instantiation: trace.c:applet_need_more_data Unexecuted instantiation: vars.c:applet_need_more_data Unexecuted instantiation: activity.c:applet_need_more_data Unexecuted instantiation: applet.c:applet_need_more_data Unexecuted instantiation: dns.c:applet_need_more_data Unexecuted instantiation: dns_ring.c:applet_need_more_data Unexecuted instantiation: stats-json.c:applet_need_more_data Unexecuted instantiation: cache.c:applet_need_more_data Unexecuted instantiation: flt_spoe.c:applet_need_more_data |
273 | | |
274 | | /* The applet indicates that it does not expect data from the opposite endpoint. |
275 | | * This way the stream know it should not trigger read timeout on the other |
276 | | * side. |
277 | | */ |
278 | | static inline void applet_expect_no_data(struct appctx *appctx) |
279 | 0 | { |
280 | 0 | se_fl_set(appctx->sedesc, SE_FL_EXP_NO_DATA); |
281 | 0 | } Unexecuted instantiation: cli.c:applet_expect_no_data Unexecuted instantiation: debug.c:applet_expect_no_data Unexecuted instantiation: errors.c:applet_expect_no_data Unexecuted instantiation: haproxy.c:applet_expect_no_data Unexecuted instantiation: http_ana.c:applet_expect_no_data Unexecuted instantiation: log.c:applet_expect_no_data Unexecuted instantiation: mworker.c:applet_expect_no_data Unexecuted instantiation: peers.c:applet_expect_no_data Unexecuted instantiation: pool.c:applet_expect_no_data Unexecuted instantiation: proxy.c:applet_expect_no_data Unexecuted instantiation: resolvers.c:applet_expect_no_data Unexecuted instantiation: ring.c:applet_expect_no_data Unexecuted instantiation: server.c:applet_expect_no_data Unexecuted instantiation: sink.c:applet_expect_no_data Unexecuted instantiation: stats-html.c:applet_expect_no_data Unexecuted instantiation: stats.c:applet_expect_no_data Unexecuted instantiation: stconn.c:applet_expect_no_data Unexecuted instantiation: stick_table.c:applet_expect_no_data Unexecuted instantiation: stream.c:applet_expect_no_data Unexecuted instantiation: tools.c:applet_expect_no_data Unexecuted instantiation: trace.c:applet_expect_no_data Unexecuted instantiation: vars.c:applet_expect_no_data Unexecuted instantiation: activity.c:applet_expect_no_data Unexecuted instantiation: applet.c:applet_expect_no_data Unexecuted instantiation: dns.c:applet_expect_no_data Unexecuted instantiation: dns_ring.c:applet_expect_no_data Unexecuted instantiation: stats-json.c:applet_expect_no_data Unexecuted instantiation: cache.c:applet_expect_no_data Unexecuted instantiation: flt_spoe.c:applet_expect_no_data |
282 | | |
283 | | /* The applet indicates that it expects data from the opposite endpoint. This |
284 | | * way the stream know it may trigger read timeout on the other side. |
285 | | */ |
286 | | static inline void applet_expect_data(struct appctx *appctx) |
287 | 0 | { |
288 | 0 | se_fl_clr(appctx->sedesc, SE_FL_EXP_NO_DATA); |
289 | 0 | } Unexecuted instantiation: cli.c:applet_expect_data Unexecuted instantiation: debug.c:applet_expect_data Unexecuted instantiation: errors.c:applet_expect_data Unexecuted instantiation: haproxy.c:applet_expect_data Unexecuted instantiation: http_ana.c:applet_expect_data Unexecuted instantiation: log.c:applet_expect_data Unexecuted instantiation: mworker.c:applet_expect_data Unexecuted instantiation: peers.c:applet_expect_data Unexecuted instantiation: pool.c:applet_expect_data Unexecuted instantiation: proxy.c:applet_expect_data Unexecuted instantiation: resolvers.c:applet_expect_data Unexecuted instantiation: ring.c:applet_expect_data Unexecuted instantiation: server.c:applet_expect_data Unexecuted instantiation: sink.c:applet_expect_data Unexecuted instantiation: stats-html.c:applet_expect_data Unexecuted instantiation: stats.c:applet_expect_data Unexecuted instantiation: stconn.c:applet_expect_data Unexecuted instantiation: stick_table.c:applet_expect_data Unexecuted instantiation: stream.c:applet_expect_data Unexecuted instantiation: tools.c:applet_expect_data Unexecuted instantiation: trace.c:applet_expect_data Unexecuted instantiation: vars.c:applet_expect_data Unexecuted instantiation: activity.c:applet_expect_data Unexecuted instantiation: applet.c:applet_expect_data Unexecuted instantiation: dns.c:applet_expect_data Unexecuted instantiation: dns_ring.c:applet_expect_data Unexecuted instantiation: stats-json.c:applet_expect_data Unexecuted instantiation: cache.c:applet_expect_data Unexecuted instantiation: flt_spoe.c:applet_expect_data |
290 | | |
291 | | /* Returns the buffer containing data pushed to the applet by the stream. For |
292 | | * applets using its own buffers it is the appctx input buffer. For legacy |
293 | | * applet, it is the output channel buffer. |
294 | | */ |
295 | | static inline struct buffer *applet_get_inbuf(struct appctx *appctx) |
296 | 0 | { |
297 | 0 | if (appctx_app_test(appctx, APPLET_FL_NEW_API)) { |
298 | 0 | if (applet_fl_test(appctx, APPCTX_FL_INBLK_ALLOC) || !appctx_get_buf(appctx, &appctx->inbuf)) |
299 | 0 | return NULL; |
300 | 0 | return &appctx->inbuf; |
301 | 0 | } |
302 | 0 | else |
303 | 0 | return sc_ob(appctx_sc(appctx)); |
304 | 0 | } Unexecuted instantiation: cli.c:applet_get_inbuf Unexecuted instantiation: debug.c:applet_get_inbuf Unexecuted instantiation: errors.c:applet_get_inbuf Unexecuted instantiation: haproxy.c:applet_get_inbuf Unexecuted instantiation: http_ana.c:applet_get_inbuf Unexecuted instantiation: log.c:applet_get_inbuf Unexecuted instantiation: mworker.c:applet_get_inbuf Unexecuted instantiation: peers.c:applet_get_inbuf Unexecuted instantiation: pool.c:applet_get_inbuf Unexecuted instantiation: proxy.c:applet_get_inbuf Unexecuted instantiation: resolvers.c:applet_get_inbuf Unexecuted instantiation: ring.c:applet_get_inbuf Unexecuted instantiation: server.c:applet_get_inbuf Unexecuted instantiation: sink.c:applet_get_inbuf Unexecuted instantiation: stats-html.c:applet_get_inbuf Unexecuted instantiation: stats.c:applet_get_inbuf Unexecuted instantiation: stconn.c:applet_get_inbuf Unexecuted instantiation: stick_table.c:applet_get_inbuf Unexecuted instantiation: stream.c:applet_get_inbuf Unexecuted instantiation: tools.c:applet_get_inbuf Unexecuted instantiation: trace.c:applet_get_inbuf Unexecuted instantiation: vars.c:applet_get_inbuf Unexecuted instantiation: activity.c:applet_get_inbuf Unexecuted instantiation: applet.c:applet_get_inbuf Unexecuted instantiation: dns.c:applet_get_inbuf Unexecuted instantiation: dns_ring.c:applet_get_inbuf Unexecuted instantiation: stats-json.c:applet_get_inbuf Unexecuted instantiation: cache.c:applet_get_inbuf Unexecuted instantiation: flt_spoe.c:applet_get_inbuf |
305 | | |
306 | | /* Returns the buffer containing data pushed by the applets to the stream. For |
307 | | * applets using its own buffer it is the appctx output buffer. For legacy |
308 | | * applet, it is the input channel buffer. |
309 | | */ |
310 | | static inline struct buffer *applet_get_outbuf(struct appctx *appctx) |
311 | 0 | { |
312 | 0 | if (appctx_app_test(appctx, APPLET_FL_NEW_API)) { |
313 | 0 | if (applet_fl_test(appctx, APPCTX_FL_OUTBLK_ALLOC|APPCTX_FL_OUTBLK_FULL) || |
314 | 0 | !appctx_get_buf(appctx, &appctx->outbuf)) |
315 | 0 | return NULL; |
316 | 0 | return &appctx->outbuf; |
317 | 0 | } |
318 | 0 | else |
319 | 0 | return sc_ib(appctx_sc(appctx)); |
320 | 0 | } Unexecuted instantiation: cli.c:applet_get_outbuf Unexecuted instantiation: debug.c:applet_get_outbuf Unexecuted instantiation: errors.c:applet_get_outbuf Unexecuted instantiation: haproxy.c:applet_get_outbuf Unexecuted instantiation: http_ana.c:applet_get_outbuf Unexecuted instantiation: log.c:applet_get_outbuf Unexecuted instantiation: mworker.c:applet_get_outbuf Unexecuted instantiation: peers.c:applet_get_outbuf Unexecuted instantiation: pool.c:applet_get_outbuf Unexecuted instantiation: proxy.c:applet_get_outbuf Unexecuted instantiation: resolvers.c:applet_get_outbuf Unexecuted instantiation: ring.c:applet_get_outbuf Unexecuted instantiation: server.c:applet_get_outbuf Unexecuted instantiation: sink.c:applet_get_outbuf Unexecuted instantiation: stats-html.c:applet_get_outbuf Unexecuted instantiation: stats.c:applet_get_outbuf Unexecuted instantiation: stconn.c:applet_get_outbuf Unexecuted instantiation: stick_table.c:applet_get_outbuf Unexecuted instantiation: stream.c:applet_get_outbuf Unexecuted instantiation: tools.c:applet_get_outbuf Unexecuted instantiation: trace.c:applet_get_outbuf Unexecuted instantiation: vars.c:applet_get_outbuf Unexecuted instantiation: activity.c:applet_get_outbuf Unexecuted instantiation: applet.c:applet_get_outbuf Unexecuted instantiation: dns.c:applet_get_outbuf Unexecuted instantiation: dns_ring.c:applet_get_outbuf Unexecuted instantiation: stats-json.c:applet_get_outbuf Unexecuted instantiation: cache.c:applet_get_outbuf Unexecuted instantiation: flt_spoe.c:applet_get_outbuf |
321 | | |
322 | | /* Returns the amount of HTX data in the input buffer (see applet_get_inbuf) */ |
323 | | static inline size_t applet_htx_input_data(const struct appctx *appctx) |
324 | 0 | { |
325 | 0 | if (appctx_app_test(appctx, APPLET_FL_NEW_API)) |
326 | 0 | return htx_used_space(htxbuf(&appctx->inbuf)); |
327 | 0 | else |
328 | 0 | return co_data(sc_oc(appctx_sc(appctx))); |
329 | 0 | } Unexecuted instantiation: cli.c:applet_htx_input_data Unexecuted instantiation: debug.c:applet_htx_input_data Unexecuted instantiation: errors.c:applet_htx_input_data Unexecuted instantiation: haproxy.c:applet_htx_input_data Unexecuted instantiation: http_ana.c:applet_htx_input_data Unexecuted instantiation: log.c:applet_htx_input_data Unexecuted instantiation: mworker.c:applet_htx_input_data Unexecuted instantiation: peers.c:applet_htx_input_data Unexecuted instantiation: pool.c:applet_htx_input_data Unexecuted instantiation: proxy.c:applet_htx_input_data Unexecuted instantiation: resolvers.c:applet_htx_input_data Unexecuted instantiation: ring.c:applet_htx_input_data Unexecuted instantiation: server.c:applet_htx_input_data Unexecuted instantiation: sink.c:applet_htx_input_data Unexecuted instantiation: stats-html.c:applet_htx_input_data Unexecuted instantiation: stats.c:applet_htx_input_data Unexecuted instantiation: stconn.c:applet_htx_input_data Unexecuted instantiation: stick_table.c:applet_htx_input_data Unexecuted instantiation: stream.c:applet_htx_input_data Unexecuted instantiation: tools.c:applet_htx_input_data Unexecuted instantiation: trace.c:applet_htx_input_data Unexecuted instantiation: vars.c:applet_htx_input_data Unexecuted instantiation: activity.c:applet_htx_input_data Unexecuted instantiation: applet.c:applet_htx_input_data Unexecuted instantiation: dns.c:applet_htx_input_data Unexecuted instantiation: dns_ring.c:applet_htx_input_data Unexecuted instantiation: stats-json.c:applet_htx_input_data Unexecuted instantiation: cache.c:applet_htx_input_data Unexecuted instantiation: flt_spoe.c:applet_htx_input_data |
330 | | |
331 | | /* Returns the amount of data in the input buffer (see applet_get_inbuf) */ |
332 | | static inline size_t applet_input_data(const struct appctx *appctx) |
333 | 0 | { |
334 | 0 | if (appctx_app_test(appctx, APPLET_FL_HTX)) |
335 | 0 | return applet_htx_input_data(appctx); |
336 | | |
337 | 0 | if (appctx_app_test(appctx, APPLET_FL_NEW_API)) |
338 | 0 | return b_data(&appctx->inbuf); |
339 | 0 | else |
340 | 0 | return co_data(sc_oc(appctx_sc(appctx))); |
341 | 0 | } Unexecuted instantiation: cli.c:applet_input_data Unexecuted instantiation: debug.c:applet_input_data Unexecuted instantiation: errors.c:applet_input_data Unexecuted instantiation: haproxy.c:applet_input_data Unexecuted instantiation: http_ana.c:applet_input_data Unexecuted instantiation: log.c:applet_input_data Unexecuted instantiation: mworker.c:applet_input_data Unexecuted instantiation: peers.c:applet_input_data Unexecuted instantiation: pool.c:applet_input_data Unexecuted instantiation: proxy.c:applet_input_data Unexecuted instantiation: resolvers.c:applet_input_data Unexecuted instantiation: ring.c:applet_input_data Unexecuted instantiation: server.c:applet_input_data Unexecuted instantiation: sink.c:applet_input_data Unexecuted instantiation: stats-html.c:applet_input_data Unexecuted instantiation: stats.c:applet_input_data Unexecuted instantiation: stconn.c:applet_input_data Unexecuted instantiation: stick_table.c:applet_input_data Unexecuted instantiation: stream.c:applet_input_data Unexecuted instantiation: tools.c:applet_input_data Unexecuted instantiation: trace.c:applet_input_data Unexecuted instantiation: vars.c:applet_input_data Unexecuted instantiation: activity.c:applet_input_data Unexecuted instantiation: applet.c:applet_input_data Unexecuted instantiation: dns.c:applet_input_data Unexecuted instantiation: dns_ring.c:applet_input_data Unexecuted instantiation: stats-json.c:applet_input_data Unexecuted instantiation: cache.c:applet_input_data Unexecuted instantiation: flt_spoe.c:applet_input_data |
342 | | |
343 | | /* Returns the amount of HTX data in the output buffer (see applet_get_outbuf) */ |
344 | | static inline size_t applet_htx_output_data(const struct appctx *appctx) |
345 | 0 | { |
346 | 0 | if (appctx_app_test(appctx, APPLET_FL_NEW_API)) |
347 | 0 | return htx_used_space(htxbuf(&appctx->outbuf)); |
348 | 0 | else |
349 | 0 | return ci_data(sc_ic(appctx_sc(appctx))); |
350 | 0 | } Unexecuted instantiation: cli.c:applet_htx_output_data Unexecuted instantiation: debug.c:applet_htx_output_data Unexecuted instantiation: errors.c:applet_htx_output_data Unexecuted instantiation: haproxy.c:applet_htx_output_data Unexecuted instantiation: http_ana.c:applet_htx_output_data Unexecuted instantiation: log.c:applet_htx_output_data Unexecuted instantiation: mworker.c:applet_htx_output_data Unexecuted instantiation: peers.c:applet_htx_output_data Unexecuted instantiation: pool.c:applet_htx_output_data Unexecuted instantiation: proxy.c:applet_htx_output_data Unexecuted instantiation: resolvers.c:applet_htx_output_data Unexecuted instantiation: ring.c:applet_htx_output_data Unexecuted instantiation: server.c:applet_htx_output_data Unexecuted instantiation: sink.c:applet_htx_output_data Unexecuted instantiation: stats-html.c:applet_htx_output_data Unexecuted instantiation: stats.c:applet_htx_output_data Unexecuted instantiation: stconn.c:applet_htx_output_data Unexecuted instantiation: stick_table.c:applet_htx_output_data Unexecuted instantiation: stream.c:applet_htx_output_data Unexecuted instantiation: tools.c:applet_htx_output_data Unexecuted instantiation: trace.c:applet_htx_output_data Unexecuted instantiation: vars.c:applet_htx_output_data Unexecuted instantiation: activity.c:applet_htx_output_data Unexecuted instantiation: applet.c:applet_htx_output_data Unexecuted instantiation: dns.c:applet_htx_output_data Unexecuted instantiation: dns_ring.c:applet_htx_output_data Unexecuted instantiation: stats-json.c:applet_htx_output_data Unexecuted instantiation: cache.c:applet_htx_output_data Unexecuted instantiation: flt_spoe.c:applet_htx_output_data |
351 | | |
352 | | /* Returns the amount of data in the output buffer (see applet_get_outbuf) */ |
353 | | static inline size_t applet_output_data(const struct appctx *appctx) |
354 | 0 | { |
355 | 0 | if (appctx_app_test(appctx, APPLET_FL_HTX)) |
356 | 0 | return applet_htx_output_data(appctx); |
357 | | |
358 | 0 | if (appctx_app_test(appctx, APPLET_FL_NEW_API)) |
359 | 0 | return b_data(&appctx->outbuf); |
360 | 0 | else |
361 | 0 | return ci_data(sc_ic(appctx_sc(appctx))); |
362 | 0 | } Unexecuted instantiation: cli.c:applet_output_data Unexecuted instantiation: debug.c:applet_output_data Unexecuted instantiation: errors.c:applet_output_data Unexecuted instantiation: haproxy.c:applet_output_data Unexecuted instantiation: http_ana.c:applet_output_data Unexecuted instantiation: log.c:applet_output_data Unexecuted instantiation: mworker.c:applet_output_data Unexecuted instantiation: peers.c:applet_output_data Unexecuted instantiation: pool.c:applet_output_data Unexecuted instantiation: proxy.c:applet_output_data Unexecuted instantiation: resolvers.c:applet_output_data Unexecuted instantiation: ring.c:applet_output_data Unexecuted instantiation: server.c:applet_output_data Unexecuted instantiation: sink.c:applet_output_data Unexecuted instantiation: stats-html.c:applet_output_data Unexecuted instantiation: stats.c:applet_output_data Unexecuted instantiation: stconn.c:applet_output_data Unexecuted instantiation: stick_table.c:applet_output_data Unexecuted instantiation: stream.c:applet_output_data Unexecuted instantiation: tools.c:applet_output_data Unexecuted instantiation: trace.c:applet_output_data Unexecuted instantiation: vars.c:applet_output_data Unexecuted instantiation: activity.c:applet_output_data Unexecuted instantiation: applet.c:applet_output_data Unexecuted instantiation: dns.c:applet_output_data Unexecuted instantiation: dns_ring.c:applet_output_data Unexecuted instantiation: stats-json.c:applet_output_data Unexecuted instantiation: cache.c:applet_output_data Unexecuted instantiation: flt_spoe.c:applet_output_data |
363 | | |
364 | | /* Skips <len> bytes from the input buffer (see applet_get_inbuf). |
365 | | * |
366 | | * This is useful when data have been read directly from the buffer. It is |
367 | | * illegal to call this function with <len> causing a wrapping at the end of the |
368 | | * buffer. It's the caller's responsibility to ensure that <len> is never larger |
369 | | * than available output data. |
370 | | * |
371 | | * This function is not HTX aware. |
372 | | */ |
373 | | static inline void applet_skip_input(struct appctx *appctx, size_t len) |
374 | 0 | { |
375 | 0 | if (appctx_app_test(appctx, APPLET_FL_NEW_API)) { |
376 | 0 | b_del(&appctx->inbuf, len); |
377 | 0 | applet_fl_clr(appctx, APPCTX_FL_INBLK_FULL); |
378 | 0 | } |
379 | 0 | else |
380 | 0 | co_skip(sc_oc(appctx_sc(appctx)), len); |
381 | 0 | } Unexecuted instantiation: cli.c:applet_skip_input Unexecuted instantiation: debug.c:applet_skip_input Unexecuted instantiation: errors.c:applet_skip_input Unexecuted instantiation: haproxy.c:applet_skip_input Unexecuted instantiation: http_ana.c:applet_skip_input Unexecuted instantiation: log.c:applet_skip_input Unexecuted instantiation: mworker.c:applet_skip_input Unexecuted instantiation: peers.c:applet_skip_input Unexecuted instantiation: pool.c:applet_skip_input Unexecuted instantiation: proxy.c:applet_skip_input Unexecuted instantiation: resolvers.c:applet_skip_input Unexecuted instantiation: ring.c:applet_skip_input Unexecuted instantiation: server.c:applet_skip_input Unexecuted instantiation: sink.c:applet_skip_input Unexecuted instantiation: stats-html.c:applet_skip_input Unexecuted instantiation: stats.c:applet_skip_input Unexecuted instantiation: stconn.c:applet_skip_input Unexecuted instantiation: stick_table.c:applet_skip_input Unexecuted instantiation: stream.c:applet_skip_input Unexecuted instantiation: tools.c:applet_skip_input Unexecuted instantiation: trace.c:applet_skip_input Unexecuted instantiation: vars.c:applet_skip_input Unexecuted instantiation: activity.c:applet_skip_input Unexecuted instantiation: applet.c:applet_skip_input Unexecuted instantiation: dns.c:applet_skip_input Unexecuted instantiation: dns_ring.c:applet_skip_input Unexecuted instantiation: stats-json.c:applet_skip_input Unexecuted instantiation: cache.c:applet_skip_input Unexecuted instantiation: flt_spoe.c:applet_skip_input |
382 | | |
383 | | /* Removes all bytes from the input buffer (see applet_get_inbuf). |
384 | | */ |
385 | | static inline void applet_reset_input(struct appctx *appctx) |
386 | 0 | { |
387 | 0 | if (appctx_app_test(appctx, APPLET_FL_NEW_API)) { |
388 | 0 | b_reset(&appctx->inbuf); |
389 | 0 | applet_fl_clr(appctx, APPCTX_FL_INBLK_FULL); |
390 | 0 | } |
391 | 0 | else |
392 | 0 | co_skip(sc_oc(appctx_sc(appctx)), co_data(sc_oc(appctx_sc(appctx)))); |
393 | 0 | } Unexecuted instantiation: cli.c:applet_reset_input Unexecuted instantiation: debug.c:applet_reset_input Unexecuted instantiation: errors.c:applet_reset_input Unexecuted instantiation: haproxy.c:applet_reset_input Unexecuted instantiation: http_ana.c:applet_reset_input Unexecuted instantiation: log.c:applet_reset_input Unexecuted instantiation: mworker.c:applet_reset_input Unexecuted instantiation: peers.c:applet_reset_input Unexecuted instantiation: pool.c:applet_reset_input Unexecuted instantiation: proxy.c:applet_reset_input Unexecuted instantiation: resolvers.c:applet_reset_input Unexecuted instantiation: ring.c:applet_reset_input Unexecuted instantiation: server.c:applet_reset_input Unexecuted instantiation: sink.c:applet_reset_input Unexecuted instantiation: stats-html.c:applet_reset_input Unexecuted instantiation: stats.c:applet_reset_input Unexecuted instantiation: stconn.c:applet_reset_input Unexecuted instantiation: stick_table.c:applet_reset_input Unexecuted instantiation: stream.c:applet_reset_input Unexecuted instantiation: tools.c:applet_reset_input Unexecuted instantiation: trace.c:applet_reset_input Unexecuted instantiation: vars.c:applet_reset_input Unexecuted instantiation: activity.c:applet_reset_input Unexecuted instantiation: applet.c:applet_reset_input Unexecuted instantiation: dns.c:applet_reset_input Unexecuted instantiation: dns_ring.c:applet_reset_input Unexecuted instantiation: stats-json.c:applet_reset_input Unexecuted instantiation: cache.c:applet_reset_input Unexecuted instantiation: flt_spoe.c:applet_reset_input |
394 | | |
395 | | /* Returns the amount of space available at the HTX output buffer (see applet_get_outbuf). |
396 | | */ |
397 | | static inline size_t applet_htx_output_room(const struct appctx *appctx) |
398 | 0 | { |
399 | 0 | if (appctx_app_test(appctx, APPLET_FL_NEW_API)) |
400 | 0 | return htx_free_data_space(htxbuf(&appctx->outbuf)); |
401 | 0 | else |
402 | 0 | return channel_recv_max(sc_ic(appctx_sc(appctx))); |
403 | 0 | } Unexecuted instantiation: cli.c:applet_htx_output_room Unexecuted instantiation: debug.c:applet_htx_output_room Unexecuted instantiation: errors.c:applet_htx_output_room Unexecuted instantiation: haproxy.c:applet_htx_output_room Unexecuted instantiation: http_ana.c:applet_htx_output_room Unexecuted instantiation: log.c:applet_htx_output_room Unexecuted instantiation: mworker.c:applet_htx_output_room Unexecuted instantiation: peers.c:applet_htx_output_room Unexecuted instantiation: pool.c:applet_htx_output_room Unexecuted instantiation: proxy.c:applet_htx_output_room Unexecuted instantiation: resolvers.c:applet_htx_output_room Unexecuted instantiation: ring.c:applet_htx_output_room Unexecuted instantiation: server.c:applet_htx_output_room Unexecuted instantiation: sink.c:applet_htx_output_room Unexecuted instantiation: stats-html.c:applet_htx_output_room Unexecuted instantiation: stats.c:applet_htx_output_room Unexecuted instantiation: stconn.c:applet_htx_output_room Unexecuted instantiation: stick_table.c:applet_htx_output_room Unexecuted instantiation: stream.c:applet_htx_output_room Unexecuted instantiation: tools.c:applet_htx_output_room Unexecuted instantiation: trace.c:applet_htx_output_room Unexecuted instantiation: vars.c:applet_htx_output_room Unexecuted instantiation: activity.c:applet_htx_output_room Unexecuted instantiation: applet.c:applet_htx_output_room Unexecuted instantiation: dns.c:applet_htx_output_room Unexecuted instantiation: dns_ring.c:applet_htx_output_room Unexecuted instantiation: stats-json.c:applet_htx_output_room Unexecuted instantiation: cache.c:applet_htx_output_room Unexecuted instantiation: flt_spoe.c:applet_htx_output_room |
404 | | |
405 | | /* Returns the amount of space available at the output buffer (see applet_get_outbuf). |
406 | | */ |
407 | | static inline size_t applet_output_room(const struct appctx *appctx) |
408 | 0 | { |
409 | 0 | if (appctx_app_test(appctx, APPLET_FL_HTX)) |
410 | 0 | return applet_htx_output_room(appctx); |
411 | | |
412 | 0 | if (appctx_app_test(appctx, APPLET_FL_NEW_API)) |
413 | 0 | return b_room(&appctx->outbuf); |
414 | 0 | else |
415 | 0 | return channel_recv_max(sc_ic(appctx_sc(appctx))); |
416 | 0 | } Unexecuted instantiation: cli.c:applet_output_room Unexecuted instantiation: debug.c:applet_output_room Unexecuted instantiation: errors.c:applet_output_room Unexecuted instantiation: haproxy.c:applet_output_room Unexecuted instantiation: http_ana.c:applet_output_room Unexecuted instantiation: log.c:applet_output_room Unexecuted instantiation: mworker.c:applet_output_room Unexecuted instantiation: peers.c:applet_output_room Unexecuted instantiation: pool.c:applet_output_room Unexecuted instantiation: proxy.c:applet_output_room Unexecuted instantiation: resolvers.c:applet_output_room Unexecuted instantiation: ring.c:applet_output_room Unexecuted instantiation: server.c:applet_output_room Unexecuted instantiation: sink.c:applet_output_room Unexecuted instantiation: stats-html.c:applet_output_room Unexecuted instantiation: stats.c:applet_output_room Unexecuted instantiation: stconn.c:applet_output_room Unexecuted instantiation: stick_table.c:applet_output_room Unexecuted instantiation: stream.c:applet_output_room Unexecuted instantiation: tools.c:applet_output_room Unexecuted instantiation: trace.c:applet_output_room Unexecuted instantiation: vars.c:applet_output_room Unexecuted instantiation: activity.c:applet_output_room Unexecuted instantiation: applet.c:applet_output_room Unexecuted instantiation: dns.c:applet_output_room Unexecuted instantiation: dns_ring.c:applet_output_room Unexecuted instantiation: stats-json.c:applet_output_room Unexecuted instantiation: cache.c:applet_output_room Unexecuted instantiation: flt_spoe.c:applet_output_room |
417 | | |
418 | | /*Indicates that the applet have more data to deliver and it needs more room in |
419 | | * the output buffer to do so (see applet_get_outbuf). |
420 | | * |
421 | | * For applets using its own buffers, <room_needed> is not used and only |
422 | | * <appctx> flags are updated. For legacy applets, the amount of free space |
423 | | * required must be specified. In this last case, it is the caller |
424 | | * responsibility to be sure <room_needed> is valid. |
425 | | */ |
426 | | static inline void applet_need_room(struct appctx *appctx, size_t room_needed) |
427 | 0 | { |
428 | 0 | if (appctx_app_test(appctx, APPLET_FL_NEW_API)) |
429 | 0 | applet_have_more_data(appctx); |
430 | 0 | else |
431 | 0 | sc_need_room(appctx_sc(appctx), room_needed); |
432 | 0 | } Unexecuted instantiation: cli.c:applet_need_room Unexecuted instantiation: debug.c:applet_need_room Unexecuted instantiation: errors.c:applet_need_room Unexecuted instantiation: haproxy.c:applet_need_room Unexecuted instantiation: http_ana.c:applet_need_room Unexecuted instantiation: log.c:applet_need_room Unexecuted instantiation: mworker.c:applet_need_room Unexecuted instantiation: peers.c:applet_need_room Unexecuted instantiation: pool.c:applet_need_room Unexecuted instantiation: proxy.c:applet_need_room Unexecuted instantiation: resolvers.c:applet_need_room Unexecuted instantiation: ring.c:applet_need_room Unexecuted instantiation: server.c:applet_need_room Unexecuted instantiation: sink.c:applet_need_room Unexecuted instantiation: stats-html.c:applet_need_room Unexecuted instantiation: stats.c:applet_need_room Unexecuted instantiation: stconn.c:applet_need_room Unexecuted instantiation: stick_table.c:applet_need_room Unexecuted instantiation: stream.c:applet_need_room Unexecuted instantiation: tools.c:applet_need_room Unexecuted instantiation: trace.c:applet_need_room Unexecuted instantiation: vars.c:applet_need_room Unexecuted instantiation: activity.c:applet_need_room Unexecuted instantiation: applet.c:applet_need_room Unexecuted instantiation: dns.c:applet_need_room Unexecuted instantiation: dns_ring.c:applet_need_room Unexecuted instantiation: stats-json.c:applet_need_room Unexecuted instantiation: cache.c:applet_need_room Unexecuted instantiation: flt_spoe.c:applet_need_room |
433 | | |
434 | | /* Should only be used via wrappers applet_putchk() / applet_putchk_stress(). */ |
435 | | static inline int _applet_putchk(struct appctx *appctx, struct buffer *chunk, |
436 | | int stress) |
437 | 0 | { |
438 | 0 | int ret; |
439 | |
|
440 | 0 | if (appctx_app_test(appctx, APPLET_FL_NEW_API)) { |
441 | 0 | if (unlikely(stress) ? |
442 | 0 | b_data(&appctx->outbuf) : |
443 | 0 | b_data(chunk) > b_room(&appctx->outbuf)) { |
444 | 0 | applet_fl_set(appctx, APPCTX_FL_OUTBLK_FULL); |
445 | 0 | ret = -1; |
446 | 0 | } |
447 | 0 | else { |
448 | 0 | ret = b_putblk(&appctx->outbuf, b_head(chunk), b_data(chunk)); |
449 | 0 | chunk->data -= ret; |
450 | 0 | } |
451 | 0 | } |
452 | 0 | else { |
453 | 0 | struct sedesc *se = appctx->sedesc; |
454 | |
|
455 | 0 | if ((unlikely(stress) && ci_data(sc_ic(se->sc))) || |
456 | 0 | (ret = ci_putchk(sc_ic(se->sc), chunk)) < 0) { |
457 | | /* XXX: Handle all errors as a lack of space because callers |
458 | | * don't handles other cases for now. So applets must be |
459 | | * careful to handles shutdown (-2) and invalid calls (-3) by |
460 | | * themselves. |
461 | | */ |
462 | 0 | sc_need_room(se->sc, chunk->data); |
463 | 0 | ret = -1; |
464 | 0 | } |
465 | 0 | } |
466 | |
|
467 | 0 | return ret; |
468 | 0 | } Unexecuted instantiation: cli.c:_applet_putchk Unexecuted instantiation: debug.c:_applet_putchk Unexecuted instantiation: errors.c:_applet_putchk Unexecuted instantiation: haproxy.c:_applet_putchk Unexecuted instantiation: http_ana.c:_applet_putchk Unexecuted instantiation: log.c:_applet_putchk Unexecuted instantiation: mworker.c:_applet_putchk Unexecuted instantiation: peers.c:_applet_putchk Unexecuted instantiation: pool.c:_applet_putchk Unexecuted instantiation: proxy.c:_applet_putchk Unexecuted instantiation: resolvers.c:_applet_putchk Unexecuted instantiation: ring.c:_applet_putchk Unexecuted instantiation: server.c:_applet_putchk Unexecuted instantiation: sink.c:_applet_putchk Unexecuted instantiation: stats-html.c:_applet_putchk Unexecuted instantiation: stats.c:_applet_putchk Unexecuted instantiation: stconn.c:_applet_putchk Unexecuted instantiation: stick_table.c:_applet_putchk Unexecuted instantiation: stream.c:_applet_putchk Unexecuted instantiation: tools.c:_applet_putchk Unexecuted instantiation: trace.c:_applet_putchk Unexecuted instantiation: vars.c:_applet_putchk Unexecuted instantiation: activity.c:_applet_putchk Unexecuted instantiation: applet.c:_applet_putchk Unexecuted instantiation: dns.c:_applet_putchk Unexecuted instantiation: dns_ring.c:_applet_putchk Unexecuted instantiation: stats-json.c:_applet_putchk Unexecuted instantiation: cache.c:_applet_putchk Unexecuted instantiation: flt_spoe.c:_applet_putchk |
469 | | |
470 | | /* writes chunk <chunk> into the applet output buffer (see applet_get_outbuf). |
471 | | * |
472 | | * Returns the number of written bytes on success or -1 on error (lake of space, |
473 | | * shutdown, invalid call...) |
474 | | */ |
475 | | static inline int applet_putchk(struct appctx *appctx, struct buffer *chunk) |
476 | 0 | { |
477 | 0 | return _applet_putchk(appctx, chunk, 0); |
478 | 0 | } Unexecuted instantiation: cli.c:applet_putchk Unexecuted instantiation: debug.c:applet_putchk Unexecuted instantiation: errors.c:applet_putchk Unexecuted instantiation: haproxy.c:applet_putchk Unexecuted instantiation: http_ana.c:applet_putchk Unexecuted instantiation: log.c:applet_putchk Unexecuted instantiation: mworker.c:applet_putchk Unexecuted instantiation: peers.c:applet_putchk Unexecuted instantiation: pool.c:applet_putchk Unexecuted instantiation: proxy.c:applet_putchk Unexecuted instantiation: resolvers.c:applet_putchk Unexecuted instantiation: ring.c:applet_putchk Unexecuted instantiation: server.c:applet_putchk Unexecuted instantiation: sink.c:applet_putchk Unexecuted instantiation: stats-html.c:applet_putchk Unexecuted instantiation: stats.c:applet_putchk Unexecuted instantiation: stconn.c:applet_putchk Unexecuted instantiation: stick_table.c:applet_putchk Unexecuted instantiation: stream.c:applet_putchk Unexecuted instantiation: tools.c:applet_putchk Unexecuted instantiation: trace.c:applet_putchk Unexecuted instantiation: vars.c:applet_putchk Unexecuted instantiation: activity.c:applet_putchk Unexecuted instantiation: applet.c:applet_putchk Unexecuted instantiation: dns.c:applet_putchk Unexecuted instantiation: dns_ring.c:applet_putchk Unexecuted instantiation: stats-json.c:applet_putchk Unexecuted instantiation: cache.c:applet_putchk Unexecuted instantiation: flt_spoe.c:applet_putchk |
479 | | |
480 | | /* Equivalent of applet_putchk() but with stress condition alternatives activated. */ |
481 | | static inline int applet_putchk_stress(struct appctx *appctx, struct buffer *chunk) |
482 | 0 | { |
483 | 0 | return _applet_putchk(appctx, chunk, 1); |
484 | 0 | } Unexecuted instantiation: cli.c:applet_putchk_stress Unexecuted instantiation: debug.c:applet_putchk_stress Unexecuted instantiation: errors.c:applet_putchk_stress Unexecuted instantiation: haproxy.c:applet_putchk_stress Unexecuted instantiation: http_ana.c:applet_putchk_stress Unexecuted instantiation: log.c:applet_putchk_stress Unexecuted instantiation: mworker.c:applet_putchk_stress Unexecuted instantiation: peers.c:applet_putchk_stress Unexecuted instantiation: pool.c:applet_putchk_stress Unexecuted instantiation: proxy.c:applet_putchk_stress Unexecuted instantiation: resolvers.c:applet_putchk_stress Unexecuted instantiation: ring.c:applet_putchk_stress Unexecuted instantiation: server.c:applet_putchk_stress Unexecuted instantiation: sink.c:applet_putchk_stress Unexecuted instantiation: stats-html.c:applet_putchk_stress Unexecuted instantiation: stats.c:applet_putchk_stress Unexecuted instantiation: stconn.c:applet_putchk_stress Unexecuted instantiation: stick_table.c:applet_putchk_stress Unexecuted instantiation: stream.c:applet_putchk_stress Unexecuted instantiation: tools.c:applet_putchk_stress Unexecuted instantiation: trace.c:applet_putchk_stress Unexecuted instantiation: vars.c:applet_putchk_stress Unexecuted instantiation: activity.c:applet_putchk_stress Unexecuted instantiation: applet.c:applet_putchk_stress Unexecuted instantiation: dns.c:applet_putchk_stress Unexecuted instantiation: dns_ring.c:applet_putchk_stress Unexecuted instantiation: stats-json.c:applet_putchk_stress Unexecuted instantiation: cache.c:applet_putchk_stress Unexecuted instantiation: flt_spoe.c:applet_putchk_stress |
485 | | |
486 | | /* writes <len> chars from <blk> into the applet output buffer (see applet_get_outbuf). |
487 | | * |
488 | | * Returns the number of written bytes on success or -1 on error (lake of space, |
489 | | * shutdown, invalid call...) |
490 | | */ |
491 | | static inline int applet_putblk(struct appctx *appctx, const char *blk, int len) |
492 | 0 | { |
493 | 0 | int ret; |
494 | |
|
495 | 0 | if (appctx_app_test(appctx, APPLET_FL_NEW_API)) { |
496 | 0 | if (len > b_room(&appctx->outbuf)) { |
497 | 0 | applet_fl_set(appctx, APPCTX_FL_OUTBLK_FULL); |
498 | 0 | ret = -1; |
499 | 0 | } |
500 | 0 | else |
501 | 0 | ret = b_putblk(&appctx->outbuf, blk, len); |
502 | 0 | } |
503 | 0 | else { |
504 | 0 | struct sedesc *se = appctx->sedesc; |
505 | |
|
506 | 0 | ret = ci_putblk(sc_ic(se->sc), blk, len); |
507 | 0 | if (ret < 0) { |
508 | | /* XXX: Handle all errors as a lack of space because callers |
509 | | * don't handles other cases for now. So applets must be |
510 | | * careful to handles shutdown (-2) and invalid calls (-3) by |
511 | | * themselves. |
512 | | */ |
513 | 0 | sc_need_room(se->sc, len); |
514 | 0 | ret = -1; |
515 | 0 | } |
516 | 0 | } |
517 | |
|
518 | 0 | return ret; |
519 | 0 | } Unexecuted instantiation: cli.c:applet_putblk Unexecuted instantiation: debug.c:applet_putblk Unexecuted instantiation: errors.c:applet_putblk Unexecuted instantiation: haproxy.c:applet_putblk Unexecuted instantiation: http_ana.c:applet_putblk Unexecuted instantiation: log.c:applet_putblk Unexecuted instantiation: mworker.c:applet_putblk Unexecuted instantiation: peers.c:applet_putblk Unexecuted instantiation: pool.c:applet_putblk Unexecuted instantiation: proxy.c:applet_putblk Unexecuted instantiation: resolvers.c:applet_putblk Unexecuted instantiation: ring.c:applet_putblk Unexecuted instantiation: server.c:applet_putblk Unexecuted instantiation: sink.c:applet_putblk Unexecuted instantiation: stats-html.c:applet_putblk Unexecuted instantiation: stats.c:applet_putblk Unexecuted instantiation: stconn.c:applet_putblk Unexecuted instantiation: stick_table.c:applet_putblk Unexecuted instantiation: stream.c:applet_putblk Unexecuted instantiation: tools.c:applet_putblk Unexecuted instantiation: trace.c:applet_putblk Unexecuted instantiation: vars.c:applet_putblk Unexecuted instantiation: activity.c:applet_putblk Unexecuted instantiation: applet.c:applet_putblk Unexecuted instantiation: dns.c:applet_putblk Unexecuted instantiation: dns_ring.c:applet_putblk Unexecuted instantiation: stats-json.c:applet_putblk Unexecuted instantiation: cache.c:applet_putblk Unexecuted instantiation: flt_spoe.c:applet_putblk |
520 | | |
521 | | /* writes chars from <str> up to the trailing zero (excluded) into the applet |
522 | | * output buffer (see applet_get_outbuf). |
523 | | * |
524 | | * Returns the number of written bytes on success or -1 on error (lake of space, |
525 | | * shutdown, invalid call...) |
526 | | */ |
527 | | static inline int applet_putstr(struct appctx *appctx, const char *str) |
528 | 0 | { |
529 | 0 | int ret; |
530 | |
|
531 | 0 | if (appctx_app_test(appctx, APPLET_FL_NEW_API)) { |
532 | 0 | int len = strlen(str); |
533 | |
|
534 | 0 | if (len > b_room(&appctx->outbuf)) { |
535 | 0 | applet_fl_set(appctx, APPCTX_FL_OUTBLK_FULL); |
536 | 0 | ret = -1; |
537 | 0 | } |
538 | 0 | else |
539 | 0 | ret = b_putblk(&appctx->outbuf, str, len); |
540 | 0 | } |
541 | 0 | else { |
542 | 0 | struct sedesc *se = appctx->sedesc; |
543 | |
|
544 | 0 | ret = ci_putstr(sc_ic(se->sc), str); |
545 | 0 | if (ret < 0) { |
546 | | /* XXX: Handle all errors as a lack of space because callers |
547 | | * don't handles other cases for now. So applets must be |
548 | | * careful to handles shutdown (-2) and invalid calls (-3) by |
549 | | * themselves. |
550 | | */ |
551 | 0 | sc_need_room(se->sc, strlen(str)); |
552 | 0 | ret = -1; |
553 | 0 | } |
554 | 0 | } |
555 | 0 | return ret; |
556 | 0 | } Unexecuted instantiation: cli.c:applet_putstr Unexecuted instantiation: debug.c:applet_putstr Unexecuted instantiation: errors.c:applet_putstr Unexecuted instantiation: haproxy.c:applet_putstr Unexecuted instantiation: http_ana.c:applet_putstr Unexecuted instantiation: log.c:applet_putstr Unexecuted instantiation: mworker.c:applet_putstr Unexecuted instantiation: peers.c:applet_putstr Unexecuted instantiation: pool.c:applet_putstr Unexecuted instantiation: proxy.c:applet_putstr Unexecuted instantiation: resolvers.c:applet_putstr Unexecuted instantiation: ring.c:applet_putstr Unexecuted instantiation: server.c:applet_putstr Unexecuted instantiation: sink.c:applet_putstr Unexecuted instantiation: stats-html.c:applet_putstr Unexecuted instantiation: stats.c:applet_putstr Unexecuted instantiation: stconn.c:applet_putstr Unexecuted instantiation: stick_table.c:applet_putstr Unexecuted instantiation: stream.c:applet_putstr Unexecuted instantiation: tools.c:applet_putstr Unexecuted instantiation: trace.c:applet_putstr Unexecuted instantiation: vars.c:applet_putstr Unexecuted instantiation: activity.c:applet_putstr Unexecuted instantiation: applet.c:applet_putstr Unexecuted instantiation: dns.c:applet_putstr Unexecuted instantiation: dns_ring.c:applet_putstr Unexecuted instantiation: stats-json.c:applet_putstr Unexecuted instantiation: cache.c:applet_putstr Unexecuted instantiation: flt_spoe.c:applet_putstr |
557 | | |
558 | | /* writes character <chr> into the applet's output buffer (see applet_get_outbuf). |
559 | | * |
560 | | * Returns the number of written bytes on success or -1 on error (lake of space, |
561 | | * shutdown, invalid call...) |
562 | | */ |
563 | | static inline int applet_putchr(struct appctx *appctx, char chr) |
564 | 0 | { |
565 | 0 | int ret; |
566 | 0 |
|
567 | 0 | if (appctx_app_test(appctx, APPLET_FL_NEW_API)) { |
568 | 0 | if (b_full(&appctx->outbuf)) { |
569 | 0 | applet_fl_set(appctx, APPCTX_FL_OUTBLK_FULL); |
570 | 0 | ret = -1; |
571 | 0 | } |
572 | 0 | else { |
573 | 0 | b_putchr(&appctx->outbuf, chr); |
574 | 0 | ret = 1; |
575 | 0 | } |
576 | 0 | } |
577 | 0 | else { |
578 | 0 | struct sedesc *se = appctx->sedesc; |
579 | 0 |
|
580 | 0 | ret = ci_putchr(sc_ic(se->sc), chr); |
581 | 0 | if (ret < 0) { |
582 | 0 | /* XXX: Handle all errors as a lack of space because callers |
583 | 0 | * don't handles other cases for now. So applets must be |
584 | 0 | * careful to handles shutdown (-2) and invalid calls (-3) by |
585 | 0 | * themselves. |
586 | 0 | */ |
587 | 0 | sc_need_room(se->sc, 1); |
588 | 0 | ret = -1; |
589 | 0 | } |
590 | 0 | } |
591 | 0 | return ret; |
592 | 0 | } Unexecuted instantiation: cli.c:applet_putchr Unexecuted instantiation: debug.c:applet_putchr Unexecuted instantiation: errors.c:applet_putchr Unexecuted instantiation: haproxy.c:applet_putchr Unexecuted instantiation: http_ana.c:applet_putchr Unexecuted instantiation: log.c:applet_putchr Unexecuted instantiation: mworker.c:applet_putchr Unexecuted instantiation: peers.c:applet_putchr Unexecuted instantiation: pool.c:applet_putchr Unexecuted instantiation: proxy.c:applet_putchr Unexecuted instantiation: resolvers.c:applet_putchr Unexecuted instantiation: ring.c:applet_putchr Unexecuted instantiation: server.c:applet_putchr Unexecuted instantiation: sink.c:applet_putchr Unexecuted instantiation: stats-html.c:applet_putchr Unexecuted instantiation: stats.c:applet_putchr Unexecuted instantiation: stconn.c:applet_putchr Unexecuted instantiation: stick_table.c:applet_putchr Unexecuted instantiation: stream.c:applet_putchr Unexecuted instantiation: tools.c:applet_putchr Unexecuted instantiation: trace.c:applet_putchr Unexecuted instantiation: vars.c:applet_putchr Unexecuted instantiation: activity.c:applet_putchr Unexecuted instantiation: applet.c:applet_putchr Unexecuted instantiation: dns.c:applet_putchr Unexecuted instantiation: dns_ring.c:applet_putchr Unexecuted instantiation: stats-json.c:applet_putchr Unexecuted instantiation: cache.c:applet_putchr Unexecuted instantiation: flt_spoe.c:applet_putchr |
593 | | |
594 | | static inline int applet_may_get(const struct appctx *appctx, size_t len) |
595 | 0 | { |
596 | 0 | if (appctx_app_test(appctx, APPLET_FL_NEW_API)) { |
597 | 0 | if (len > b_data(&appctx->inbuf)) { |
598 | 0 | if (se_fl_test(appctx->sedesc, SE_FL_SHW)) |
599 | 0 | return -1; |
600 | 0 | return 0; |
601 | 0 | } |
602 | 0 | } |
603 | 0 | else { |
604 | 0 | const struct stconn *sc = appctx_sc(appctx); |
605 | |
|
606 | 0 | if ((sc->flags & SC_FL_SHUT_DONE) || len > co_data(sc_oc(sc))) { |
607 | 0 | if (sc->flags & (SC_FL_SHUT_DONE|SC_FL_SHUT_WANTED)) |
608 | 0 | return -1; |
609 | 0 | return 0; |
610 | 0 | } |
611 | 0 | } |
612 | 0 | return 1; |
613 | 0 | } Unexecuted instantiation: cli.c:applet_may_get Unexecuted instantiation: debug.c:applet_may_get Unexecuted instantiation: errors.c:applet_may_get Unexecuted instantiation: haproxy.c:applet_may_get Unexecuted instantiation: http_ana.c:applet_may_get Unexecuted instantiation: log.c:applet_may_get Unexecuted instantiation: mworker.c:applet_may_get Unexecuted instantiation: peers.c:applet_may_get Unexecuted instantiation: pool.c:applet_may_get Unexecuted instantiation: proxy.c:applet_may_get Unexecuted instantiation: resolvers.c:applet_may_get Unexecuted instantiation: ring.c:applet_may_get Unexecuted instantiation: server.c:applet_may_get Unexecuted instantiation: sink.c:applet_may_get Unexecuted instantiation: stats-html.c:applet_may_get Unexecuted instantiation: stats.c:applet_may_get Unexecuted instantiation: stconn.c:applet_may_get Unexecuted instantiation: stick_table.c:applet_may_get Unexecuted instantiation: stream.c:applet_may_get Unexecuted instantiation: tools.c:applet_may_get Unexecuted instantiation: trace.c:applet_may_get Unexecuted instantiation: vars.c:applet_may_get Unexecuted instantiation: activity.c:applet_may_get Unexecuted instantiation: applet.c:applet_may_get Unexecuted instantiation: dns.c:applet_may_get Unexecuted instantiation: dns_ring.c:applet_may_get Unexecuted instantiation: stats-json.c:applet_may_get Unexecuted instantiation: cache.c:applet_may_get Unexecuted instantiation: flt_spoe.c:applet_may_get |
614 | | /* Gets one char from the applet input buffer (see appet_get_inbuf), |
615 | | * |
616 | | * Return values : |
617 | | * 1 : number of bytes read, equal to requested size. |
618 | | * =0 : not enough data available. <c> is left undefined. |
619 | | * <0 : no more bytes readable because output is shut. |
620 | | * |
621 | | * The status of the corresponding buffer is not changed. The caller must call |
622 | | * applet_skip_input() to update it. |
623 | | */ |
624 | | static inline int applet_getchar(const struct appctx *appctx, char *c) |
625 | 0 | { |
626 | 0 | int ret; |
627 | |
|
628 | 0 | ret = applet_may_get(appctx, 1); |
629 | 0 | if (ret <= 0) |
630 | 0 | return ret; |
631 | 0 | *c = ((appctx_app_test(appctx, APPLET_FL_NEW_API)) |
632 | 0 | ? *(b_head(&appctx->inbuf)) |
633 | 0 | : *(co_head(sc_oc(appctx_sc(appctx))))); |
634 | |
|
635 | 0 | return 1; |
636 | 0 | } Unexecuted instantiation: cli.c:applet_getchar Unexecuted instantiation: debug.c:applet_getchar Unexecuted instantiation: errors.c:applet_getchar Unexecuted instantiation: haproxy.c:applet_getchar Unexecuted instantiation: http_ana.c:applet_getchar Unexecuted instantiation: log.c:applet_getchar Unexecuted instantiation: mworker.c:applet_getchar Unexecuted instantiation: peers.c:applet_getchar Unexecuted instantiation: pool.c:applet_getchar Unexecuted instantiation: proxy.c:applet_getchar Unexecuted instantiation: resolvers.c:applet_getchar Unexecuted instantiation: ring.c:applet_getchar Unexecuted instantiation: server.c:applet_getchar Unexecuted instantiation: sink.c:applet_getchar Unexecuted instantiation: stats-html.c:applet_getchar Unexecuted instantiation: stats.c:applet_getchar Unexecuted instantiation: stconn.c:applet_getchar Unexecuted instantiation: stick_table.c:applet_getchar Unexecuted instantiation: stream.c:applet_getchar Unexecuted instantiation: tools.c:applet_getchar Unexecuted instantiation: trace.c:applet_getchar Unexecuted instantiation: vars.c:applet_getchar Unexecuted instantiation: activity.c:applet_getchar Unexecuted instantiation: applet.c:applet_getchar Unexecuted instantiation: dns.c:applet_getchar Unexecuted instantiation: dns_ring.c:applet_getchar Unexecuted instantiation: stats-json.c:applet_getchar Unexecuted instantiation: cache.c:applet_getchar Unexecuted instantiation: flt_spoe.c:applet_getchar |
637 | | |
638 | | /* Copies one full block of data from the applet input buffer (see |
639 | | * appet_get_inbuf). |
640 | | * |
641 | | * <len> bytes are capied, starting at the offset <offset>. |
642 | | * |
643 | | * Return values : |
644 | | * >0 : number of bytes read, equal to requested size. |
645 | | * =0 : not enough data available. <blk> is left undefined. |
646 | | * <0 : no more bytes readable because output is shut. |
647 | | * |
648 | | * The status of the corresponding buffer is not changed. The caller must call |
649 | | * applet_skip_input() to update it. |
650 | | */ |
651 | | static inline int applet_getblk(const struct appctx *appctx, char *blk, int len, int offset) |
652 | 0 | { |
653 | 0 | const struct buffer *buf; |
654 | 0 | int ret; |
655 | |
|
656 | 0 | ret = applet_may_get(appctx, len+offset); |
657 | 0 | if (ret <= 0) |
658 | 0 | return ret; |
659 | | |
660 | 0 | buf = ((appctx_app_test(appctx, APPLET_FL_NEW_API)) |
661 | 0 | ? &appctx->inbuf |
662 | 0 | : sc_ob(appctx_sc(appctx))); |
663 | 0 | return b_getblk(buf, blk, len, offset); |
664 | 0 | } Unexecuted instantiation: cli.c:applet_getblk Unexecuted instantiation: debug.c:applet_getblk Unexecuted instantiation: errors.c:applet_getblk Unexecuted instantiation: haproxy.c:applet_getblk Unexecuted instantiation: http_ana.c:applet_getblk Unexecuted instantiation: log.c:applet_getblk Unexecuted instantiation: mworker.c:applet_getblk Unexecuted instantiation: peers.c:applet_getblk Unexecuted instantiation: pool.c:applet_getblk Unexecuted instantiation: proxy.c:applet_getblk Unexecuted instantiation: resolvers.c:applet_getblk Unexecuted instantiation: ring.c:applet_getblk Unexecuted instantiation: server.c:applet_getblk Unexecuted instantiation: sink.c:applet_getblk Unexecuted instantiation: stats-html.c:applet_getblk Unexecuted instantiation: stats.c:applet_getblk Unexecuted instantiation: stconn.c:applet_getblk Unexecuted instantiation: stick_table.c:applet_getblk Unexecuted instantiation: stream.c:applet_getblk Unexecuted instantiation: tools.c:applet_getblk Unexecuted instantiation: trace.c:applet_getblk Unexecuted instantiation: vars.c:applet_getblk Unexecuted instantiation: activity.c:applet_getblk Unexecuted instantiation: applet.c:applet_getblk Unexecuted instantiation: dns.c:applet_getblk Unexecuted instantiation: dns_ring.c:applet_getblk Unexecuted instantiation: stats-json.c:applet_getblk Unexecuted instantiation: cache.c:applet_getblk Unexecuted instantiation: flt_spoe.c:applet_getblk |
665 | | |
666 | | /* Gets one text block representing a word from the applet input buffer (see |
667 | | * appet_get_inbuf). |
668 | | * |
669 | | * The separator is waited for as long as some data can still be received and the |
670 | | * destination is not full. Otherwise, the string may be returned as is, without |
671 | | * the separator. |
672 | | * |
673 | | * Return values : |
674 | | * >0 : number of bytes read. Includes the separator if present before len or end. |
675 | | * =0 : no separator before end found. <str> is left undefined. |
676 | | * <0 : no more bytes readable because output is shut. |
677 | | * |
678 | | * The status of the corresponding buffer is not changed. The caller must call |
679 | | * applet_skip_input() to update it. |
680 | | */ |
681 | | static inline int applet_getword(const struct appctx *appctx, char *str, int len, char sep) |
682 | 0 | { |
683 | 0 | const struct buffer *buf; |
684 | 0 | char *p; |
685 | 0 | size_t input, max = len; |
686 | 0 | int ret = 0; |
687 | |
|
688 | 0 | ret = applet_may_get(appctx, 1); |
689 | 0 | if (ret <= 0) |
690 | 0 | goto out; |
691 | | |
692 | 0 | if (appctx_app_test(appctx, APPLET_FL_NEW_API)) { |
693 | 0 | buf = &appctx->inbuf; |
694 | 0 | input = b_data(buf); |
695 | 0 | } |
696 | 0 | else { |
697 | 0 | struct stconn *sc = appctx_sc(appctx); |
698 | |
|
699 | 0 | buf = sc_ob(sc); |
700 | 0 | input = co_data(sc_oc(sc)); |
701 | 0 | } |
702 | |
|
703 | 0 | if (max > input) { |
704 | 0 | max = input; |
705 | 0 | str[max-1] = 0; |
706 | 0 | } |
707 | |
|
708 | 0 | p = b_head(buf); |
709 | 0 | ret = 0; |
710 | 0 | while (max) { |
711 | 0 | *str++ = *p; |
712 | 0 | ret++; |
713 | 0 | max--; |
714 | 0 | if (*p == sep) |
715 | 0 | goto out; |
716 | 0 | p = b_next(buf, p); |
717 | 0 | } |
718 | | |
719 | 0 | if (appctx_app_test(appctx, APPLET_FL_NEW_API)) { |
720 | 0 | if (ret < len && (ret < input || b_room(buf)) && |
721 | 0 | !se_fl_test(appctx->sedesc, SE_FL_SHW)) |
722 | 0 | ret = 0; |
723 | 0 | } |
724 | 0 | else { |
725 | 0 | struct stconn *sc = appctx_sc(appctx); |
726 | |
|
727 | 0 | if (ret < len && (ret < input || channel_may_recv(sc_oc(sc))) && |
728 | 0 | !(sc->flags & (SC_FL_SHUT_DONE|SC_FL_SHUT_WANTED))) |
729 | 0 | ret = 0; |
730 | 0 | } |
731 | 0 | out: |
732 | 0 | if (max) |
733 | 0 | *str = 0; |
734 | 0 | return ret; |
735 | 0 | } Unexecuted instantiation: cli.c:applet_getword Unexecuted instantiation: debug.c:applet_getword Unexecuted instantiation: errors.c:applet_getword Unexecuted instantiation: haproxy.c:applet_getword Unexecuted instantiation: http_ana.c:applet_getword Unexecuted instantiation: log.c:applet_getword Unexecuted instantiation: mworker.c:applet_getword Unexecuted instantiation: peers.c:applet_getword Unexecuted instantiation: pool.c:applet_getword Unexecuted instantiation: proxy.c:applet_getword Unexecuted instantiation: resolvers.c:applet_getword Unexecuted instantiation: ring.c:applet_getword Unexecuted instantiation: server.c:applet_getword Unexecuted instantiation: sink.c:applet_getword Unexecuted instantiation: stats-html.c:applet_getword Unexecuted instantiation: stats.c:applet_getword Unexecuted instantiation: stconn.c:applet_getword Unexecuted instantiation: stick_table.c:applet_getword Unexecuted instantiation: stream.c:applet_getword Unexecuted instantiation: tools.c:applet_getword Unexecuted instantiation: trace.c:applet_getword Unexecuted instantiation: vars.c:applet_getword Unexecuted instantiation: activity.c:applet_getword Unexecuted instantiation: applet.c:applet_getword Unexecuted instantiation: dns.c:applet_getword Unexecuted instantiation: dns_ring.c:applet_getword Unexecuted instantiation: stats-json.c:applet_getword Unexecuted instantiation: cache.c:applet_getword Unexecuted instantiation: flt_spoe.c:applet_getword |
736 | | |
737 | | /* Gets one text block representing a line from the applet input buffer (see |
738 | | * appet_get_inbuf). |
739 | | * |
740 | | * The '\n' is waited for as long as some data can still be received and the |
741 | | * destination is not full. Otherwise, the string may be returned as is, without |
742 | | * the '\n'. |
743 | | * |
744 | | * Return values : |
745 | | * >0 : number of bytes read. Includes the \n if present before len or end. |
746 | | * =0 : no '\n' before end found. <str> is left undefined. |
747 | | * <0 : no more bytes readable because output is shut. |
748 | | * |
749 | | * The status of the corresponding buffer is not changed. The caller must call |
750 | | * applet_skip_input() to update it. |
751 | | */ |
752 | | static inline int applet_getline(const struct appctx *appctx, char *str, int len) |
753 | 0 | { |
754 | 0 | return applet_getword(appctx, str, len, '\n'); |
755 | 0 | } Unexecuted instantiation: cli.c:applet_getline Unexecuted instantiation: debug.c:applet_getline Unexecuted instantiation: errors.c:applet_getline Unexecuted instantiation: haproxy.c:applet_getline Unexecuted instantiation: http_ana.c:applet_getline Unexecuted instantiation: log.c:applet_getline Unexecuted instantiation: mworker.c:applet_getline Unexecuted instantiation: peers.c:applet_getline Unexecuted instantiation: pool.c:applet_getline Unexecuted instantiation: proxy.c:applet_getline Unexecuted instantiation: resolvers.c:applet_getline Unexecuted instantiation: ring.c:applet_getline Unexecuted instantiation: server.c:applet_getline Unexecuted instantiation: sink.c:applet_getline Unexecuted instantiation: stats-html.c:applet_getline Unexecuted instantiation: stats.c:applet_getline Unexecuted instantiation: stconn.c:applet_getline Unexecuted instantiation: stick_table.c:applet_getline Unexecuted instantiation: stream.c:applet_getline Unexecuted instantiation: tools.c:applet_getline Unexecuted instantiation: trace.c:applet_getline Unexecuted instantiation: vars.c:applet_getline Unexecuted instantiation: activity.c:applet_getline Unexecuted instantiation: applet.c:applet_getline Unexecuted instantiation: dns.c:applet_getline Unexecuted instantiation: dns_ring.c:applet_getline Unexecuted instantiation: stats-json.c:applet_getline Unexecuted instantiation: cache.c:applet_getline Unexecuted instantiation: flt_spoe.c:applet_getline |
756 | | |
757 | | /* Gets one or two blocks of data at once from the applet input buffer (see appet_get_inbuf), |
758 | | * |
759 | | * Data are not copied. |
760 | | * |
761 | | * Return values : |
762 | | * >0 : number of blocks filled (1 or 2). blk1 is always filled before blk2. |
763 | | * =0 : not enough data available. <blk*> are left undefined. |
764 | | * <0 : no more bytes readable because output is shut. |
765 | | * |
766 | | * The status of the corresponding buffer is not changed. The caller must call |
767 | | * applet_skip_input() to update it. |
768 | | */ |
769 | | static inline int applet_getblk_nc(const struct appctx *appctx, const char **blk1, size_t *len1, const char **blk2, size_t *len2) |
770 | 0 | { |
771 | 0 | const struct buffer *buf; |
772 | 0 | size_t max; |
773 | 0 | int ret; |
774 | 0 |
|
775 | 0 | ret = applet_may_get(appctx, 1); |
776 | 0 | if (ret <= 0) |
777 | 0 | return ret; |
778 | 0 |
|
779 | 0 | if (appctx_app_test(appctx, APPLET_FL_NEW_API)) { |
780 | 0 | buf = &appctx->inbuf; |
781 | 0 | max = b_data(buf); |
782 | 0 | } |
783 | 0 | else { |
784 | 0 | struct stconn *sc = appctx_sc(appctx); |
785 | 0 |
|
786 | 0 | buf = sc_ob(sc); |
787 | 0 | max = co_data(sc_oc(sc)); |
788 | 0 | } |
789 | 0 |
|
790 | 0 | return b_getblk_nc(buf, blk1, len1, blk2, len2, 0, max); |
791 | 0 | } Unexecuted instantiation: cli.c:applet_getblk_nc Unexecuted instantiation: debug.c:applet_getblk_nc Unexecuted instantiation: errors.c:applet_getblk_nc Unexecuted instantiation: haproxy.c:applet_getblk_nc Unexecuted instantiation: http_ana.c:applet_getblk_nc Unexecuted instantiation: log.c:applet_getblk_nc Unexecuted instantiation: mworker.c:applet_getblk_nc Unexecuted instantiation: peers.c:applet_getblk_nc Unexecuted instantiation: pool.c:applet_getblk_nc Unexecuted instantiation: proxy.c:applet_getblk_nc Unexecuted instantiation: resolvers.c:applet_getblk_nc Unexecuted instantiation: ring.c:applet_getblk_nc Unexecuted instantiation: server.c:applet_getblk_nc Unexecuted instantiation: sink.c:applet_getblk_nc Unexecuted instantiation: stats-html.c:applet_getblk_nc Unexecuted instantiation: stats.c:applet_getblk_nc Unexecuted instantiation: stconn.c:applet_getblk_nc Unexecuted instantiation: stick_table.c:applet_getblk_nc Unexecuted instantiation: stream.c:applet_getblk_nc Unexecuted instantiation: tools.c:applet_getblk_nc Unexecuted instantiation: trace.c:applet_getblk_nc Unexecuted instantiation: vars.c:applet_getblk_nc Unexecuted instantiation: activity.c:applet_getblk_nc Unexecuted instantiation: applet.c:applet_getblk_nc Unexecuted instantiation: dns.c:applet_getblk_nc Unexecuted instantiation: dns_ring.c:applet_getblk_nc Unexecuted instantiation: stats-json.c:applet_getblk_nc Unexecuted instantiation: cache.c:applet_getblk_nc Unexecuted instantiation: flt_spoe.c:applet_getblk_nc |
792 | | |
793 | | /* Gets one or two blocks of text representing a word from the applet input |
794 | | * buffer (see appet_get_inbuf). |
795 | | * |
796 | | * Data are not copied. The separator is waited for as long as some data can |
797 | | * still be received and the destination is not full. Otherwise, the string may |
798 | | * be returned as is, without the separator. |
799 | | * |
800 | | * Return values : |
801 | | * >0 : number of bytes read. Includes the separator if present before len or end. |
802 | | * =0 : no separator before end found. <str> is left undefined. |
803 | | * <0 : no more bytes readable because output is shut. |
804 | | * |
805 | | * The status of the corresponding buffer is not changed. The caller must call |
806 | | * applet_skip_input() to update it. |
807 | | */ |
808 | | static inline int applet_getword_nc(const struct appctx *appctx, const char **blk1, size_t *len1, const char **blk2, size_t *len2, char sep) |
809 | 0 | { |
810 | 0 | int ret; |
811 | 0 | size_t l; |
812 | 0 |
|
813 | 0 | ret = applet_getblk_nc(appctx, blk1, len1, blk2, len2); |
814 | 0 | if (unlikely(ret <= 0)) |
815 | 0 | return ret; |
816 | 0 |
|
817 | 0 | for (l = 0; l < *len1 && (*blk1)[l] != sep; l++); |
818 | 0 | if (l < *len1 && (*blk1)[l] == sep) { |
819 | 0 | *len1 = l + 1; |
820 | 0 | return 1; |
821 | 0 | } |
822 | 0 |
|
823 | 0 | if (ret >= 2) { |
824 | 0 | for (l = 0; l < *len2 && (*blk2)[l] != sep; l++); |
825 | 0 | if (l < *len2 && (*blk2)[l] == sep) { |
826 | 0 | *len2 = l + 1; |
827 | 0 | return 2; |
828 | 0 | } |
829 | 0 | } |
830 | 0 |
|
831 | 0 | /* If we have found no LF and the buffer is full or the SC is shut, then |
832 | 0 | * the resulting string is made of the concatenation of the pending |
833 | 0 | * blocks (1 or 2). |
834 | 0 | */ |
835 | 0 | if (appctx_app_test(appctx, APPLET_FL_NEW_API)) { |
836 | 0 | if (b_full(&appctx->inbuf) || se_fl_test(appctx->sedesc, SE_FL_SHW)) |
837 | 0 | return ret; |
838 | 0 | } |
839 | 0 | else { |
840 | 0 | struct stconn *sc = appctx_sc(appctx); |
841 | 0 |
|
842 | 0 | if (!channel_may_recv(sc_oc(sc)) || sc->flags & (SC_FL_SHUT_DONE|SC_FL_SHUT_WANTED)) |
843 | 0 | return ret; |
844 | 0 | } |
845 | 0 |
|
846 | 0 | /* No LF yet and not shut yet */ |
847 | 0 | return 0; |
848 | 0 | } Unexecuted instantiation: cli.c:applet_getword_nc Unexecuted instantiation: debug.c:applet_getword_nc Unexecuted instantiation: errors.c:applet_getword_nc Unexecuted instantiation: haproxy.c:applet_getword_nc Unexecuted instantiation: http_ana.c:applet_getword_nc Unexecuted instantiation: log.c:applet_getword_nc Unexecuted instantiation: mworker.c:applet_getword_nc Unexecuted instantiation: peers.c:applet_getword_nc Unexecuted instantiation: pool.c:applet_getword_nc Unexecuted instantiation: proxy.c:applet_getword_nc Unexecuted instantiation: resolvers.c:applet_getword_nc Unexecuted instantiation: ring.c:applet_getword_nc Unexecuted instantiation: server.c:applet_getword_nc Unexecuted instantiation: sink.c:applet_getword_nc Unexecuted instantiation: stats-html.c:applet_getword_nc Unexecuted instantiation: stats.c:applet_getword_nc Unexecuted instantiation: stconn.c:applet_getword_nc Unexecuted instantiation: stick_table.c:applet_getword_nc Unexecuted instantiation: stream.c:applet_getword_nc Unexecuted instantiation: tools.c:applet_getword_nc Unexecuted instantiation: trace.c:applet_getword_nc Unexecuted instantiation: vars.c:applet_getword_nc Unexecuted instantiation: activity.c:applet_getword_nc Unexecuted instantiation: applet.c:applet_getword_nc Unexecuted instantiation: dns.c:applet_getword_nc Unexecuted instantiation: dns_ring.c:applet_getword_nc Unexecuted instantiation: stats-json.c:applet_getword_nc Unexecuted instantiation: cache.c:applet_getword_nc Unexecuted instantiation: flt_spoe.c:applet_getword_nc |
849 | | |
850 | | |
851 | | /* Gets one or two blocks of text representing a line from the applet input |
852 | | * buffer (see appet_get_inbuf). |
853 | | * |
854 | | * Data are not copied. The '\n' is waited for as long as some data can still be |
855 | | * received and the destination is not full. Otherwise, the string may be |
856 | | * returned as is, without the '\n'. |
857 | | * |
858 | | * Return values : |
859 | | * >0 : number of bytes read. Includes the \n if present before len or end. |
860 | | * =0 : no '\n' before end found. <str> is left undefined. |
861 | | * <0 : no more bytes readable because output is shut. |
862 | | * |
863 | | * The status of the corresponding buffer is not changed. The caller must call |
864 | | * applet_skip_input() to update it. |
865 | | */ |
866 | | static inline int applet_getline_nc(const struct appctx *appctx, const char **blk1, size_t *len1, const char **blk2, size_t *len2) |
867 | 0 | { |
868 | 0 | return applet_getword_nc(appctx, blk1, len1, blk2, len2, '\n'); |
869 | 0 | } Unexecuted instantiation: cli.c:applet_getline_nc Unexecuted instantiation: debug.c:applet_getline_nc Unexecuted instantiation: errors.c:applet_getline_nc Unexecuted instantiation: haproxy.c:applet_getline_nc Unexecuted instantiation: http_ana.c:applet_getline_nc Unexecuted instantiation: log.c:applet_getline_nc Unexecuted instantiation: mworker.c:applet_getline_nc Unexecuted instantiation: peers.c:applet_getline_nc Unexecuted instantiation: pool.c:applet_getline_nc Unexecuted instantiation: proxy.c:applet_getline_nc Unexecuted instantiation: resolvers.c:applet_getline_nc Unexecuted instantiation: ring.c:applet_getline_nc Unexecuted instantiation: server.c:applet_getline_nc Unexecuted instantiation: sink.c:applet_getline_nc Unexecuted instantiation: stats-html.c:applet_getline_nc Unexecuted instantiation: stats.c:applet_getline_nc Unexecuted instantiation: stconn.c:applet_getline_nc Unexecuted instantiation: stick_table.c:applet_getline_nc Unexecuted instantiation: stream.c:applet_getline_nc Unexecuted instantiation: tools.c:applet_getline_nc Unexecuted instantiation: trace.c:applet_getline_nc Unexecuted instantiation: vars.c:applet_getline_nc Unexecuted instantiation: activity.c:applet_getline_nc Unexecuted instantiation: applet.c:applet_getline_nc Unexecuted instantiation: dns.c:applet_getline_nc Unexecuted instantiation: dns_ring.c:applet_getline_nc Unexecuted instantiation: stats-json.c:applet_getline_nc Unexecuted instantiation: cache.c:applet_getline_nc Unexecuted instantiation: flt_spoe.c:applet_getline_nc |
870 | | |
871 | | #endif /* _HAPROXY_APPLET_H */ |
872 | | |
873 | | /* |
874 | | * Local variables: |
875 | | * c-indent-level: 8 |
876 | | * c-basic-offset: 8 |
877 | | * End: |
878 | | */ |