mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-13 23:14:46 +00:00
MINOR: h2: add a function to report pseudo-header names
For debugging we need to be able to dump pseudo headers when we know their name, let's put this there as we already have the other way around.
This commit is contained in:
parent
bb39b4945b
commit
3083276187
@ -190,6 +190,20 @@ static inline int h2_str_to_phdr(const struct ist str)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* returns the pseudo-header name <num> as a string, or ":UNKNOWN" if unknown */
|
||||
static inline const char *h2_phdr_to_str(int phdr)
|
||||
{
|
||||
switch (phdr) {
|
||||
case H2_PHDR_IDX_NONE: return ":NONE";
|
||||
case H2_PHDR_IDX_AUTH: return ":authority";
|
||||
case H2_PHDR_IDX_METH: return ":method";
|
||||
case H2_PHDR_IDX_PATH: return ":path";
|
||||
case H2_PHDR_IDX_SCHM: return ":scheme";
|
||||
case H2_PHDR_IDX_STAT: return ":status";
|
||||
case H2_PHDR_IDX_HOST: return "Host";
|
||||
default: return ":UNKNOWN";
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* _COMMON_H2_H */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user