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