mirror of
https://github.com/OpenVPN/openvpn3.git
synced 2024-09-20 04:02:15 +02:00
HTTP parser : change all char variables to unsigned char
so as to be more straightforward with unicode.
This commit is contained in:
parent
982f57c0f4
commit
7caa2817f0
@ -34,19 +34,19 @@ namespace openvpn {
|
||||
namespace Util {
|
||||
|
||||
// Check if a byte is an HTTP character.
|
||||
inline bool is_char(int c)
|
||||
inline bool is_char(const unsigned char c)
|
||||
{
|
||||
return c >= 0 && c <= 127;
|
||||
}
|
||||
|
||||
// Check if a byte is an HTTP control character.
|
||||
inline bool is_ctl(int c)
|
||||
inline bool is_ctl(const unsigned char c)
|
||||
{
|
||||
return (c >= 0 && c <= 31) || (c == 127);
|
||||
}
|
||||
|
||||
// Check if a byte is defined as an HTTP tspecial character.
|
||||
inline bool is_tspecial(int c)
|
||||
inline bool is_tspecial(const unsigned char c)
|
||||
{
|
||||
switch (c)
|
||||
{
|
||||
@ -61,7 +61,7 @@ namespace openvpn {
|
||||
}
|
||||
|
||||
// Check if a byte is a digit.
|
||||
inline bool is_digit(int c)
|
||||
inline bool is_digit(const unsigned char c)
|
||||
{
|
||||
return c >= '0' && c <= '9';
|
||||
}
|
||||
|
@ -110,7 +110,7 @@ namespace openvpn {
|
||||
}
|
||||
|
||||
// Parse some HTTP reply data.
|
||||
status consume(Reply& req, const char input)
|
||||
status consume(Reply& req, const unsigned char input)
|
||||
{
|
||||
switch (state_)
|
||||
{
|
||||
|
@ -121,7 +121,7 @@ namespace openvpn {
|
||||
}
|
||||
|
||||
// Parse some HTTP request data.
|
||||
status consume(Request& req, const char input)
|
||||
status consume(Request& req, const unsigned char input)
|
||||
{
|
||||
switch (state_)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user