mirror of
https://github.com/haproxy/haproxy.git
synced 2026-04-20 22:01:49 -04:00
MINOR: htx: Add a function to retrieve the HTTP version from a start-line
htx_sl_vsn() function can now be used to retrieve the ist string representing the HTTP version from a start-line passed as parameter. This function takes care to return the right part of the start-line, depending on its type (request or response).
This commit is contained in:
parent
e6a8ef5521
commit
9951f9cf85
1 changed files with 5 additions and 0 deletions
|
|
@ -98,6 +98,11 @@ static inline struct ist htx_sl_p3(const struct htx_sl *sl)
|
|||
return ist2(HTX_SL_P3_PTR(sl), HTX_SL_P3_LEN(sl));
|
||||
}
|
||||
|
||||
static inline struct ist htx_sl_vsn(const struct htx_sl *sl)
|
||||
{
|
||||
return ((sl->flags & HTX_SL_F_IS_RESP) ? htx_sl_p1(sl) : htx_sl_p3(sl));
|
||||
}
|
||||
|
||||
static inline struct ist htx_sl_req_meth(const struct htx_sl *sl)
|
||||
{
|
||||
return htx_sl_p1(sl);
|
||||
|
|
|
|||
Loading…
Reference in a new issue