Commit Graph

64 Commits

Author SHA1 Message Date
Willy Tarreau
2fab37eaf3 DEV: flags/show-sess-to-flags: add support for color output
Highlighting a few fields helps spot them, but only if there are not too
many. What is done here is the following:
  - the first line of each stream is highlighted in white (helps find
    beginning/end in long dumps
  - fields in the form name=value where value starts with upper case
    letters are considered as a state dump (e.g. stconn state) and are
    also highlighted. This results in ~20 pairs. In this case the name
    and value use two different colors (cyan vs yellow) to further help
    find what is being looked for

This is only done when the output is a terminal or when --color=always
is passed. It's also possible to disable it with --color=never or
--no-color.
2023-05-10 17:48:00 +02:00
Willy Tarreau
fd1047ae6e DEV: flags/show-sess-to-flags: only retrieve hex digits from hex fields
Some fields are followed by a comma or a closing parenthesis and we
take them because we read everything that's not a space. Better be
stricter, we're causing warnings about incorrect hex format when
they're passed to printf.
2023-05-10 17:46:10 +02:00
Willy Tarreau
058f246fc5 DEV: flags: add missing stream flags to show-sess-to-flags
I managed to miss strm.flg which appears at the top, in part because
there was no "stream" context. Let's create one and decode the flags.
2023-05-10 17:18:15 +02:00
Willy Tarreau
c147171d57 DEV: flags: add a script to decode most flags in the "show sess all" output
This ugly script decodes most flags in the "show sess all" output and
summarizes them after each stream in an aligned format that makes it
relatively easy to spot the ones of interest. It relies on "flags", and
if not found in various places, will replace its output with a copy-
pastable command that will produce it. h3/quic are not covered yet.

In order to compact the output format, the front and back stream conns
and connections are noted "f.sc", "f.co", "f.h1s", "b.co" etc. That's
sufficiently understandable and entries are grouped by context anyway.

Example of output:

0x7f51a43f7e30: [09/May/2023:20:28:57.183945] id=53704 proto=tcpv4 source=xx.xx.xx.xx:xxxx
  flags=0x100c4a, conn_retries=0, conn_exp=<NEVER> conn_et=0x000 srv_conn=0x464e4e0, pend_pos=(nil) waiting=0 epoch=0xa2
  frontend=public (id=2 mode=http), listener=SSL (id=4) addr=xx.xx.xx.xx:443
  backend=static (id=7 mode=http) addr=xx.xx.xx.xx:50916
  server=srv1 (id=1) addr=xx.xx.xx.xx:80
  task=0x7f51a42190a0 (state=0x00 nice=0 calls=2 rate=0 exp=59s tid=1(1/1) age=0s)
  txn=0x7f51a4397300 flags=0x43000 meth=1 status=200 req.st=MSG_DONE rsp.st=MSG_DATA req.f=0x4c rsp.f=0x0d
  scf=0x57af8b0 flags=0x00000482 state=EST endp=CONN,0x7f51a4269fa0,0x04005001 sub=3 rex=59s wex=59s
      h2s=0x7f51a4269fa0 h2s.id=1 .st=HCR .flg=0x207001 .rxbuf=0@(nil)+0/0
      .sc=0x57af8b0(.flg=0x00000482 .app=0x7f51a43f7e30) .sd=0x5832eb0(.flg=0x04005001)
      .subs=0x57af8c8(ev=3 tl=0x7f51a40dd390 tl.calls=4 tl.ctx=0x57af8b0 tl.fct=sc_conn_io_cb)
      h2c=0x7f51a44144d0 h2c.st0=FRH .err=0 .maxid=1 .lastid=-1 .flg=0x0200 .nbst=1 .nbsc=1
      .fctl_cnt=0 .send_cnt=1 .tree_cnt=1 .orph_cnt=0 .sub=3 .dsi=0 .dbuf=0@(nil)+0/0
      .mbuf=[3..4|32],h=[32730@0x57ec920+16431/32768],t=[32730@0x7f51a4322660+16431/32768] .task=0x5722d40 .exp=<NEVER>
      co0=0x5727120 ctrl=tcpv4 xprt=SSL mux=H2 data=STRM target=LISTENER:0x1cc62d0
      flags=0x80000300 fd=30 fd.state=411 updt=0 fd.tmask=0x2
  scb=0x7f51a4064710 flags=0x00001211 state=EST endp=CONN,0x7f51a433eb50,0x011c0001 sub=0 rex=59s wex=<NEVER>
      h1s=0x7f51a433eb50 h1s.flg=0x4094 .sd.flg=0x11c0001 .req.state=MSG_DONE .res.state=MSG_DATA
      .meth=GET status=200 .sd.flg=0x011c0001 .sc.flg=0x00001211 .sc.app=0x7f51a43f7e30 .subs=(nil)
      h1c=0x7f51a4218b70 h1c.flg=0x80000020 .sub=0 .ibuf=32704@0x57d48c0+56/32768 .obuf=0@(nil)+0/0 .task=0x7f51a408ebb0 .exp=<NEVER>
      co1=0x57264e0 ctrl=tcpv4 xprt=RAW mux=H1 data=STRM target=SERVER:0x464e4e0
      flags=0x00000300 fd=26 fd.state=10122 updt=0 fd.tmask=0x2
  req=0x7f51a43f7e50 (f=0x21840000 an=0x48000 pipe=0 tofwd=0 total=142)
      an_exp=<NEVER> buf=0x7f51a43f7e58 data=(nil) o=0 p=0 i=0 size=0
      htx=0x818e40 flags=0x0 size=0 data=0 used=0 wrap=NO extra=0
  res=0x7f51a43f7ea0 (f=0xa0040101 an=0x24000000 pipe=0 tofwd=-1 total=163472)
      an_exp=<NEVER> buf=0x7f51a43f7ea8 data=0x7f51a43c2f50 o=16328 p=16328 i=16440 size=32768
      htx=0x7f51a43c2f50 flags=0x0 size=32720 data=16328 used=1 wrap=NO extra=3852188
  -----------------------------------
  task.state            0  0
  txn.meth              1  GET
  txn.flg         0x43000  TX_NOT_FIRST TX_CACHE_COOK TX_CACHEABLE
  txn.req.flg        0x4c  HTTP_MSGF_BODYLESS HTTP_MSGF_VER_11 HTTP_MSGF_XFER_LEN
  txn.rsp.flg         0xd  HTTP_MSGF_VER_11 HTTP_MSGF_XFER_LEN HTTP_MSGF_CNT_LEN
  f.sc.flg          0x482  SC_FL_RCV_ONCE SC_FL_WONT_READ SC_FL_EOI
  f.sc.sd.flg   0x4005001  SE_FL_HAVE_NO_DATA SE_FL_EOI SE_FL_NOT_FIRST SE_FL_T_MUX
  f.h2s.flg      0x207001  H2_SF_MORE_HTX_DATA H2_SF_HEADERS_RCVD H2_SF_OUTGOING_DATA H2_SF_HEADERS_SENT H2_SF_ES_RCVD
  f.h2s.sd.flg  0x4005001  SE_FL_HAVE_NO_DATA SE_FL_EOI SE_FL_NOT_FIRST SE_FL_T_MUX
  f.h2c.flg         0x200  H2_CF_DEM_SHORT_READ
  f.co.flg     0x80000300  CO_FL_XPRT_TRACKED CO_FL_XPRT_READY CO_FL_CTRL_READY
  f.co.fd.st        0x19b  FD_POLL_IN FD_EV_ERR_RW FD_EV_READY_R FD_EV_ACTIVE_W FD_EV_ACTIVE_R 0x8
  b.sc.flg         0x1211  SC_FL_SND_NEVERWAIT SC_FL_NEED_ROOM SC_FL_NOHALF SC_FL_ISBACK
  b.sc.sd.flg   0x11c0001  SE_FL_WAIT_DATA SE_FL_WANT_ROOM SE_FL_RCV_MORE SE_FL_MAY_SPLICE SE_FL_T_MUX
  b.h1s.sd.flg  0x11c0001  SE_FL_WAIT_DATA SE_FL_WANT_ROOM SE_FL_RCV_MORE SE_FL_MAY_SPLICE SE_FL_T_MUX
  b.h1s.flg        0x4094  H1S_F_HAVE_O_CONN H1S_F_NOT_FIRST H1S_F_WANT_KAL H1S_F_RX_CONGESTED
  b.h1c.flg    0x80000020  H1C_F_IS_BACK H1C_F_IN_FULL
  b.co.flg          0x300  CO_FL_XPRT_READY CO_FL_CTRL_READY
  b.co.fd.st       0x278a  FD_POLL_OUT FD_POLL_PRI FD_POLL_IN FD_EV_ERR_RW FD_EV_READY_R 0x2008
  req.flg      0x21840000  CF_FLT_ANALYZE CF_DONT_READ CF_AUTO_CONNECT CF_WROTE_DATA
  req.ana         0x48000  AN_REQ_FLT_END AN_REQ_HTTP_XFER_BODY
  req.htx.flg           0  0
  res.flg      0xa0040101  CF_ISRESP CF_FLT_ANALYZE CF_WROTE_DATA CF_WRITE_EVENT CF_READ_EVENT
  res.ana      0x24000000  AN_RES_FLT_END AN_RES_HTTP_XFER_BODY
  res.htx.flg           0  0
  -----------------------------------
2023-05-09 20:38:33 +02:00
Willy Tarreau
946d370d22 BUILD: flags: really restrict the cases where flags are exposed
A number of internal flags started to be exposed to external programs
at the location of their definition since commit 77acaf5af ("MINOR:
flags: add a new file to host flag dumping macros"). This allowed the
"flags" utility to decode many more of them and always correctly. The
condition to expose them was to rely on the preliminary definition of
EOF that indicates that stdio is already included. But this was a
wrong approach. It only guarantees that snprintf() can safely be used
but still causes large functions to be built. But stdio is often
included before some of these includes, so these heavy inline functions
actually have to be compiled in many cases. The result is that the
build time significantly increased, especially with fast compilers
like gcc -O0 which took +50% or TCC which took +100%!

This patch addresses the problem by instead relying on an explicit
macro HA_EXPOSE_FLAGS that the calling program must explicitly define
before including these files. flags.c does this and that's all. The
previous build time is now restored with a speed up of 20 to 50%
depending on the build options.
2022-11-24 08:32:27 +01:00
Christopher Faulet
c8db114afc MINOR: flags/mux-fcgi: Decode FCGI connection and stream flags
The new functions fconn_show_flags() and fstrm_show_flags() decode the flags
state into a string, and are used by dev/flags:

$ /dev/flags/flags fconn 0x3100
fconn->flags = FCGI_CF_GET_VALUES | FCGI_CF_KEEP_CONN | FCGI_CF_MPXS_CONNS

./dev/flags/flags fstrm  0x3300
fstrm->flags = FCGI_SF_WANT_SHUTW | FCGI_SF_WANT_SHUTR | FCGI_SF_OUTGOING_DATA | FCGI_SF_BEGIN_SENT
2022-10-12 17:10:41 +02:00
Christopher Faulet
7c4b2ec09d MINOR: flags/mux-h1: decode H1C and H1S flags
The new functions h1c_show_flags() and h1s_show_flags() decode the flags
state into a string, and are used by dev/flags:

$ /dev/flags/flags h1c 0x2200
h1c->flags = H1C_F_ST_READY | H1C_F_ST_ATTACHED

./dev/flags/flags h1s 0x190
h1s->flags = H1S_F_BODYLESS_RESP | H1S_F_NOT_FIRST | H1S_F_WANT_KAL
2022-09-15 11:01:59 +02:00
Willy Tarreau
439be5838d MINOR: flags/mux-h2: decode H2C and H2S flags
The new functions h2c_show_flags() and h2s_show_flags() decode the flags
state into a string, and are used by dev/flags:

  $ ./dev/flags/flags h2c 0x0600
  h2c->flags = H2_CF_DEM_IN_PROGRESS | H2_CF_DEM_SHORT_READ

  $ ./dev/flags/flags h2s 0x7003
  h2s->flags = H2_SF_HEADERS_RCVD | H2_SF_OUTGOING_DATA | H2_SF_HEADERS_SENT \
             | H2_SF_ES_SENT | H2_SF_ES_RCVD
2022-09-12 19:33:07 +02:00
Willy Tarreau
799e5410b4 MINOR: flags/fd: decode FD flags states
The new function is fd_show_flags() and it reports known FD flags:

  $ ./dev/flags/flags fd 0x000121
  fd->flags = FD_POLL_IN | FD_EV_READY_W | FD_EV_ACTIVE_R
2022-09-12 19:33:07 +02:00
Willy Tarreau
6edae6ff48 MINOR: flags/http_ana: use flag dumping to show http msg states
The function is hmsg_show_flags(). It shows the HTTP_MSGF_* flags.
2022-09-09 17:18:57 +02:00
Willy Tarreau
5349779e40 MINOR: flags/htx: use flag dumping to show htx and start-line flags
The function are respectively htx_show_flags() and hsl_show_flags().
2022-09-09 16:59:29 +02:00
Willy Tarreau
cdefa80e6c DEV: flags: remove the now useless intermediary functions
There's no more point keeping functions that are just wrappers around
other ones, let's directly call them from the main entry point. It helps
visually control the mapping between output formats and their definition
and doesn't require to invent long names. For a bit more readability, the
tmpbuf and its size adopted slightly shorter names.
2022-09-09 16:52:09 +02:00
Willy Tarreau
a8db91ffa2 DEV: flags: remove the now unused SHOW_FLAG() definition
All dump functions were converted, no need to use this macro anymore.
2022-09-09 16:52:09 +02:00
Willy Tarreau
e2afad0af4 MINOR: flags/http_ana: use flag dumping for txn flags
The new function is txn_show_flags(). It dumps the TXN flags
as well as the client and server cookie types.
2022-09-09 16:52:09 +02:00
Willy Tarreau
92a2d3c02b MINOR: flags/task: use flag dumping for task state
The new function is task_show_state().
2022-09-09 16:52:09 +02:00
Willy Tarreau
e9d1283cc5 MINOR: flags/stream: use flag dumping for stream flags
The new function is strm_show_flags(). It dumps the stream flags
as well as the err type under SF_ERR_MASK and the final state under
SF_FINST_MASK.
2022-09-09 16:52:09 +02:00
Willy Tarreau
f4cb98ce56 MINOR: flags/stream: use flag dumping for stream error type
The new function is strm_et_show_flags(). Only the error type is
handled at the moment, as a bit more complex logic is needed to
mix the values and enums present in some fields.
2022-09-09 16:52:09 +02:00
Willy Tarreau
4bab7d81b6 MINOR: flags/stconn: use flag dumping for stconn and sedesc flags
The two new functions are se_show_flags() and sc_show_flags().
Maybe something could be done for SC_ST_* values but as it's a
small enum, a simple switch/case should work fine.
2022-09-09 16:52:08 +02:00
Willy Tarreau
9d9e101689 MINOR: flags/connection: use flag dumping for connection flags
The new function is conn_show_flags(), it only deals with flags. Nothing
is planned for connection error types at the moment.
2022-09-09 16:15:10 +02:00
Willy Tarreau
cdc9ddc8cf MINOR: flags/channel: use flag dumping for channel flags and analysers
The two new functions are chn_show_analysers() and chn_show_flags().
They work on an existing buffer so one was declared in flags.c for this
purpose. File flags.c does not have to know about channel flags anymore.
2022-09-09 16:15:10 +02:00
Willy Tarreau
20273ceec0 DEV: flags: add missing CO_FL_FDLESS connection flag
This was added in 2.6 by commit c78a9698e ("MINOR: connection: add a new
flag CO_FL_FDLESS on fd-less connections") but forgotten in flags.c.
This must be backported to 2.6.
2022-09-09 14:46:15 +02:00
Willy Tarreau
c7ac17412b DEV: flags: fix usage message to reflect available options
The proposed decoding options were not updated after the changes in 2.6,
let's fix that by taking the names from the existing declaration. This
should be backported to 2.6.
2022-09-09 14:26:29 +02:00
Willy Tarreau
fc5de15baa CLEANUP: task: remove the now unused TASK_GLOBAL flag
TASK_GLOBAL was exclusively used by task_unlink_rq(), as such it can be
dropped.
2022-07-01 19:15:14 +02:00
Willy Tarreau
159e3acf5d MEDIUM: task: remove TASK_SHARED_WQ and only use t->tid
TASK_SHARED_WQ was set upon task creation and never changed afterwards.
Thus if a task was created to run anywhere (e.g. a check or a Lua task),
all its timers would always pass through the shared timers queue with a
lock. Now we know that tid<0 indicates a shared task, so we can use that
to decide whether or not to use the shared queue. The task might be
migrated using task_set_affinity() but it's always dequeued first so
the check will still be valid.

Not only this removes a flag that's difficult to keep synchronized with
the thread ID, but it should significantly lower the load on systems with
many checks. A quick test with 5000 servers and fast checks that were
saturating the CPU shows that the check rate increased by 20% (hence the
CPU usage dropped by 17%). It's worth noting that run_task_lists() almost
no longer appears in perf top now.
2022-07-01 19:15:14 +02:00
Willy Tarreau
a577bc281f DEV: flags: reorder a few SC/SE flags
Some stream connector and stream endpoints flags were not printed in
the correct order, they were updated.
2022-05-27 19:33:35 +02:00
Willy Tarreau
2bacf4e34c DEV: flags: rename the "endp" shortcut to "sd" for "stream descriptor"
This way we don't keep the possibly confusing endp one anymore.
2022-05-27 19:33:35 +02:00
Willy Tarreau
0cf0a0458c DEV: flags: fix "siet" shortcut name
It "si->et" was changed to "strm->et" by commit 09b3c5559 ("DEV: flags:
No longer dump SI flags") but this shortcut was missed.
2022-05-27 19:33:35 +02:00
Willy Tarreau
e4ebe261b1 MINOR: stconn: turn SE_FL_WILL_CONSUME to SE_FL_WONT_CONSUME
This flag was the only remaining one that was inverted as a blocking
condition, requiring special handling to preset it on sedesc allocation.
Let's flip it in its definition and accessors.
2022-05-27 19:33:35 +02:00
Willy Tarreau
79775fa499 DEV: flags: use "sc" for stream conns instead of "cs"
"cs" used to stand for "conn_stream" while these objects are now called
"stream connectors", "stconn" or "sc". Let's just use "sc" here.
2022-05-27 19:33:35 +02:00
Willy Tarreau
cb086c6de1 REORG: stconn: rename conn_stream.{c,h} to stconn.{c,h}
There's no more reason for keepin the code and definitions in conn_stream,
let's move all that to stconn. The alphabetical ordering of include files
was adjusted.
2022-05-27 19:33:35 +02:00
Willy Tarreau
79cf6e1f15 CLEANUP: stconn: rename SE_FL_WANT_GET to SE_FL_WILL_CONSUME
This flag indicates the that stream endpoint is willing to consume output
data from the stream. Its new name makes this more explicit. The function
names will be updated accordingly, which will remove the disturbing "get"
everywhere.
2022-05-27 19:33:35 +02:00
Willy Tarreau
15252cd9c0 MEDIUM: stconn: move the RXBLK flags to the stream connector
The following flags are not at all related to the endpoint but to the
connector itself:
  - SE_FL_RXBLK_ROOM
  - SE_FL_RXBLK_BUFF
  - SE_FL_RXBLK_CHAN

As such they have no business staying in the endpoint descriptor and
they must move to the stream connector. They've also been renamed
accordingly to better match what they correspond to (the same name
as the function that sets them).

The rare occurrences of cs_rx_blocked() were replaced by an explicit
test on the list of flags. The reason is that cs_rx_blocked() used to
preserve some tests that are not needed at certain places since already
known. For the same reason SE_FL_RXBLK_ANY wasn't converted. As such it
will later be possible to carefully review these few locations and
eliminate the unneeded flags from the tests. No particular function
was made to test them since they're explicit enough.

It now looks like ci_putchk() and friends could very well place the flag
themselves on the connector when they detect a buffer full condition, as
this would significantly simplify the high-level API. But all usages must
first be reviewed before this simplification can be done. For now it
remains done by applet_put*() instead.
2022-05-27 19:33:35 +02:00
Willy Tarreau
8c02f8de14 CLEANUP: stconn: rename SE_FL_RX_WAIT_EP to SE_FL_HAVE_NO_DATA
It's more explicit this way. The cs_rx_endp_ready() function could be
removed so that the flag is directly tested. In the future it should
be inverted and the few places where it's set (or preserved via
SE_FL_APP_MASK) could be dropped.
2022-05-27 19:33:35 +02:00
Willy Tarreau
b23edc8b8d MINOR: stconn: rename SE_FL_RXBLK_CONN to SE_FL_APPLET_NEED_CONN
This flag is exclusively used when a front applet needs to wait for the
other side to connect (or fail to). Let's give it a more explicit name
and remove the ambiguous function that was used only once.

This also ensures we will not risk to set it back on a new endpoint
after cs_reset_endp() via SE_FL_APP_MASK, because the flag being
specific to the endpoint only and not to the connector, we don't
want to preserve it when replacing the endpoint.
2022-05-27 19:33:35 +02:00
Willy Tarreau
676c8db134 MEDIUM: stconn: remove SE_FL_RXBLK_SHUT
This flag is no more needed, it was only set on shut read to be tested
by cs_rx_blocked() which is now properly tested for shutr as well. The
cs_rx_blk_shut() calls were removed. Interestingly it allowed to remove
a special case in the L7 retry code.

This also ensures we will not risk to set it back on a new endpoint
after cs_reset_endp() via SE_FL_APP_MASK.
2022-05-27 19:33:35 +02:00
Willy Tarreau
cb04166525 CLEANUP: stconn: tree-wide rename stream connector flags CS_FL_* to SC_FL_*
This follows the natural naming. There are roughly 100 changes, all
totally trivial.
2022-05-27 19:33:34 +02:00
Willy Tarreau
b605c4213f CLEANUP: conn_stream: rename the stream endpoint flags CS_EP_* to SE_FL_*
Let's now use the new flag names for the stream endpoint.
2022-05-27 19:33:34 +02:00
Willy Tarreau
030b3e6bcc MINOR: connection: get rid of the CO_FL_ADDR_*_SET flags
Just like for the conn_stream, now that these addresses are dynamically
allocated, there is no single case where the pointer is set without the
corresponding flag, and the flag is used as a permission to dereference
the pointer. Let's just replace the test of the flag with a test of the
pointer and remove all flag assignment. This makes the code clearer
(especially in "if" conditions) and saves the need for future code to
think about properly setting the flag after setting the pointer.
2022-05-02 17:47:46 +02:00
Willy Tarreau
04e9acaef4 MINOR: conn_stream: remove the now unused CS_FL_ADDR_*_SET flags
These flags indicate that the ->src or ->dst field in the conn_stream
is not null, which is something the caller already sees (and even tests
from the two sets of functions that set them). They maintain some burden
because an agent trying to set a source or destination has to manually
set the flags in addition to setting the pointer, so they provide no
value anymore, let's drop them.
2022-05-02 17:43:51 +02:00
Willy Tarreau
03bd3952a6 MEDIUM: stream: remove the confusing SF_ADDR_SET flag
This flag is no longer needed now that it must always match the presence
of a destination address on the backend conn_stream. Worse, before previous
patch, if it were to be accidently removed while the address is present, it
could result in a leak of that address since alloc_dst_address() would first
be called to flush it.

Its usage has a long history where addresses were stored in an area shared
with the connection, but as this is no longer the case, there's no reason
for putting this burden onto application-level code that should not focus
on setting obscure flags.

The only place where that made a small difference is in the dequeuing code
in case of queue redistribution, because previously the code would first
clear the flag, and only later when trying to deal with the queue, would
release the address. It's not even certain whether there would exist a
code path going to connect_server() without calling pendconn_dequeue()
first (e.g. retries on queue timeout maybe?).

Now the pendconn_dequeue() code will rely on SF_ASSIGNED to decide to
clear and release the address, since that flag is always set while in
a server's queue, and its clearance implies that we don't want to keep
the address. At least it remains consistent and there's no more risk of
leaking it.
2022-05-02 16:56:01 +02:00
Christopher Faulet
09b3c5559e DEV: flags: No longer dump SI flags
stream-interface API is no longer used. And there is no more SI flags. Thus,
the stream-interface's flags are no longer dumped by "flags" tool.
2022-04-13 15:10:16 +02:00
Christopher Faulet
a0bdec350f MEDIUM: stream-int/conn-stream: Move blocking flags from SI to CS
Remaining flags and associated functions are move in the conn-stream
scope. These flags are added on the endpoint and not the conn-stream
itself. This way it will be possible to get them from the mux or the
applet. The functions to get or set these flags are renamed accordingly with
the "cs_" prefix and updated to manipualte a conn-stream instead of a
stream-interface.
2022-04-13 15:10:15 +02:00
Christopher Faulet
50264b41c8 MEDIUM: stream-int: Move SI err_type in the stream
Only the server side is concerned by the stream-interface error type. It is
useless to have an err_type field on the client side. So, it is now move to
the stream. SI_ET_* are renames STRM_ET_* and moved in stream-t.h header
file.
2022-04-13 15:10:14 +02:00
Christopher Faulet
78ed7f247b CLEANUP: stream-int: Remove unused SI_FL_CLEAN_ABRT flag
This flag is unused. So remove it to be able to remove the stream-interface.
2022-04-13 15:10:14 +02:00
Christopher Faulet
d139138bbc MINOR: stream-int: Remove SI_FL_SRC_ADDR to rely on stream flags instead
Flag to get the source ip/port with getsockname is now handled at the stream
level. Thus SI_FL_SRC_ADDR stream-int flag is replaced by SF_SRC_ADDR stream
flag.
2022-04-13 15:10:14 +02:00
Christopher Faulet
a728518c15 MINOR: stream-int: Remove SI_FL_INDEP_STR to rely on CS flags instead
Flag to consider a stream as indepenent is now handled at the conn-stream
level. Thus SI_FL_INDEP_STR stream-int flag is replaced by CS_FL_INDEP_STR
conn-stream flags.
2022-04-13 15:10:14 +02:00
Christopher Faulet
974da9f8a4 MINOR: stream-int: Remove SI_FL_DONT_WAKE to rely on CS flags instead
Flag to not wake the stream up on I/O is now handled at the conn-stream
level. Thus SI_FL_DONT_WAKE stream-int flag is replaced by CS_FL_DONT_WAKE
conn-stream flags.
2022-04-13 15:10:14 +02:00
Christopher Faulet
8abe712749 MINOR: stream-int: Remove SI_FL_NOLINGER/NOHALF to rely on CS flags instead
Flags to disable lingering and half-close are now handled at the conn-stream
level. Thus SI_FL_NOLINGER and SI_FL_NOHALF stream-int flags are replaced by
CS_FL_NOLINGER and CS_FL_NOHALF conn-stream flags.
2022-04-13 15:10:14 +02:00
Christopher Faulet
9a52123800 MINOR: stream-int: Remove SI_FL_KILL_CON to rely on conn-stream endpoint only
Instead of setting a stream-interface flag to then set the corresponding
conn-stream endpoint flag, we now only rely the conn-stream endoint. Thus
SI_FL_KILL_CON is replaced by CS_EP_KILL_CONN.

In addition si_must_kill_conn() is replaced by cs_must_kill_conn().
2022-04-13 15:10:14 +02:00
Christopher Faulet
6cd56d5a69 MEDIUM: conn-stream: Use endpoint error instead of conn-stream error
Instead of relying on the conn-stream error, via CS_FL_ERR flags, we now
directly use the error at the endpoint level with the flag CS_EP_ERROR. It
should be safe to do so. But we must be careful because it is still possible
that an error is processed too early. Anyway, a conn-stream has always a
valid endpoint, maybe detached from any endpoint, but valid.
2022-04-13 15:10:14 +02:00