PROXY Protocol check with IOBufferReader If the buffer has PROXY Protocol, it will be consumed by this function. */
| 51 | If the buffer has PROXY Protocol, it will be consumed by this function. |
| 52 | */ |
| 53 | bool |
| 54 | NetVConnection::has_proxy_protocol(IOBufferReader *reader) |
| 55 | { |
| 56 | char buf[PPv1_CONNECTION_HEADER_LEN_MAX + 1]; |
| 57 | swoc::TextView tv; |
| 58 | tv.assign(buf, reader->memcpy(buf, sizeof(buf), 0)); |
| 59 | |
| 60 | size_t len = proxy_protocol_parse(&this->pp_info, tv); |
| 61 | |
| 62 | if (len > 0) { |
| 63 | reader->consume(len); |
| 64 | return true; |
| 65 | } |
| 66 | |
| 67 | return false; |
| 68 | } |
| 69 | |
| 70 | /** |
| 71 | PROXY Protocol check with buffer |
no test coverage detected