From 8278dec2dd0526dd57e6ca17aa76834ad42a3866 Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Tue, 19 Jun 2018 15:35:05 +0300 Subject: [PATCH 01/22] Micro-optimization --- aiohttp/base_protocol.py | 3 +++ aiohttp/web_protocol.py | 13 +++++++++++-- aiohttp/web_request.py | 2 +- aiohttp/web_urldispatcher.py | 6 +++--- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/aiohttp/base_protocol.py b/aiohttp/base_protocol.py index d7c90eef544..43c0c46b770 100644 --- a/aiohttp/base_protocol.py +++ b/aiohttp/base_protocol.py @@ -4,6 +4,9 @@ class BaseProtocol(asyncio.Protocol): + __slots__ = ('_loop', '_paused', '_drain_waiter', + '_connection_lost', 'transport') + def __init__(self, loop=None): if loop is None: self._loop = asyncio.get_event_loop() diff --git a/aiohttp/web_protocol.py b/aiohttp/web_protocol.py index 78213665bf3..8d9a7a5ef35 100644 --- a/aiohttp/web_protocol.py +++ b/aiohttp/web_protocol.py @@ -75,10 +75,17 @@ class RequestHandler(BaseProtocol): :param int max_headers: Optional maximum header size """ - _request_count = 0 - _keepalive = False # keep transport open KEEPALIVE_RESCHEDULE_DELAY = 1 + __slots__ = ('_request_count', '_keep_alive', '_manager', + '_request_handler', '_request_factory', '_tcp_keepalive', + '_keepalive_time', '_keepalive_handle', '_keepalive_timeout', + '_lingering_time', '_messages', '_message_tail', + '_waiter', '_error_handler', '_task_handler', + '_upgrade', '_payload_parser', '_request_parser', + '_reading_paused', 'logger', 'debug', 'access_log', + 'access_logger', '_close', '_force_close') + def __init__(self, manager, *, loop=None, keepalive_timeout=75, # NGINX default value is 75 secs tcp_keepalive=True, @@ -94,6 +101,8 @@ def __init__(self, manager, *, loop=None, super().__init__(loop=loop) + self._request_count = 0 + self._keepalive = False self._manager = manager self._request_handler = manager.request_handler self._request_factory = manager.request_factory diff --git a/aiohttp/web_request.py b/aiohttp/web_request.py index d3f341bb958..896506bca1f 100644 --- a/aiohttp/web_request.py +++ b/aiohttp/web_request.py @@ -700,5 +700,5 @@ async def _prepare_hook(self, response): match_info = self._match_info if match_info is None: return - for app in match_info.apps: + for app in match_info._apps: await app.on_response_prepare.send(self, response) diff --git a/aiohttp/web_urldispatcher.py b/aiohttp/web_urldispatcher.py index 3d2cf893799..9d856488144 100644 --- a/aiohttp/web_urldispatcher.py +++ b/aiohttp/web_urldispatcher.py @@ -161,7 +161,7 @@ class UrlMappingMatchInfo(dict, AbstractMatchInfo): def __init__(self, match_dict, route): super().__init__(match_dict) self._route = route - self._apps = () + self._apps = [] self._current_app = None self._frozen = False @@ -186,14 +186,14 @@ def get_info(self): @property def apps(self): - return self._apps + return tuple(self._apps) def add_app(self, app): if self._frozen: raise RuntimeError("Cannot change apps stack after .freeze() call") if self._current_app is None: self._current_app = app - self._apps = (app,) + self._apps + self._apps.insert(0, app) @property def current_app(self): From 517ffe124bd2d4714e9e37dc81044f7ccaf59236 Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Tue, 19 Jun 2018 16:55:43 +0300 Subject: [PATCH 02/22] Use faster attr check instead of isinstance --- aiohttp/web_exceptions.py | 2 ++ aiohttp/web_protocol.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/aiohttp/web_exceptions.py b/aiohttp/web_exceptions.py index 4d948f4ee55..ab8d5ade89f 100644 --- a/aiohttp/web_exceptions.py +++ b/aiohttp/web_exceptions.py @@ -74,6 +74,8 @@ class HTTPException(Response, Exception): status_code = -1 empty_body = False + __http_exception__ = True + def __init__(self, *, headers=None, reason=None, body=None, text=None, content_type=None): Response.__init__(self, status=self.status_code, diff --git a/aiohttp/web_protocol.py b/aiohttp/web_protocol.py index 8d9a7a5ef35..feda1e47899 100644 --- a/aiohttp/web_protocol.py +++ b/aiohttp/web_protocol.py @@ -400,7 +400,7 @@ async def start(self): resp = self.handle_error(request, 500, exc) else: # Deprecation warning (See #2415) - if isinstance(resp, HTTPException): + if getattr(resp, '__http_exception__', False): warnings.warn( "returning HTTPException object is deprecated " "(#2415) and will be removed, " From 3d72768e7fe4cc92f9f18cdb696cab7ac9f3b351 Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Tue, 19 Jun 2018 17:32:10 +0300 Subject: [PATCH 03/22] Add changelog --- CHANGES/3095.feature | 1 + 1 file changed, 1 insertion(+) create mode 100644 CHANGES/3095.feature diff --git a/CHANGES/3095.feature b/CHANGES/3095.feature new file mode 100644 index 00000000000..998f4849e43 --- /dev/null +++ b/CHANGES/3095.feature @@ -0,0 +1 @@ +Minor server optimizations \ No newline at end of file From e2e2fd252a18fd9120fb4ebe4f4eb4a42fe7e620 Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Tue, 19 Jun 2018 21:52:51 +0300 Subject: [PATCH 04/22] Optimize Cython parser --- aiohttp/_http_parser.pyx | 66 +++++++++++++++++++++------------------- 1 file changed, 35 insertions(+), 31 deletions(-) diff --git a/aiohttp/_http_parser.pyx b/aiohttp/_http_parser.pyx index 1bdacb53dc4..0b3aa3b5b4f 100644 --- a/aiohttp/_http_parser.pyx +++ b/aiohttp/_http_parser.pyx @@ -7,25 +7,43 @@ from cpython.mem cimport PyMem_Malloc, PyMem_Free from cpython cimport PyObject_GetBuffer, PyBuffer_Release, PyBUF_SIMPLE, \ Py_buffer, PyBytes_AsString -from multidict import CIMultiDict, CIMultiDictProxy -from yarl import URL +from multidict import (CIMultiDict as _CIMultiDict, + CIMultiDictProxy as _CIMultiDictProxy) +from yarl import URL as _URL from aiohttp import hdrs from .http_exceptions import ( BadHttpMessage, BadStatusLine, InvalidHeader, LineTooLong, InvalidURLError, PayloadEncodingError, ContentLengthError, TransferEncodingError) -from .http_writer import HttpVersion, HttpVersion10, HttpVersion11 -from .http_parser import RawRequestMessage, RawResponseMessage, DeflateBuffer -from .streams import EMPTY_PAYLOAD, StreamReader +from .http_writer import (HttpVersion as _HttpVersion, + HttpVersion10 as _HttpVersion10, + HttpVersion11 as _HttpVersion11) +from .http_parser import (RawRequestMessage as _RawRequestMessage, + RawResponseMessage as _RawResponseMessage, + DeflateBuffer as _DeflateBuffer) +from .streams import (EMPTY_PAYLOAD as _EMPTY_PAYLOAD, + StreamReader as _StreamReader) cimport cython from . cimport _cparser as cparser -__all__ = ('HttpRequestParserC', 'HttpResponseMessageC', 'parse_url') - +__all__ = ('HttpRequestParserC', 'HttpResponseMessageC') +cdef object URL = _URL cdef object URL_build = URL.build +cdef object CIMultiDict = _CIMultiDict +cdef object CIMultiDictProxy = _CIMultiDictProxy +cdef object HttpVersion = _HttpVersion +cdef object HttpVersion10 = _HttpVersion10 +cdef object HttpVersion11 = _HttpVersion11 +cdef object SEC_WEBSOCKET_KEY1 = hdrs.SEC_WEBSOCKET_KEY1 +cdef object CONTENT_ENCODING = hdrs.CONTENT_ENCODING +cdef object EMPTY_PAYLOAD = _EMPTY_PAYLOAD +cdef object StreamReader = _StreamReader +cdef object RawRequestMessage = _RawRequestMessage +cdef object RawResponseMessage = _RawResponseMessage +cdef object DeflateBuffer = _DeflateBuffer @cython.internal cdef class HttpParser: @@ -84,7 +102,7 @@ cdef class HttpParser: object protocol, object loop, object timer=None, size_t max_line_size=8190, size_t max_headers=32768, size_t max_field_size=8190, payload_exception=None, - response_with_body=True, auto_decompress=True): + bint response_with_body=True, bint auto_decompress=True): cparser.http_parser_init(self._cparser, mode) self._cparser.data = self self._cparser.content_length = 0 @@ -160,12 +178,7 @@ cdef class HttpParser: self._header_value += val self._raw_header_value += raw_val - cdef _on_headers_complete(self, - ENCODING='utf-8', - ENCODING_ERR='surrogateescape', - CONTENT_ENCODING=hdrs.CONTENT_ENCODING, - SEC_WEBSOCKET_KEY1=hdrs.SEC_WEBSOCKET_KEY1, - SUPPORTED=('gzip', 'deflate', 'br')): + cdef _on_headers_complete(self): self._process_header() method = cparser.http_method_str( self._cparser.method) @@ -187,12 +200,12 @@ cdef class HttpParser: enc = headers.get(CONTENT_ENCODING) if enc: enc = enc.lower() - if enc in SUPPORTED: + if enc in ('gzip', 'deflate', 'br'): encoding = enc if self._cparser.type == cparser.HTTP_REQUEST: msg = RawRequestMessage( - method.decode(ENCODING, ENCODING_ERR), self._path, + method.decode('utf-8', 'surrogateescape'), self._path, self.http_version(), headers, raw_headers, should_close, encoding, upgrade, chunked, self._url) else: @@ -313,7 +326,7 @@ cdef class HttpRequestParser(HttpParser): def __init__(self, protocol, loop, timer=None, size_t max_line_size=8190, size_t max_headers=32768, size_t max_field_size=8190, payload_exception=None, - response_with_body=True, read_until_eof=False): + bint response_with_body=True, bint read_until_eof=False): self._init(cparser.HTTP_REQUEST, protocol, loop, timer, max_line_size, max_headers, max_field_size, payload_exception, response_with_body) @@ -332,6 +345,7 @@ cdef class HttpRequestParser(HttpParser): py_buf.len) finally: PyBuffer_Release(&py_buf) + # del self._buf[:] self._buf.clear() @@ -349,6 +363,7 @@ cdef class HttpResponseParser(HttpParser): cdef object _on_status_complete(self): if self._buf: self._reason = self._buf.decode('utf-8', 'surrogateescape') + # del self._buf[:] self._buf.clear() @@ -357,6 +372,8 @@ cdef int cb_on_message_begin(cparser.http_parser* parser) except -1: pyparser._started = True pyparser._headers = CIMultiDict() + # del pyparser._raw_headers[:] + # del pyparser._buf[:] pyparser._raw_headers = [] pyparser._buf.clear() pyparser._path = None @@ -529,20 +546,7 @@ cdef parser_error_from_errno(cparser.http_errno errno): return cls(desc.decode('latin-1')) -def parse_url(url): - cdef: - Py_buffer py_buf - char* buf_data - - PyObject_GetBuffer(url, &py_buf, PyBUF_SIMPLE) - try: - buf_data = py_buf.buf - return _parse_url(buf_data, py_buf.len) - finally: - PyBuffer_Release(&py_buf) - - -def _parse_url(char* buf_data, size_t length): +cdef _parse_url(char* buf_data, size_t length): cdef: cparser.http_parser_url* parsed int res From 1927fd6d8e5b868d6b553f94c7080f8dd4c60669 Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Tue, 19 Jun 2018 22:20:51 +0300 Subject: [PATCH 05/22] Improve cythonized parser --- aiohttp/_http_parser.pyx | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/aiohttp/_http_parser.pyx b/aiohttp/_http_parser.pyx index 0b3aa3b5b4f..e41283a86ee 100644 --- a/aiohttp/_http_parser.pyx +++ b/aiohttp/_http_parser.pyx @@ -354,8 +354,8 @@ cdef class HttpResponseParser(HttpParser): def __init__(self, protocol, loop, timer=None, size_t max_line_size=8190, size_t max_headers=32768, size_t max_field_size=8190, payload_exception=None, - response_with_body=True, read_until_eof=False, - auto_decompress=True): + bint response_with_body=True, bint read_until_eof=False, + bint auto_decompress=True): self._init(cparser.HTTP_RESPONSE, protocol, loop, timer, max_line_size, max_headers, max_field_size, payload_exception, response_with_body, auto_decompress) @@ -546,6 +546,19 @@ cdef parser_error_from_errno(cparser.http_errno errno): return cls(desc.decode('latin-1')) +def parse_url(url): + cdef: + Py_buffer py_buf + char* buf_data + + PyObject_GetBuffer(url, &py_buf, PyBUF_SIMPLE) + try: + buf_data = py_buf.buf + return _parse_url(buf_data, py_buf.len) + finally: + PyBuffer_Release(&py_buf) + + cdef _parse_url(char* buf_data, size_t length): cdef: cparser.http_parser_url* parsed From 530062a1de296aa2cb688fa32e06c3c169fb6fda Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Wed, 20 Jun 2018 00:14:54 +0300 Subject: [PATCH 06/22] Resize bytearray fast --- aiohttp/_http_parser.pyx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/aiohttp/_http_parser.pyx b/aiohttp/_http_parser.pyx index e41283a86ee..06846075943 100644 --- a/aiohttp/_http_parser.pyx +++ b/aiohttp/_http_parser.pyx @@ -27,6 +27,9 @@ from .streams import (EMPTY_PAYLOAD as _EMPTY_PAYLOAD, cimport cython from . cimport _cparser as cparser +cdef extern from "Python.h": + int PyByteArray_Resize(object, Py_ssize_t) except -1 + __all__ = ('HttpRequestParserC', 'HttpResponseMessageC') @@ -345,8 +348,7 @@ cdef class HttpRequestParser(HttpParser): py_buf.len) finally: PyBuffer_Release(&py_buf) - # del self._buf[:] - self._buf.clear() + PyByteArray_Resize(self._buf, 0) cdef class HttpResponseParser(HttpParser): @@ -363,8 +365,7 @@ cdef class HttpResponseParser(HttpParser): cdef object _on_status_complete(self): if self._buf: self._reason = self._buf.decode('utf-8', 'surrogateescape') - # del self._buf[:] - self._buf.clear() + PyByteArray_Resize(self._buf, 0) cdef int cb_on_message_begin(cparser.http_parser* parser) except -1: @@ -373,9 +374,8 @@ cdef int cb_on_message_begin(cparser.http_parser* parser) except -1: pyparser._started = True pyparser._headers = CIMultiDict() # del pyparser._raw_headers[:] - # del pyparser._buf[:] pyparser._raw_headers = [] - pyparser._buf.clear() + PyByteArray_Resize(pyparser._buf, 0) pyparser._path = None pyparser._reason = None return 0 From 8c39222a6cfc5c51276316b64cf7c627dbbb85fd Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Wed, 20 Jun 2018 10:26:55 +0300 Subject: [PATCH 07/22] Fix tests --- aiohttp/_http_parser.pyx | 15 ++++++++++++++- tests/test_http_parser.py | 6 +++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/aiohttp/_http_parser.pyx b/aiohttp/_http_parser.pyx index 06846075943..1aeae1d1c33 100644 --- a/aiohttp/_http_parser.pyx +++ b/aiohttp/_http_parser.pyx @@ -4,6 +4,7 @@ # from __future__ import absolute_import, print_function from cpython.mem cimport PyMem_Malloc, PyMem_Free +from libc.string import memcpy from cpython cimport PyObject_GetBuffer, PyBuffer_Release, PyBUF_SIMPLE, \ Py_buffer, PyBytes_AsString @@ -29,7 +30,8 @@ from . cimport _cparser as cparser cdef extern from "Python.h": int PyByteArray_Resize(object, Py_ssize_t) except -1 - + Py_ssize_t PyByteArray_Size(object) except -1 + char* PyByteArray_AsString(object) __all__ = ('HttpRequestParserC', 'HttpResponseMessageC') @@ -48,6 +50,16 @@ cdef object RawRequestMessage = _RawRequestMessage cdef object RawResponseMessage = _RawResponseMessage cdef object DeflateBuffer = _DeflateBuffer + +cdef object extend(object buf, char* at, size_t length): + cdef Py_ssize_t s + cdef char* ptr + s = PyByteArray_Size(buf) + PyByteArray_Resize(buf, s + length) + ptr = PyByteArray_AsString(buf) + memcpy(ptr + s, at, length) + + @cython.internal cdef class HttpParser: @@ -388,6 +400,7 @@ cdef int cb_on_url(cparser.http_parser* parser, if length > pyparser._max_line_size: raise LineTooLong( 'Status line is too long', pyparser._max_line_size, length) + # extend(pyparser._buf, at, length) pyparser._buf.extend(at[:length]) except BaseException as ex: pyparser._last_error = ex diff --git a/tests/test_http_parser.py b/tests/test_http_parser.py index 5422dd2390d..93a780e343a 100644 --- a/tests/test_http_parser.py +++ b/tests/test_http_parser.py @@ -23,9 +23,9 @@ RESPONSE_PARSERS = [HttpResponseParserPy] try: - from aiohttp import _http_parser - REQUEST_PARSERS.append(_http_parser.HttpRequestParser) - RESPONSE_PARSERS.append(_http_parser.HttpResponseParser) + from aiohttp.http_parser import HttpRequestParserC, HttpResponseParserC + REQUEST_PARSERS.append(HttpRequestParserC) + RESPONSE_PARSERS.append(HttpResponseParserC) except ImportError: # pragma: no cover pass From a5d5ec46486372ee63b84ba5599d6c42b18d6669 Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Wed, 20 Jun 2018 10:38:38 +0300 Subject: [PATCH 08/22] Implement fast bytearray extending --- aiohttp/_http_parser.pyx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/aiohttp/_http_parser.pyx b/aiohttp/_http_parser.pyx index 1aeae1d1c33..4b1659f8540 100644 --- a/aiohttp/_http_parser.pyx +++ b/aiohttp/_http_parser.pyx @@ -400,8 +400,7 @@ cdef int cb_on_url(cparser.http_parser* parser, if length > pyparser._max_line_size: raise LineTooLong( 'Status line is too long', pyparser._max_line_size, length) - # extend(pyparser._buf, at, length) - pyparser._buf.extend(at[:length]) + extend(pyparser._buf, at, length) except BaseException as ex: pyparser._last_error = ex return -1 @@ -417,7 +416,7 @@ cdef int cb_on_status(cparser.http_parser* parser, if length > pyparser._max_line_size: raise LineTooLong( 'Status line is too long', pyparser._max_line_size, length) - pyparser._buf.extend(at[:length]) + extend(pyparser._buf, at, length) except BaseException as ex: pyparser._last_error = ex return -1 From 8a28113e842dcdc417c455c875aab242c71cc466 Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Wed, 20 Jun 2018 13:40:56 +0300 Subject: [PATCH 09/22] Move forward --- aiohttp/_http_parser.pyx | 195 +++++++++++++++++++++++++++++++++++--- aiohttp/http_parser.py | 15 ++- tests/test_http_parser.py | 109 +++++++++++++++------ 3 files changed, 270 insertions(+), 49 deletions(-) diff --git a/aiohttp/_http_parser.pyx b/aiohttp/_http_parser.pyx index 4b1659f8540..95d3435c47e 100644 --- a/aiohttp/_http_parser.pyx +++ b/aiohttp/_http_parser.pyx @@ -4,7 +4,7 @@ # from __future__ import absolute_import, print_function from cpython.mem cimport PyMem_Malloc, PyMem_Free -from libc.string import memcpy +from libc.string cimport memcpy from cpython cimport PyObject_GetBuffer, PyBuffer_Release, PyBUF_SIMPLE, \ Py_buffer, PyBytes_AsString @@ -19,21 +19,23 @@ from .http_exceptions import ( from .http_writer import (HttpVersion as _HttpVersion, HttpVersion10 as _HttpVersion10, HttpVersion11 as _HttpVersion11) -from .http_parser import (RawRequestMessage as _RawRequestMessage, - RawResponseMessage as _RawResponseMessage, - DeflateBuffer as _DeflateBuffer) +from .http_parser import DeflateBuffer as _DeflateBuffer from .streams import (EMPTY_PAYLOAD as _EMPTY_PAYLOAD, StreamReader as _StreamReader) cimport cython from . cimport _cparser as cparser + +DEF DEFAULT_FREELIST_SIZE = 250 + cdef extern from "Python.h": int PyByteArray_Resize(object, Py_ssize_t) except -1 Py_ssize_t PyByteArray_Size(object) except -1 char* PyByteArray_AsString(object) -__all__ = ('HttpRequestParserC', 'HttpResponseMessageC') +__all__ = ('HttpRequestParser', 'HttpResponseParser', + 'RawRequestMessage', 'RawResponseMessage') cdef object URL = _URL cdef object URL_build = URL.build @@ -46,8 +48,6 @@ cdef object SEC_WEBSOCKET_KEY1 = hdrs.SEC_WEBSOCKET_KEY1 cdef object CONTENT_ENCODING = hdrs.CONTENT_ENCODING cdef object EMPTY_PAYLOAD = _EMPTY_PAYLOAD cdef object StreamReader = _StreamReader -cdef object RawRequestMessage = _RawRequestMessage -cdef object RawResponseMessage = _RawResponseMessage cdef object DeflateBuffer = _DeflateBuffer @@ -60,6 +60,171 @@ cdef object extend(object buf, char* at, size_t length): memcpy(ptr + s, at, length) +@cython.freelist(DEFAULT_FREELIST_SIZE) +cdef class RawRequestMessage: + cdef readonly str method + cdef readonly str path + cdef readonly object version # HttpVersion + cdef readonly object headers # CIMultiDict + cdef readonly object raw_headers # tuple + cdef readonly object should_close + cdef readonly object compression + cdef readonly object upgrade + cdef readonly object chunked + cdef readonly object url # yarl.URL + + def __init__(self, method, path, version, headers, raw_headers, + should_close, compression, upgrade, chunked, url): + self.method = method + self.path = path + self.version = version + self.headers = headers + self.raw_headers = raw_headers + self.should_close = should_close + self.compression = compression + self.upgrade = upgrade + self.chunked = chunked + self.url = url + + def __repr__(self): + info = [] + info.append(("method", self.method)) + info.append(("path", self.path)) + info.append(("version", self.version)) + info.append(("headers", self.headers)) + info.append(("raw_headers", self.raw_headers)) + info.append(("should_close", self.should_close)) + info.append(("compression", self.compression)) + info.append(("upgrade", self.upgrade)) + info.append(("chunked", self.chunked)) + info.append(("url", self.url)) + sinfo = ', '.join(name + '=' + repr(val) for name, val in info) + return '' + + def _replace(self, **dct): + return self._replace_impl(dct) + + cdef _replace_impl(self, dct): + cdef RawRequestMessage ret + ret = _new_request_message(self.method, + self.path, + self.version, + self.headers, + self.raw_headers, + self.should_close, + self.compression, + self.upgrade, + self.chunked, + self.url) + if "method" in dct: + ret.method = dct["method"] + if "path" in dct: + ret.path = dct["path"] + if "version" in dct: + ret.version = dct["version"] + if "headers" in dct: + ret.headers = dct["headers"] + if "raw_headers" in dct: + ret.raw_headers = dct["raw_headers"] + if "should_close" in dct: + ret.should_close = dct["should_close"] + if "compression" in dct: + ret.compression = dct["compression"] + if "upgrade" in dct: + ret.upgrade = dct["upgrade"] + if "chunked" in dct: + ret.chunked = dct["chunked"] + if "url" in dct: + ret.url = dct["url"] + return ret + +cdef _new_request_message(str method, + str path, + object version, + object headers, + object raw_headers, + bint should_close, + object compression, + bint upgrade, + bint chunked, + object url): + cdef RawRequestMessage ret + ret = RawRequestMessage.__new__(RawRequestMessage) + ret.method = method + ret.path = path + ret.version = version + ret.headers = headers + ret.raw_headers = raw_headers + ret.should_close = should_close + ret.compression = compression + ret.upgrade = upgrade + ret.chunked = chunked + ret.url = url + return ret + + +@cython.freelist(DEFAULT_FREELIST_SIZE) +cdef class RawResponseMessage: + cdef readonly object version # HttpVersion + cdef readonly int code + cdef readonly str reason + cdef readonly object headers # CIMultiDict + cdef readonly object raw_headers # tuple + cdef readonly object should_close + cdef readonly object compression + cdef readonly object upgrade + cdef readonly object chunked + + def __init__(self, version, code, reason, headers, raw_headers, + should_close, compression, upgrade, chunked): + self.version = version + self.code = code + self.reason = reason + self.headers = headers + self.raw_headers = raw_headers + self.should_close = should_close + self.compression = compression + self.upgrade = upgrade + self.chunked = chunked + + def __repr__(self): + info = [] + info.append(("version", self.version)) + info.append(("code", self.code)) + info.append(("reason", self.reason)) + info.append(("headers", self.headers)) + info.append(("raw_headers", self.raw_headers)) + info.append(("should_close", self.should_close)) + info.append(("compression", self.compression)) + info.append(("upgrade", self.upgrade)) + info.append(("chunked", self.chunked)) + sinfo = ', '.join(name + '=' + repr(val) for name, val in info) + return '' + + +cdef _new_response_message(object version, + int code, + str reason, + object headers, + object raw_headers, + bint should_close, + object compression, + bint upgrade, + bint chunked): + cdef RawResponseMessage ret + ret = RawResponseMessage.__new__(RawResponseMessage) + ret.version = version + ret.code = code + ret.reason = reason + ret.headers = headers + ret.raw_headers = raw_headers + ret.should_close = should_close + ret.compression = compression + ret.upgrade = upgrade + ret.chunked = chunked + return ret + + @cython.internal cdef class HttpParser: @@ -197,9 +362,9 @@ cdef class HttpParser: self._process_header() method = cparser.http_method_str( self._cparser.method) - should_close = not bool(cparser.http_should_keep_alive(self._cparser)) - upgrade = bool(self._cparser.upgrade) - chunked = bool(self._cparser.flags & cparser.F_CHUNKED) + should_close = not cparser.http_should_keep_alive(self._cparser) + upgrade = self._cparser.upgrade + chunked = self._cparser.flags & cparser.F_CHUNKED raw_headers = tuple(self._raw_headers) headers = CIMultiDictProxy(self._headers) @@ -219,12 +384,12 @@ cdef class HttpParser: encoding = enc if self._cparser.type == cparser.HTTP_REQUEST: - msg = RawRequestMessage( + msg = _new_request_message( method.decode('utf-8', 'surrogateescape'), self._path, self.http_version(), headers, raw_headers, should_close, encoding, upgrade, chunked, self._url) else: - msg = RawResponseMessage( + msg = _new_response_message( self.http_version(), self._cparser.status_code, self._reason, headers, raw_headers, should_close, encoding, upgrade, chunked) @@ -258,9 +423,7 @@ cdef class HttpParser: cdef object _on_status_complete(self): pass - ### Public API ### - - def http_version(self): + cdef http_version(self): cdef cparser.http_parser* parser = self._cparser if parser.http_major == 1: @@ -271,6 +434,8 @@ cdef class HttpParser: return HttpVersion(parser.http_major, parser.http_minor) + ### Public API ### + def feed_eof(self): cdef bytes desc diff --git a/aiohttp/http_parser.py b/aiohttp/http_parser.py index 3683129c90b..23a4c5f3e8f 100644 --- a/aiohttp/http_parser.py +++ b/aiohttp/http_parser.py @@ -676,11 +676,18 @@ def end_http_chunk_receiving(self): HttpRequestParserPy = HttpRequestParser HttpResponseParserPy = HttpResponseParser +RawRequestMessagePy = RawRequestMessage +RawResponseMessagePy = RawResponseMessage + try: - from ._http_parser import (HttpRequestParser as HttpRequestParserC, # type: ignore # noqa - HttpResponseParser as HttpResponseParserC) if not NO_EXTENSIONS: # pragma: no cover - HttpRequestParser = HttpRequestParserC # type: ignore - HttpResponseParser = HttpResponseParserC # type: ignore + from ._http_parser import (HttpRequestParser, # type: ignore # noqa + HttpResponseParser, + RawRequestMessage, + RawResponseMessage) + HttpRequestParserC = HttpRequestParser + HttpResponseParserC = HttpResponseParser + RawRequestMessageC = RawRequestMessage + RawResponseMessageC = RawResponseMessage except ImportError: # pragma: no cover pass diff --git a/tests/test_http_parser.py b/tests/test_http_parser.py index 93a780e343a..14a742f8bad 100644 --- a/tests/test_http_parser.py +++ b/tests/test_http_parser.py @@ -381,11 +381,16 @@ def test_max_header_field_size_under_limit(parser): messages, upgrade, tail = parser.feed_data(text) msg = messages[0][0] - assert msg == ( - 'GET', '/test', (1, 1), - CIMultiDict({name.decode(): 'data'}), - ((name, b'data'),), - False, None, False, False, URL('/test')) + assert msg.method == 'GET' + assert msg.path == '/test' + assert msg.version == (1, 1) + assert msg.headers == CIMultiDict({name.decode(): 'data'}) + assert msg.raw_headers == ((name, b'data'),) + assert not msg.should_close + assert msg.compression is None + assert not msg.upgrade + assert not msg.chunked + assert msg.url == URL('/test') @pytest.mark.parametrize('size', [40960, 8191]) @@ -407,11 +412,16 @@ def test_max_header_value_size_under_limit(parser): messages, upgrade, tail = parser.feed_data(text) msg = messages[0][0] - assert msg == ( - 'GET', '/test', (1, 1), - CIMultiDict({'data': value.decode()}), - ((b'data', value),), - False, None, False, False, URL('/test')) + assert msg.method == 'GET' + assert msg.path == '/test' + assert msg.version == (1, 1) + assert msg.headers == CIMultiDict({'data': value.decode()}) + assert msg.raw_headers == ((b'data', value),) + assert not msg.should_close + assert msg.compression is None + assert not msg.upgrade + assert not msg.chunked + assert msg.url == URL('/test') @pytest.mark.parametrize('size', [40965, 8191]) @@ -433,11 +443,16 @@ def test_max_header_value_size_continuation_under_limit(parser): messages, upgrade, tail = parser.feed_data(text) msg = messages[0][0] - assert msg == ( - 'GET', '/test', (1, 1), - CIMultiDict({'data': 'test ' + value.decode()}), - ((b'data', b'test ' + value),), - False, None, False, False, URL('/test')) + assert msg.method == 'GET' + assert msg.path == '/test' + assert msg.version == (1, 1) + assert msg.headers == CIMultiDict({'data': 'test ' + value.decode()}) + assert msg.raw_headers == ((b'data', b'test ' + value),) + assert not msg.should_close + assert msg.compression is None + assert not msg.upgrade + assert not msg.chunked + assert msg.url == URL('/test') def test_http_request_parser(parser): @@ -445,8 +460,16 @@ def test_http_request_parser(parser): messages, upgrade, tail = parser.feed_data(text) msg = messages[0][0] - assert msg == ('GET', '/path', (1, 1), CIMultiDict(), (), - False, None, False, False, URL('/path')) + assert msg.method == 'GET' + assert msg.path == '/path' + assert msg.version == (1, 1) + assert msg.headers == CIMultiDict() + assert msg.raw_headers == () + assert not msg.should_close + assert msg.compression is None + assert not msg.upgrade + assert not msg.chunked + assert msg.url == URL('/path') def test_http_request_bad_status_line(parser): @@ -473,29 +496,46 @@ def test_http_request_parser_utf8(parser): messages, upgrade, tail = parser.feed_data(text) msg = messages[0][0] - assert msg == ('GET', '/path', (1, 1), - CIMultiDict([('X-TEST', 'тест')]), - ((b'x-test', 'тест'.encode('utf-8')),), - False, None, False, False, URL('/path')) + assert msg.method == 'GET' + assert msg.path == '/path' + assert msg.version == (1, 1) + assert msg.headers == CIMultiDict([('X-TEST', 'тест')]) + assert msg.raw_headers == ((b'x-test', 'тест'.encode('utf-8')),) + assert not msg.should_close + assert msg.compression is None + assert not msg.upgrade + assert not msg.chunked + assert msg.url == URL('/path') def test_http_request_parser_non_utf8(parser): text = 'GET /path HTTP/1.1\r\nx-test:тест\r\n\r\n'.encode('cp1251') msg = parser.feed_data(text)[0][0][0] - assert msg == ('GET', '/path', (1, 1), - CIMultiDict([('X-TEST', 'тест'.encode('cp1251').decode( - 'utf-8', 'surrogateescape'))]), - ((b'x-test', 'тест'.encode('cp1251')),), - False, None, False, False, URL('/path')) + assert msg.method == 'GET' + assert msg.path == '/path' + assert msg.version == (1, 1) + assert msg.headers == CIMultiDict([('X-TEST', 'тест'.encode('cp1251') + .decode('utf8', 'surrogateescape'))]) + assert msg.raw_headers == ((b'x-test', 'тест'.encode('cp1251')),) + assert not msg.should_close + assert msg.compression is None + assert not msg.upgrade + assert not msg.chunked + assert msg.url == URL('/path') def test_http_request_parser_two_slashes(parser): text = b'GET //path HTTP/1.1\r\n\r\n' msg = parser.feed_data(text)[0][0][0] - assert msg[:-1] == ('GET', '//path', (1, 1), CIMultiDict(), (), - False, None, False, False) + assert msg.method == 'GET' + assert msg.path == '//path' + assert msg.version == (1, 1) + assert not msg.should_close + assert msg.compression is None + assert not msg.upgrade + assert not msg.chunked def test_http_request_parser_bad_method(parser): @@ -523,8 +563,17 @@ def test_http_request_max_status_line_under_limit(parser): messages, upgraded, tail = parser.feed_data( b'GET /path' + path + b' HTTP/1.1\r\n\r\n') msg = messages[0][0] - assert msg == ('GET', '/path' + path.decode(), (1, 1), CIMultiDict(), (), - False, None, False, False, URL('/path' + path.decode())) + + assert msg.method == 'GET' + assert msg.path == '/path' + path.decode() + assert msg.version == (1, 1) + assert msg.headers == CIMultiDict() + assert msg.raw_headers == () + assert not msg.should_close + assert msg.compression is None + assert not msg.upgrade + assert not msg.chunked + assert msg.url == URL('/path' + path.decode()) def test_http_response_parser_utf8(response): From b8325eb6ae727f988d6f7621cbbf6e94364b9e89 Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Wed, 20 Jun 2018 13:52:39 +0300 Subject: [PATCH 10/22] Drop redundant method --- aiohttp/_http_parser.pyx | 3 --- 1 file changed, 3 deletions(-) diff --git a/aiohttp/_http_parser.pyx b/aiohttp/_http_parser.pyx index 95d3435c47e..2a7e9dfc4f8 100644 --- a/aiohttp/_http_parser.pyx +++ b/aiohttp/_http_parser.pyx @@ -102,9 +102,6 @@ cdef class RawRequestMessage: return '' def _replace(self, **dct): - return self._replace_impl(dct) - - cdef _replace_impl(self, dct): cdef RawRequestMessage ret ret = _new_request_message(self.method, self.path, From 356b335a551f2c1d41659fc7970ec30be0f23a0d Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Wed, 20 Jun 2018 14:27:59 +0300 Subject: [PATCH 11/22] Precalculate content-encoding --- aiohttp/_http_parser.pyx | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/aiohttp/_http_parser.pyx b/aiohttp/_http_parser.pyx index 2a7e9dfc4f8..01a7a34723f 100644 --- a/aiohttp/_http_parser.pyx +++ b/aiohttp/_http_parser.pyx @@ -4,9 +4,9 @@ # from __future__ import absolute_import, print_function from cpython.mem cimport PyMem_Malloc, PyMem_Free -from libc.string cimport memcpy -from cpython cimport PyObject_GetBuffer, PyBuffer_Release, PyBUF_SIMPLE, \ - Py_buffer, PyBytes_AsString +from libc.string cimport memcpy, strncasecmp +from cpython cimport (PyObject_GetBuffer, PyBuffer_Release, PyBUF_SIMPLE, + Py_buffer, PyBytes_AsString, PyBytes_AsStringAndSize) from multidict import (CIMultiDict as _CIMultiDict, CIMultiDictProxy as _CIMultiDictProxy) @@ -60,6 +60,21 @@ cdef object extend(object buf, char* at, size_t length): memcpy(ptr + s, at, length) +cdef Py_ssize_t CONTENT_ENCODING_LEN = len(CONTENT_ENCODING) + + +cdef bint is_content_encoding(bytes raw_name): + cdef Py_ssize_t size + cdef char* buf + PyBytes_AsStringAndSize(raw_name, &buf, &size) + if size != CONTENT_ENCODING_LEN: + return False + if strncasecmp(buf, "Content-Encoding", size) == 0: + return True + return False + + + @cython.freelist(DEFAULT_FREELIST_SIZE) cdef class RawRequestMessage: cdef readonly str method @@ -258,6 +273,8 @@ cdef class HttpParser: object _last_error bint _auto_decompress + str _content_encoding + Py_buffer py_buf def __cinit__(self): @@ -307,6 +324,7 @@ cdef class HttpParser: self._response_with_body = response_with_body self._upgraded = False self._auto_decompress = auto_decompress + self._content_encoding = None self._csettings.on_url = cb_on_url self._csettings.on_status = cb_on_status @@ -332,6 +350,9 @@ cdef class HttpParser: raw_name = self._raw_header_name raw_value = self._raw_header_value + if is_content_encoding(raw_name): + self._content_encoding = value + self._raw_header_name = self._raw_header_value = None self._raw_headers.append((raw_name, raw_value)) @@ -374,8 +395,9 @@ cdef class HttpParser: raise InvalidHeader(SEC_WEBSOCKET_KEY1) encoding = None - enc = headers.get(CONTENT_ENCODING) - if enc: + enc = self._content_encoding + if enc is not None: + self._content_encoding = None enc = enc.lower() if enc in ('gzip', 'deflate', 'br'): encoding = enc From c26d6162d83403e89285f6e20b0657092ba9c3a6 Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Wed, 20 Jun 2018 15:39:48 +0300 Subject: [PATCH 12/22] Speedup HTTP method lookup --- aiohttp/_http_parser.pyx | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/aiohttp/_http_parser.pyx b/aiohttp/_http_parser.pyx index 01a7a34723f..9bea577eec5 100644 --- a/aiohttp/_http_parser.pyx +++ b/aiohttp/_http_parser.pyx @@ -73,6 +73,20 @@ cdef bint is_content_encoding(bytes raw_name): return True return False +DEF METHODS_COUNT = 34; + +cdef list _http_method = [] + +for i in range(METHODS_COUNT): + _http_method.append( + cparser.http_method_str( i).decode('ascii')) + + +cdef str http_method_str(int i): + if i < METHODS_COUNT: + return _http_method[i] + else: + return "" @cython.freelist(DEFAULT_FREELIST_SIZE) @@ -379,7 +393,7 @@ cdef class HttpParser: cdef _on_headers_complete(self): self._process_header() - method = cparser.http_method_str( self._cparser.method) + method = http_method_str(self._cparser.method) should_close = not cparser.http_should_keep_alive(self._cparser) upgrade = self._cparser.upgrade chunked = self._cparser.flags & cparser.F_CHUNKED @@ -404,7 +418,7 @@ cdef class HttpParser: if self._cparser.type == cparser.HTTP_REQUEST: msg = _new_request_message( - method.decode('utf-8', 'surrogateescape'), self._path, + method, self._path, self.http_version(), headers, raw_headers, should_close, encoding, upgrade, chunked, self._url) else: @@ -569,7 +583,6 @@ cdef int cb_on_message_begin(cparser.http_parser* parser) except -1: pyparser._started = True pyparser._headers = CIMultiDict() - # del pyparser._raw_headers[:] pyparser._raw_headers = [] PyByteArray_Resize(pyparser._buf, 0) pyparser._path = None From e5cebbddfebee226b6c4a8e03b6e99cf6d3a21b1 Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Wed, 20 Jun 2018 20:39:39 +0300 Subject: [PATCH 13/22] Reraise compiler error --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 06347b2161c..c3693f62777 100644 --- a/setup.py +++ b/setup.py @@ -56,7 +56,7 @@ def run(self): def build_extension(self, ext): try: build_ext.build_extension(self, ext) - except (CCompilerError, DistutilsExecError, + except (DistutilsExecError, DistutilsPlatformError, ValueError): raise BuildFailed() From 8fb118948c61666478b98d6a550e09f4f60c0278 Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Wed, 20 Jun 2018 21:07:35 +0300 Subject: [PATCH 14/22] Use alternative strncasecmp definition --- aiohttp/_http_parser.pyx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aiohttp/_http_parser.pyx b/aiohttp/_http_parser.pyx index 9bea577eec5..615364884c0 100644 --- a/aiohttp/_http_parser.pyx +++ b/aiohttp/_http_parser.pyx @@ -4,7 +4,8 @@ # from __future__ import absolute_import, print_function from cpython.mem cimport PyMem_Malloc, PyMem_Free -from libc.string cimport memcpy, strncasecmp +from libc.string cimport memcpy +from posix.strings cimport strncasecmp from cpython cimport (PyObject_GetBuffer, PyBuffer_Release, PyBUF_SIMPLE, Py_buffer, PyBytes_AsString, PyBytes_AsStringAndSize) From 904a5f0221f11376011c25e9d178753a479de0f8 Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Wed, 20 Jun 2018 23:39:34 +0300 Subject: [PATCH 15/22] Optimize more --- aiohttp/_http_parser.pyx | 136 +++++++++++++++++++++------------------ 1 file changed, 73 insertions(+), 63 deletions(-) diff --git a/aiohttp/_http_parser.pyx b/aiohttp/_http_parser.pyx index 615364884c0..8c67ece4633 100644 --- a/aiohttp/_http_parser.pyx +++ b/aiohttp/_http_parser.pyx @@ -5,7 +5,6 @@ from __future__ import absolute_import, print_function from cpython.mem cimport PyMem_Malloc, PyMem_Free from libc.string cimport memcpy -from posix.strings cimport strncasecmp from cpython cimport (PyObject_GetBuffer, PyBuffer_Release, PyBUF_SIMPLE, Py_buffer, PyBytes_AsString, PyBytes_AsStringAndSize) @@ -27,6 +26,8 @@ from .streams import (EMPTY_PAYLOAD as _EMPTY_PAYLOAD, cimport cython from . cimport _cparser as cparser +import re + DEF DEFAULT_FREELIST_SIZE = 250 @@ -52,7 +53,7 @@ cdef object StreamReader = _StreamReader cdef object DeflateBuffer = _DeflateBuffer -cdef object extend(object buf, char* at, size_t length): +cdef inline object extend(object buf, char* at, size_t length): cdef Py_ssize_t s cdef char* ptr s = PyByteArray_Size(buf) @@ -61,19 +62,6 @@ cdef object extend(object buf, char* at, size_t length): memcpy(ptr + s, at, length) -cdef Py_ssize_t CONTENT_ENCODING_LEN = len(CONTENT_ENCODING) - - -cdef bint is_content_encoding(bytes raw_name): - cdef Py_ssize_t size - cdef char* buf - PyBytes_AsStringAndSize(raw_name, &buf, &size) - if size != CONTENT_ENCODING_LEN: - return False - if strncasecmp(buf, "Content-Encoding", size) == 0: - return True - return False - DEF METHODS_COUNT = 34; cdef list _http_method = [] @@ -83,12 +71,41 @@ for i in range(METHODS_COUNT): cparser.http_method_str( i).decode('ascii')) -cdef str http_method_str(int i): +cdef inline str http_method_str(int i): if i < METHODS_COUNT: return _http_method[i] else: return "" +cdef list _headers +cdef object _re + + +cdef fill_headers(): + global _headers + global _re + cdef list headers + cdef object h + cdef bytes b + headers = [getattr(hdrs, name) + for name in dir(hdrs) + if isinstance(getattr(hdrs, name), hdrs.istr)] + if len(headers) > 0x7f: + raise RuntimeError("Too many headers for table") + + _headers = headers + b = b'|'.join(b'(' + h.encode('utf-8') + b')' for h in headers) + _re = re.compile(b, re.IGNORECASE) + +fill_headers() + + +cdef inline object find_header(bytes raw_header): + m = _re.fullmatch(raw_header) + if m is None: + return raw_header.decode('utf-8', 'surrogateescape') + return _headers[m.lastindex - 1] + @cython.freelist(DEFAULT_FREELIST_SIZE) cdef class RawRequestMessage: @@ -259,10 +276,8 @@ cdef class HttpParser: cparser.http_parser* _cparser cparser.http_parser_settings* _csettings - str _header_name - str _header_value - bytes _raw_header_name - bytes _raw_header_value + bytearray _raw_name + bytearray _raw_value object _protocol object _loop @@ -328,10 +343,8 @@ cdef class HttpParser: self._payload_exception = payload_exception self._messages = [] - self._header_name = None - self._header_value = None - self._raw_header_name = None - self._raw_header_value = None + self._raw_name = bytearray() + self._raw_value = bytearray() self._max_line_size = max_line_size self._max_headers = max_headers @@ -355,41 +368,41 @@ cdef class HttpParser: self._last_error = None cdef _process_header(self): - if self._header_name is not None: - name = self._header_name - value = self._header_value + if self._raw_name: + raw_name = bytes(self._raw_name) + raw_value = bytes(self._raw_value) - self._header_name = self._header_value = None - self._headers.add(name, value) + name = find_header(raw_name) + value = raw_value.decode('utf-8', 'surrogateescape') - raw_name = self._raw_header_name - raw_value = self._raw_header_value + self._headers.add(name, value) - if is_content_encoding(raw_name): + if name is CONTENT_ENCODING: self._content_encoding = value - self._raw_header_name = self._raw_header_value = None + PyByteArray_Resize(self._raw_name, 0) + PyByteArray_Resize(self._raw_value, 0) self._raw_headers.append((raw_name, raw_value)) - cdef _on_header_field(self, str field, bytes raw_field): - if self._header_value is not None: + cdef _on_header_field(self, char* at, size_t length): + cdef Py_ssize_t size + cdef char *buf + if self._raw_value: self._process_header() - self._header_value = None - if self._header_name is None: - self._header_name = field - self._raw_header_name = raw_field - else: - self._header_name += field - self._raw_header_name += raw_field + size = PyByteArray_Size(self._raw_name) + PyByteArray_Resize(self._raw_name, size + length) + buf = PyByteArray_AsString(self._raw_name) + memcpy(buf + size, at, length) - cdef _on_header_value(self, str val, bytes raw_val): - if self._header_value is None: - self._header_value = val - self._raw_header_value = raw_val - else: - self._header_value += val - self._raw_header_value += raw_val + cdef _on_header_value(self, char* at, size_t length): + cdef Py_ssize_t size + cdef char *buf + + size = PyByteArray_Size(self._raw_value) + PyByteArray_Resize(self._raw_value, size + length) + buf = PyByteArray_AsString(self._raw_value) + memcpy(buf + size, at, length) cdef _on_headers_complete(self): self._process_header() @@ -457,7 +470,7 @@ cdef class HttpParser: cdef object _on_status_complete(self): pass - cdef http_version(self): + cdef inline http_version(self): cdef cparser.http_parser* parser = self._cparser if parser.http_major == 1: @@ -625,13 +638,14 @@ cdef int cb_on_status(cparser.http_parser* parser, cdef int cb_on_header_field(cparser.http_parser* parser, const char *at, size_t length) except -1: cdef HttpParser pyparser = parser.data + cdef Py_ssize_t size try: pyparser._on_status_complete() - if length > pyparser._max_field_size: + size = len(pyparser._raw_name) + length + if size > pyparser._max_field_size: raise LineTooLong( - 'Header name is too long', pyparser._max_field_size, length) - pyparser._on_header_field( - at[:length].decode('utf-8', 'surrogateescape'), at[:length]) + 'Header name is too long', pyparser._max_field_size, size) + pyparser._on_header_field(at, length) except BaseException as ex: pyparser._last_error = ex return -1 @@ -642,17 +656,13 @@ cdef int cb_on_header_field(cparser.http_parser* parser, cdef int cb_on_header_value(cparser.http_parser* parser, const char *at, size_t length) except -1: cdef HttpParser pyparser = parser.data + cdef Py_ssize_t size try: - if pyparser._header_value is not None: - if len(pyparser._header_value) + length > pyparser._max_field_size: - raise LineTooLong( - 'Header value is too long', pyparser._max_field_size, - len(pyparser._header_value) + length) - elif length > pyparser._max_field_size: + size = len(pyparser._raw_value) + length + if size > pyparser._max_field_size: raise LineTooLong( - 'Header value is too long', pyparser._max_field_size, length) - pyparser._on_header_value( - at[:length].decode('utf-8', 'surrogateescape'), at[:length]) + 'Header value is too long', pyparser._max_field_size, size) + pyparser._on_header_value(at, length) except BaseException as ex: pyparser._last_error = ex return -1 From eb26e6681bb0bb740628c649144708abd5050c9d Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Thu, 21 Jun 2018 16:12:08 +0300 Subject: [PATCH 16/22] Move on --- .gitignore | 1 + aiohttp/_find_header.c | 9209 ++++++++++++++++++++++++++++++++++++++ aiohttp/_find_header.h | 14 + aiohttp/_find_header.pxd | 2 + aiohttp/_headers.pxi | 81 + aiohttp/_http_parser.pyx | 40 +- setup.py | 3 +- tools/gen.py | 145 + 8 files changed, 9465 insertions(+), 30 deletions(-) create mode 100644 aiohttp/_find_header.c create mode 100644 aiohttp/_find_header.h create mode 100644 aiohttp/_find_header.pxd create mode 100644 aiohttp/_headers.pxi create mode 100755 tools/gen.py diff --git a/.gitignore b/.gitignore index 83a9abd5646..d5e6cf1331c 100644 --- a/.gitignore +++ b/.gitignore @@ -31,6 +31,7 @@ aiohttp/_http_parser.c aiohttp/_http_parser.html aiohttp/_http_writer.c aiohttp/_http_writer.html +aiohttp/_headers.html bin build htmlcov diff --git a/aiohttp/_find_header.c b/aiohttp/_find_header.c new file mode 100644 index 00000000000..3bcecec5886 --- /dev/null +++ b/aiohttp/_find_header.c @@ -0,0 +1,9209 @@ + +#include "_find_header.h" + +#define NEXT_CHAR() \ +{ \ + count++; \ + if (count == size) { \ + /* end of search */ \ + return -1; \ + } \ + pchar++; \ + ch = *pchar; \ + last = (count == size -1); \ +} while(0); + +int +find_header(const char *str, int size) +{ + char *pchar = str; + int last; + char ch; + int count = -1; + pchar--; + +INITIAL: + NEXT_CHAR(); + switch (ch) { + + case 'A': + if (last) { + return -1; + } + goto A; + + + case 'a': + if (last) { + return -1; + } + goto A; + + + case 'C': + if (last) { + return -1; + } + goto C; + + + case 'c': + if (last) { + return -1; + } + goto C; + + + case 'D': + if (last) { + return -1; + } + goto D; + + + case 'd': + if (last) { + return -1; + } + goto D; + + + case 'E': + if (last) { + return -1; + } + goto E; + + + case 'e': + if (last) { + return -1; + } + goto E; + + + case 'F': + if (last) { + return -1; + } + goto F; + + + case 'f': + if (last) { + return -1; + } + goto F; + + + case 'H': + if (last) { + return -1; + } + goto H; + + + case 'h': + if (last) { + return -1; + } + goto H; + + + case 'I': + if (last) { + return -1; + } + goto I; + + + case 'i': + if (last) { + return -1; + } + goto I; + + + case 'K': + if (last) { + return -1; + } + goto K; + + + case 'k': + if (last) { + return -1; + } + goto K; + + + case 'L': + if (last) { + return -1; + } + goto L; + + + case 'l': + if (last) { + return -1; + } + goto L; + + + case 'M': + if (last) { + return -1; + } + goto M; + + + case 'm': + if (last) { + return -1; + } + goto M; + + + case 'O': + if (last) { + return -1; + } + goto O; + + + case 'o': + if (last) { + return -1; + } + goto O; + + + case 'P': + if (last) { + return -1; + } + goto P; + + + case 'p': + if (last) { + return -1; + } + goto P; + + + case 'R': + if (last) { + return -1; + } + goto R; + + + case 'r': + if (last) { + return -1; + } + goto R; + + + case 'S': + if (last) { + return -1; + } + goto S; + + + case 's': + if (last) { + return -1; + } + goto S; + + + case 'T': + if (last) { + return -1; + } + goto T; + + + case 't': + if (last) { + return -1; + } + goto T; + + + case 'U': + if (last) { + return -1; + } + goto U; + + + case 'u': + if (last) { + return -1; + } + goto U; + + + case 'V': + if (last) { + return -1; + } + goto V; + + + case 'v': + if (last) { + return -1; + } + goto V; + + + case 'W': + if (last) { + return -1; + } + goto W; + + + case 'w': + if (last) { + return -1; + } + goto W; + + + case 'X': + if (last) { + return -1; + } + goto X; + + + case 'x': + if (last) { + return -1; + } + goto X; + + default: + return -1; + } + +A: + NEXT_CHAR(); + switch (ch) { + + case 'c': + if (last) { + return -1; + } + goto AC; + + + case 'g': + if (last) { + return -1; + } + goto AG; + + + case 'l': + if (last) { + return -1; + } + goto AL; + + + case 'u': + if (last) { + return -1; + } + goto AU; + + default: + return -1; + } + +AC: + NEXT_CHAR(); + switch (ch) { + + case 'c': + if (last) { + return -1; + } + goto ACC; + + default: + return -1; + } + +ACC: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return -1; + } + goto ACCE; + + default: + return -1; + } + +ACCE: + NEXT_CHAR(); + switch (ch) { + + case 'p': + if (last) { + return -1; + } + goto ACCEP; + + + case 's': + if (last) { + return -1; + } + goto ACCES; + + default: + return -1; + } + +ACCEP: + NEXT_CHAR(); + switch (ch) { + + case 't': + if (last) { + return 0; + } + goto ACCEPT; + + default: + return -1; + } + +ACCEPT: + NEXT_CHAR(); + switch (ch) { + + case '-': + if (last) { + return -1; + } + goto ACCEPT_; + + default: + return -1; + } + +ACCEPT_: + NEXT_CHAR(); + switch (ch) { + + case 'C': + if (last) { + return -1; + } + goto ACCEPT_C; + + + case 'c': + if (last) { + return -1; + } + goto ACCEPT_C; + + + case 'E': + if (last) { + return -1; + } + goto ACCEPT_E; + + + case 'e': + if (last) { + return -1; + } + goto ACCEPT_E; + + + case 'L': + if (last) { + return -1; + } + goto ACCEPT_L; + + + case 'l': + if (last) { + return -1; + } + goto ACCEPT_L; + + + case 'R': + if (last) { + return -1; + } + goto ACCEPT_R; + + + case 'r': + if (last) { + return -1; + } + goto ACCEPT_R; + + default: + return -1; + } + +ACCEPT_C: + NEXT_CHAR(); + switch (ch) { + + case 'h': + if (last) { + return -1; + } + goto ACCEPT_CH; + + default: + return -1; + } + +ACCEPT_CH: + NEXT_CHAR(); + switch (ch) { + + case 'a': + if (last) { + return -1; + } + goto ACCEPT_CHA; + + default: + return -1; + } + +ACCEPT_CHA: + NEXT_CHAR(); + switch (ch) { + + case 'r': + if (last) { + return -1; + } + goto ACCEPT_CHAR; + + default: + return -1; + } + +ACCEPT_CHAR: + NEXT_CHAR(); + switch (ch) { + + case 's': + if (last) { + return -1; + } + goto ACCEPT_CHARS; + + default: + return -1; + } + +ACCEPT_CHARS: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return -1; + } + goto ACCEPT_CHARSE; + + default: + return -1; + } + +ACCEPT_CHARSE: + NEXT_CHAR(); + switch (ch) { + + case 't': + if (last) { + return 1; + } + goto ACCEPT_CHARSET; + + default: + return -1; + } + +ACCEPT_CHARSET: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +ACCEPT_E: + NEXT_CHAR(); + switch (ch) { + + case 'n': + if (last) { + return -1; + } + goto ACCEPT_EN; + + default: + return -1; + } + +ACCEPT_EN: + NEXT_CHAR(); + switch (ch) { + + case 'c': + if (last) { + return -1; + } + goto ACCEPT_ENC; + + default: + return -1; + } + +ACCEPT_ENC: + NEXT_CHAR(); + switch (ch) { + + case 'o': + if (last) { + return -1; + } + goto ACCEPT_ENCO; + + default: + return -1; + } + +ACCEPT_ENCO: + NEXT_CHAR(); + switch (ch) { + + case 'd': + if (last) { + return -1; + } + goto ACCEPT_ENCOD; + + default: + return -1; + } + +ACCEPT_ENCOD: + NEXT_CHAR(); + switch (ch) { + + case 'i': + if (last) { + return -1; + } + goto ACCEPT_ENCODI; + + default: + return -1; + } + +ACCEPT_ENCODI: + NEXT_CHAR(); + switch (ch) { + + case 'n': + if (last) { + return -1; + } + goto ACCEPT_ENCODIN; + + default: + return -1; + } + +ACCEPT_ENCODIN: + NEXT_CHAR(); + switch (ch) { + + case 'g': + if (last) { + return 2; + } + goto ACCEPT_ENCODING; + + default: + return -1; + } + +ACCEPT_ENCODING: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +ACCEPT_L: + NEXT_CHAR(); + switch (ch) { + + case 'a': + if (last) { + return -1; + } + goto ACCEPT_LA; + + default: + return -1; + } + +ACCEPT_LA: + NEXT_CHAR(); + switch (ch) { + + case 'n': + if (last) { + return -1; + } + goto ACCEPT_LAN; + + default: + return -1; + } + +ACCEPT_LAN: + NEXT_CHAR(); + switch (ch) { + + case 'g': + if (last) { + return -1; + } + goto ACCEPT_LANG; + + default: + return -1; + } + +ACCEPT_LANG: + NEXT_CHAR(); + switch (ch) { + + case 'u': + if (last) { + return -1; + } + goto ACCEPT_LANGU; + + default: + return -1; + } + +ACCEPT_LANGU: + NEXT_CHAR(); + switch (ch) { + + case 'a': + if (last) { + return -1; + } + goto ACCEPT_LANGUA; + + default: + return -1; + } + +ACCEPT_LANGUA: + NEXT_CHAR(); + switch (ch) { + + case 'g': + if (last) { + return -1; + } + goto ACCEPT_LANGUAG; + + default: + return -1; + } + +ACCEPT_LANGUAG: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return 3; + } + goto ACCEPT_LANGUAGE; + + default: + return -1; + } + +ACCEPT_LANGUAGE: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +ACCEPT_R: + NEXT_CHAR(); + switch (ch) { + + case 'a': + if (last) { + return -1; + } + goto ACCEPT_RA; + + default: + return -1; + } + +ACCEPT_RA: + NEXT_CHAR(); + switch (ch) { + + case 'n': + if (last) { + return -1; + } + goto ACCEPT_RAN; + + default: + return -1; + } + +ACCEPT_RAN: + NEXT_CHAR(); + switch (ch) { + + case 'g': + if (last) { + return -1; + } + goto ACCEPT_RANG; + + default: + return -1; + } + +ACCEPT_RANG: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return -1; + } + goto ACCEPT_RANGE; + + default: + return -1; + } + +ACCEPT_RANGE: + NEXT_CHAR(); + switch (ch) { + + case 's': + if (last) { + return 4; + } + goto ACCEPT_RANGES; + + default: + return -1; + } + +ACCEPT_RANGES: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +ACCES: + NEXT_CHAR(); + switch (ch) { + + case 's': + if (last) { + return -1; + } + goto ACCESS; + + default: + return -1; + } + +ACCESS: + NEXT_CHAR(); + switch (ch) { + + case '-': + if (last) { + return -1; + } + goto ACCESS_; + + default: + return -1; + } + +ACCESS_: + NEXT_CHAR(); + switch (ch) { + + case 'C': + if (last) { + return -1; + } + goto ACCESS_C; + + + case 'c': + if (last) { + return -1; + } + goto ACCESS_C; + + default: + return -1; + } + +ACCESS_C: + NEXT_CHAR(); + switch (ch) { + + case 'o': + if (last) { + return -1; + } + goto ACCESS_CO; + + default: + return -1; + } + +ACCESS_CO: + NEXT_CHAR(); + switch (ch) { + + case 'n': + if (last) { + return -1; + } + goto ACCESS_CON; + + default: + return -1; + } + +ACCESS_CON: + NEXT_CHAR(); + switch (ch) { + + case 't': + if (last) { + return -1; + } + goto ACCESS_CONT; + + default: + return -1; + } + +ACCESS_CONT: + NEXT_CHAR(); + switch (ch) { + + case 'r': + if (last) { + return -1; + } + goto ACCESS_CONTR; + + default: + return -1; + } + +ACCESS_CONTR: + NEXT_CHAR(); + switch (ch) { + + case 'o': + if (last) { + return -1; + } + goto ACCESS_CONTRO; + + default: + return -1; + } + +ACCESS_CONTRO: + NEXT_CHAR(); + switch (ch) { + + case 'l': + if (last) { + return -1; + } + goto ACCESS_CONTROL; + + default: + return -1; + } + +ACCESS_CONTROL: + NEXT_CHAR(); + switch (ch) { + + case '-': + if (last) { + return -1; + } + goto ACCESS_CONTROL_; + + default: + return -1; + } + +ACCESS_CONTROL_: + NEXT_CHAR(); + switch (ch) { + + case 'A': + if (last) { + return -1; + } + goto ACCESS_CONTROL_A; + + + case 'a': + if (last) { + return -1; + } + goto ACCESS_CONTROL_A; + + + case 'E': + if (last) { + return -1; + } + goto ACCESS_CONTROL_E; + + + case 'e': + if (last) { + return -1; + } + goto ACCESS_CONTROL_E; + + + case 'M': + if (last) { + return -1; + } + goto ACCESS_CONTROL_M; + + + case 'm': + if (last) { + return -1; + } + goto ACCESS_CONTROL_M; + + + case 'R': + if (last) { + return -1; + } + goto ACCESS_CONTROL_R; + + + case 'r': + if (last) { + return -1; + } + goto ACCESS_CONTROL_R; + + default: + return -1; + } + +ACCESS_CONTROL_A: + NEXT_CHAR(); + switch (ch) { + + case 'l': + if (last) { + return -1; + } + goto ACCESS_CONTROL_AL; + + default: + return -1; + } + +ACCESS_CONTROL_AL: + NEXT_CHAR(); + switch (ch) { + + case 'l': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALL; + + default: + return -1; + } + +ACCESS_CONTROL_ALL: + NEXT_CHAR(); + switch (ch) { + + case 'o': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLO; + + default: + return -1; + } + +ACCESS_CONTROL_ALLO: + NEXT_CHAR(); + switch (ch) { + + case 'w': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW; + + default: + return -1; + } + +ACCESS_CONTROL_ALLOW: + NEXT_CHAR(); + switch (ch) { + + case '-': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_; + + default: + return -1; + } + +ACCESS_CONTROL_ALLOW_: + NEXT_CHAR(); + switch (ch) { + + case 'C': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_C; + + + case 'c': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_C; + + + case 'H': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_H; + + + case 'h': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_H; + + + case 'M': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_M; + + + case 'm': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_M; + + + case 'O': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_O; + + + case 'o': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_O; + + default: + return -1; + } + +ACCESS_CONTROL_ALLOW_C: + NEXT_CHAR(); + switch (ch) { + + case 'r': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_CR; + + default: + return -1; + } + +ACCESS_CONTROL_ALLOW_CR: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_CRE; + + default: + return -1; + } + +ACCESS_CONTROL_ALLOW_CRE: + NEXT_CHAR(); + switch (ch) { + + case 'd': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_CRED; + + default: + return -1; + } + +ACCESS_CONTROL_ALLOW_CRED: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_CREDE; + + default: + return -1; + } + +ACCESS_CONTROL_ALLOW_CREDE: + NEXT_CHAR(); + switch (ch) { + + case 'n': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_CREDEN; + + default: + return -1; + } + +ACCESS_CONTROL_ALLOW_CREDEN: + NEXT_CHAR(); + switch (ch) { + + case 't': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_CREDENT; + + default: + return -1; + } + +ACCESS_CONTROL_ALLOW_CREDENT: + NEXT_CHAR(); + switch (ch) { + + case 'i': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_CREDENTI; + + default: + return -1; + } + +ACCESS_CONTROL_ALLOW_CREDENTI: + NEXT_CHAR(); + switch (ch) { + + case 'a': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_CREDENTIA; + + default: + return -1; + } + +ACCESS_CONTROL_ALLOW_CREDENTIA: + NEXT_CHAR(); + switch (ch) { + + case 'l': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_CREDENTIAL; + + default: + return -1; + } + +ACCESS_CONTROL_ALLOW_CREDENTIAL: + NEXT_CHAR(); + switch (ch) { + + case 's': + if (last) { + return 5; + } + goto ACCESS_CONTROL_ALLOW_CREDENTIALS; + + default: + return -1; + } + +ACCESS_CONTROL_ALLOW_CREDENTIALS: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +ACCESS_CONTROL_ALLOW_H: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_HE; + + default: + return -1; + } + +ACCESS_CONTROL_ALLOW_HE: + NEXT_CHAR(); + switch (ch) { + + case 'a': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_HEA; + + default: + return -1; + } + +ACCESS_CONTROL_ALLOW_HEA: + NEXT_CHAR(); + switch (ch) { + + case 'd': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_HEAD; + + default: + return -1; + } + +ACCESS_CONTROL_ALLOW_HEAD: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_HEADE; + + default: + return -1; + } + +ACCESS_CONTROL_ALLOW_HEADE: + NEXT_CHAR(); + switch (ch) { + + case 'r': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_HEADER; + + default: + return -1; + } + +ACCESS_CONTROL_ALLOW_HEADER: + NEXT_CHAR(); + switch (ch) { + + case 's': + if (last) { + return 6; + } + goto ACCESS_CONTROL_ALLOW_HEADERS; + + default: + return -1; + } + +ACCESS_CONTROL_ALLOW_HEADERS: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +ACCESS_CONTROL_ALLOW_M: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_ME; + + default: + return -1; + } + +ACCESS_CONTROL_ALLOW_ME: + NEXT_CHAR(); + switch (ch) { + + case 't': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_MET; + + default: + return -1; + } + +ACCESS_CONTROL_ALLOW_MET: + NEXT_CHAR(); + switch (ch) { + + case 'h': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_METH; + + default: + return -1; + } + +ACCESS_CONTROL_ALLOW_METH: + NEXT_CHAR(); + switch (ch) { + + case 'o': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_METHO; + + default: + return -1; + } + +ACCESS_CONTROL_ALLOW_METHO: + NEXT_CHAR(); + switch (ch) { + + case 'd': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_METHOD; + + default: + return -1; + } + +ACCESS_CONTROL_ALLOW_METHOD: + NEXT_CHAR(); + switch (ch) { + + case 's': + if (last) { + return 7; + } + goto ACCESS_CONTROL_ALLOW_METHODS; + + default: + return -1; + } + +ACCESS_CONTROL_ALLOW_METHODS: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +ACCESS_CONTROL_ALLOW_O: + NEXT_CHAR(); + switch (ch) { + + case 'r': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_OR; + + default: + return -1; + } + +ACCESS_CONTROL_ALLOW_OR: + NEXT_CHAR(); + switch (ch) { + + case 'i': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_ORI; + + default: + return -1; + } + +ACCESS_CONTROL_ALLOW_ORI: + NEXT_CHAR(); + switch (ch) { + + case 'g': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_ORIG; + + default: + return -1; + } + +ACCESS_CONTROL_ALLOW_ORIG: + NEXT_CHAR(); + switch (ch) { + + case 'i': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_ORIGI; + + default: + return -1; + } + +ACCESS_CONTROL_ALLOW_ORIGI: + NEXT_CHAR(); + switch (ch) { + + case 'n': + if (last) { + return 8; + } + goto ACCESS_CONTROL_ALLOW_ORIGIN; + + default: + return -1; + } + +ACCESS_CONTROL_ALLOW_ORIGIN: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +ACCESS_CONTROL_E: + NEXT_CHAR(); + switch (ch) { + + case 'x': + if (last) { + return -1; + } + goto ACCESS_CONTROL_EX; + + default: + return -1; + } + +ACCESS_CONTROL_EX: + NEXT_CHAR(); + switch (ch) { + + case 'p': + if (last) { + return -1; + } + goto ACCESS_CONTROL_EXP; + + default: + return -1; + } + +ACCESS_CONTROL_EXP: + NEXT_CHAR(); + switch (ch) { + + case 'o': + if (last) { + return -1; + } + goto ACCESS_CONTROL_EXPO; + + default: + return -1; + } + +ACCESS_CONTROL_EXPO: + NEXT_CHAR(); + switch (ch) { + + case 's': + if (last) { + return -1; + } + goto ACCESS_CONTROL_EXPOS; + + default: + return -1; + } + +ACCESS_CONTROL_EXPOS: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return -1; + } + goto ACCESS_CONTROL_EXPOSE; + + default: + return -1; + } + +ACCESS_CONTROL_EXPOSE: + NEXT_CHAR(); + switch (ch) { + + case '-': + if (last) { + return -1; + } + goto ACCESS_CONTROL_EXPOSE_; + + default: + return -1; + } + +ACCESS_CONTROL_EXPOSE_: + NEXT_CHAR(); + switch (ch) { + + case 'H': + if (last) { + return -1; + } + goto ACCESS_CONTROL_EXPOSE_H; + + + case 'h': + if (last) { + return -1; + } + goto ACCESS_CONTROL_EXPOSE_H; + + default: + return -1; + } + +ACCESS_CONTROL_EXPOSE_H: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return -1; + } + goto ACCESS_CONTROL_EXPOSE_HE; + + default: + return -1; + } + +ACCESS_CONTROL_EXPOSE_HE: + NEXT_CHAR(); + switch (ch) { + + case 'a': + if (last) { + return -1; + } + goto ACCESS_CONTROL_EXPOSE_HEA; + + default: + return -1; + } + +ACCESS_CONTROL_EXPOSE_HEA: + NEXT_CHAR(); + switch (ch) { + + case 'd': + if (last) { + return -1; + } + goto ACCESS_CONTROL_EXPOSE_HEAD; + + default: + return -1; + } + +ACCESS_CONTROL_EXPOSE_HEAD: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return -1; + } + goto ACCESS_CONTROL_EXPOSE_HEADE; + + default: + return -1; + } + +ACCESS_CONTROL_EXPOSE_HEADE: + NEXT_CHAR(); + switch (ch) { + + case 'r': + if (last) { + return -1; + } + goto ACCESS_CONTROL_EXPOSE_HEADER; + + default: + return -1; + } + +ACCESS_CONTROL_EXPOSE_HEADER: + NEXT_CHAR(); + switch (ch) { + + case 's': + if (last) { + return 9; + } + goto ACCESS_CONTROL_EXPOSE_HEADERS; + + default: + return -1; + } + +ACCESS_CONTROL_EXPOSE_HEADERS: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +ACCESS_CONTROL_M: + NEXT_CHAR(); + switch (ch) { + + case 'a': + if (last) { + return -1; + } + goto ACCESS_CONTROL_MA; + + default: + return -1; + } + +ACCESS_CONTROL_MA: + NEXT_CHAR(); + switch (ch) { + + case 'x': + if (last) { + return -1; + } + goto ACCESS_CONTROL_MAX; + + default: + return -1; + } + +ACCESS_CONTROL_MAX: + NEXT_CHAR(); + switch (ch) { + + case '-': + if (last) { + return -1; + } + goto ACCESS_CONTROL_MAX_; + + default: + return -1; + } + +ACCESS_CONTROL_MAX_: + NEXT_CHAR(); + switch (ch) { + + case 'A': + if (last) { + return -1; + } + goto ACCESS_CONTROL_MAX_A; + + + case 'a': + if (last) { + return -1; + } + goto ACCESS_CONTROL_MAX_A; + + default: + return -1; + } + +ACCESS_CONTROL_MAX_A: + NEXT_CHAR(); + switch (ch) { + + case 'g': + if (last) { + return -1; + } + goto ACCESS_CONTROL_MAX_AG; + + default: + return -1; + } + +ACCESS_CONTROL_MAX_AG: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return 10; + } + goto ACCESS_CONTROL_MAX_AGE; + + default: + return -1; + } + +ACCESS_CONTROL_MAX_AGE: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +ACCESS_CONTROL_R: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return -1; + } + goto ACCESS_CONTROL_RE; + + default: + return -1; + } + +ACCESS_CONTROL_RE: + NEXT_CHAR(); + switch (ch) { + + case 'q': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQ; + + default: + return -1; + } + +ACCESS_CONTROL_REQ: + NEXT_CHAR(); + switch (ch) { + + case 'u': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQU; + + default: + return -1; + } + +ACCESS_CONTROL_REQU: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUE; + + default: + return -1; + } + +ACCESS_CONTROL_REQUE: + NEXT_CHAR(); + switch (ch) { + + case 's': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUES; + + default: + return -1; + } + +ACCESS_CONTROL_REQUES: + NEXT_CHAR(); + switch (ch) { + + case 't': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUEST; + + default: + return -1; + } + +ACCESS_CONTROL_REQUEST: + NEXT_CHAR(); + switch (ch) { + + case '-': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUEST_; + + default: + return -1; + } + +ACCESS_CONTROL_REQUEST_: + NEXT_CHAR(); + switch (ch) { + + case 'H': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUEST_H; + + + case 'h': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUEST_H; + + + case 'M': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUEST_M; + + + case 'm': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUEST_M; + + default: + return -1; + } + +ACCESS_CONTROL_REQUEST_H: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUEST_HE; + + default: + return -1; + } + +ACCESS_CONTROL_REQUEST_HE: + NEXT_CHAR(); + switch (ch) { + + case 'a': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUEST_HEA; + + default: + return -1; + } + +ACCESS_CONTROL_REQUEST_HEA: + NEXT_CHAR(); + switch (ch) { + + case 'd': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUEST_HEAD; + + default: + return -1; + } + +ACCESS_CONTROL_REQUEST_HEAD: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUEST_HEADE; + + default: + return -1; + } + +ACCESS_CONTROL_REQUEST_HEADE: + NEXT_CHAR(); + switch (ch) { + + case 'r': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUEST_HEADER; + + default: + return -1; + } + +ACCESS_CONTROL_REQUEST_HEADER: + NEXT_CHAR(); + switch (ch) { + + case 's': + if (last) { + return 11; + } + goto ACCESS_CONTROL_REQUEST_HEADERS; + + default: + return -1; + } + +ACCESS_CONTROL_REQUEST_HEADERS: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +ACCESS_CONTROL_REQUEST_M: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUEST_ME; + + default: + return -1; + } + +ACCESS_CONTROL_REQUEST_ME: + NEXT_CHAR(); + switch (ch) { + + case 't': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUEST_MET; + + default: + return -1; + } + +ACCESS_CONTROL_REQUEST_MET: + NEXT_CHAR(); + switch (ch) { + + case 'h': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUEST_METH; + + default: + return -1; + } + +ACCESS_CONTROL_REQUEST_METH: + NEXT_CHAR(); + switch (ch) { + + case 'o': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUEST_METHO; + + default: + return -1; + } + +ACCESS_CONTROL_REQUEST_METHO: + NEXT_CHAR(); + switch (ch) { + + case 'd': + if (last) { + return 12; + } + goto ACCESS_CONTROL_REQUEST_METHOD; + + default: + return -1; + } + +ACCESS_CONTROL_REQUEST_METHOD: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +AG: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return 13; + } + goto AGE; + + default: + return -1; + } + +AGE: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +AL: + NEXT_CHAR(); + switch (ch) { + + case 'l': + if (last) { + return -1; + } + goto ALL; + + default: + return -1; + } + +ALL: + NEXT_CHAR(); + switch (ch) { + + case 'o': + if (last) { + return -1; + } + goto ALLO; + + default: + return -1; + } + +ALLO: + NEXT_CHAR(); + switch (ch) { + + case 'w': + if (last) { + return 14; + } + goto ALLOW; + + default: + return -1; + } + +ALLOW: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +AU: + NEXT_CHAR(); + switch (ch) { + + case 't': + if (last) { + return -1; + } + goto AUT; + + default: + return -1; + } + +AUT: + NEXT_CHAR(); + switch (ch) { + + case 'h': + if (last) { + return -1; + } + goto AUTH; + + default: + return -1; + } + +AUTH: + NEXT_CHAR(); + switch (ch) { + + case 'o': + if (last) { + return -1; + } + goto AUTHO; + + default: + return -1; + } + +AUTHO: + NEXT_CHAR(); + switch (ch) { + + case 'r': + if (last) { + return -1; + } + goto AUTHOR; + + default: + return -1; + } + +AUTHOR: + NEXT_CHAR(); + switch (ch) { + + case 'i': + if (last) { + return -1; + } + goto AUTHORI; + + default: + return -1; + } + +AUTHORI: + NEXT_CHAR(); + switch (ch) { + + case 'z': + if (last) { + return -1; + } + goto AUTHORIZ; + + default: + return -1; + } + +AUTHORIZ: + NEXT_CHAR(); + switch (ch) { + + case 'a': + if (last) { + return -1; + } + goto AUTHORIZA; + + default: + return -1; + } + +AUTHORIZA: + NEXT_CHAR(); + switch (ch) { + + case 't': + if (last) { + return -1; + } + goto AUTHORIZAT; + + default: + return -1; + } + +AUTHORIZAT: + NEXT_CHAR(); + switch (ch) { + + case 'i': + if (last) { + return -1; + } + goto AUTHORIZATI; + + default: + return -1; + } + +AUTHORIZATI: + NEXT_CHAR(); + switch (ch) { + + case 'o': + if (last) { + return -1; + } + goto AUTHORIZATIO; + + default: + return -1; + } + +AUTHORIZATIO: + NEXT_CHAR(); + switch (ch) { + + case 'n': + if (last) { + return 15; + } + goto AUTHORIZATION; + + default: + return -1; + } + +AUTHORIZATION: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +C: + NEXT_CHAR(); + switch (ch) { + + case 'a': + if (last) { + return -1; + } + goto CA; + + + case 'o': + if (last) { + return -1; + } + goto CO; + + default: + return -1; + } + +CA: + NEXT_CHAR(); + switch (ch) { + + case 'c': + if (last) { + return -1; + } + goto CAC; + + default: + return -1; + } + +CAC: + NEXT_CHAR(); + switch (ch) { + + case 'h': + if (last) { + return -1; + } + goto CACH; + + default: + return -1; + } + +CACH: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return -1; + } + goto CACHE; + + default: + return -1; + } + +CACHE: + NEXT_CHAR(); + switch (ch) { + + case '-': + if (last) { + return -1; + } + goto CACHE_; + + default: + return -1; + } + +CACHE_: + NEXT_CHAR(); + switch (ch) { + + case 'C': + if (last) { + return -1; + } + goto CACHE_C; + + + case 'c': + if (last) { + return -1; + } + goto CACHE_C; + + default: + return -1; + } + +CACHE_C: + NEXT_CHAR(); + switch (ch) { + + case 'o': + if (last) { + return -1; + } + goto CACHE_CO; + + default: + return -1; + } + +CACHE_CO: + NEXT_CHAR(); + switch (ch) { + + case 'n': + if (last) { + return -1; + } + goto CACHE_CON; + + default: + return -1; + } + +CACHE_CON: + NEXT_CHAR(); + switch (ch) { + + case 't': + if (last) { + return -1; + } + goto CACHE_CONT; + + default: + return -1; + } + +CACHE_CONT: + NEXT_CHAR(); + switch (ch) { + + case 'r': + if (last) { + return -1; + } + goto CACHE_CONTR; + + default: + return -1; + } + +CACHE_CONTR: + NEXT_CHAR(); + switch (ch) { + + case 'o': + if (last) { + return -1; + } + goto CACHE_CONTRO; + + default: + return -1; + } + +CACHE_CONTRO: + NEXT_CHAR(); + switch (ch) { + + case 'l': + if (last) { + return 16; + } + goto CACHE_CONTROL; + + default: + return -1; + } + +CACHE_CONTROL: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +CO: + NEXT_CHAR(); + switch (ch) { + + case 'n': + if (last) { + return -1; + } + goto CON; + + + case 'o': + if (last) { + return -1; + } + goto COO; + + default: + return -1; + } + +CON: + NEXT_CHAR(); + switch (ch) { + + case 'n': + if (last) { + return -1; + } + goto CONN; + + + case 't': + if (last) { + return -1; + } + goto CONT; + + default: + return -1; + } + +CONN: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return -1; + } + goto CONNE; + + default: + return -1; + } + +CONNE: + NEXT_CHAR(); + switch (ch) { + + case 'c': + if (last) { + return -1; + } + goto CONNEC; + + default: + return -1; + } + +CONNEC: + NEXT_CHAR(); + switch (ch) { + + case 't': + if (last) { + return -1; + } + goto CONNECT; + + default: + return -1; + } + +CONNECT: + NEXT_CHAR(); + switch (ch) { + + case 'i': + if (last) { + return -1; + } + goto CONNECTI; + + default: + return -1; + } + +CONNECTI: + NEXT_CHAR(); + switch (ch) { + + case 'o': + if (last) { + return -1; + } + goto CONNECTIO; + + default: + return -1; + } + +CONNECTIO: + NEXT_CHAR(); + switch (ch) { + + case 'n': + if (last) { + return 17; + } + goto CONNECTION; + + default: + return -1; + } + +CONNECTION: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +CONT: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return -1; + } + goto CONTE; + + default: + return -1; + } + +CONTE: + NEXT_CHAR(); + switch (ch) { + + case 'n': + if (last) { + return -1; + } + goto CONTEN; + + default: + return -1; + } + +CONTEN: + NEXT_CHAR(); + switch (ch) { + + case 't': + if (last) { + return -1; + } + goto CONTENT; + + default: + return -1; + } + +CONTENT: + NEXT_CHAR(); + switch (ch) { + + case '-': + if (last) { + return -1; + } + goto CONTENT_; + + default: + return -1; + } + +CONTENT_: + NEXT_CHAR(); + switch (ch) { + + case 'D': + if (last) { + return -1; + } + goto CONTENT_D; + + + case 'd': + if (last) { + return -1; + } + goto CONTENT_D; + + + case 'E': + if (last) { + return -1; + } + goto CONTENT_E; + + + case 'e': + if (last) { + return -1; + } + goto CONTENT_E; + + + case 'L': + if (last) { + return -1; + } + goto CONTENT_L; + + + case 'l': + if (last) { + return -1; + } + goto CONTENT_L; + + + case 'M': + if (last) { + return -1; + } + goto CONTENT_M; + + + case 'm': + if (last) { + return -1; + } + goto CONTENT_M; + + + case 'R': + if (last) { + return -1; + } + goto CONTENT_R; + + + case 'r': + if (last) { + return -1; + } + goto CONTENT_R; + + + case 'T': + if (last) { + return -1; + } + goto CONTENT_T; + + + case 't': + if (last) { + return -1; + } + goto CONTENT_T; + + default: + return -1; + } + +CONTENT_D: + NEXT_CHAR(); + switch (ch) { + + case 'i': + if (last) { + return -1; + } + goto CONTENT_DI; + + default: + return -1; + } + +CONTENT_DI: + NEXT_CHAR(); + switch (ch) { + + case 's': + if (last) { + return -1; + } + goto CONTENT_DIS; + + default: + return -1; + } + +CONTENT_DIS: + NEXT_CHAR(); + switch (ch) { + + case 'p': + if (last) { + return -1; + } + goto CONTENT_DISP; + + default: + return -1; + } + +CONTENT_DISP: + NEXT_CHAR(); + switch (ch) { + + case 'o': + if (last) { + return -1; + } + goto CONTENT_DISPO; + + default: + return -1; + } + +CONTENT_DISPO: + NEXT_CHAR(); + switch (ch) { + + case 's': + if (last) { + return -1; + } + goto CONTENT_DISPOS; + + default: + return -1; + } + +CONTENT_DISPOS: + NEXT_CHAR(); + switch (ch) { + + case 'i': + if (last) { + return -1; + } + goto CONTENT_DISPOSI; + + default: + return -1; + } + +CONTENT_DISPOSI: + NEXT_CHAR(); + switch (ch) { + + case 't': + if (last) { + return -1; + } + goto CONTENT_DISPOSIT; + + default: + return -1; + } + +CONTENT_DISPOSIT: + NEXT_CHAR(); + switch (ch) { + + case 'i': + if (last) { + return -1; + } + goto CONTENT_DISPOSITI; + + default: + return -1; + } + +CONTENT_DISPOSITI: + NEXT_CHAR(); + switch (ch) { + + case 'o': + if (last) { + return -1; + } + goto CONTENT_DISPOSITIO; + + default: + return -1; + } + +CONTENT_DISPOSITIO: + NEXT_CHAR(); + switch (ch) { + + case 'n': + if (last) { + return 18; + } + goto CONTENT_DISPOSITION; + + default: + return -1; + } + +CONTENT_DISPOSITION: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +CONTENT_E: + NEXT_CHAR(); + switch (ch) { + + case 'n': + if (last) { + return -1; + } + goto CONTENT_EN; + + default: + return -1; + } + +CONTENT_EN: + NEXT_CHAR(); + switch (ch) { + + case 'c': + if (last) { + return -1; + } + goto CONTENT_ENC; + + default: + return -1; + } + +CONTENT_ENC: + NEXT_CHAR(); + switch (ch) { + + case 'o': + if (last) { + return -1; + } + goto CONTENT_ENCO; + + default: + return -1; + } + +CONTENT_ENCO: + NEXT_CHAR(); + switch (ch) { + + case 'd': + if (last) { + return -1; + } + goto CONTENT_ENCOD; + + default: + return -1; + } + +CONTENT_ENCOD: + NEXT_CHAR(); + switch (ch) { + + case 'i': + if (last) { + return -1; + } + goto CONTENT_ENCODI; + + default: + return -1; + } + +CONTENT_ENCODI: + NEXT_CHAR(); + switch (ch) { + + case 'n': + if (last) { + return -1; + } + goto CONTENT_ENCODIN; + + default: + return -1; + } + +CONTENT_ENCODIN: + NEXT_CHAR(); + switch (ch) { + + case 'g': + if (last) { + return 19; + } + goto CONTENT_ENCODING; + + default: + return -1; + } + +CONTENT_ENCODING: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +CONTENT_L: + NEXT_CHAR(); + switch (ch) { + + case 'a': + if (last) { + return -1; + } + goto CONTENT_LA; + + + case 'e': + if (last) { + return -1; + } + goto CONTENT_LE; + + + case 'o': + if (last) { + return -1; + } + goto CONTENT_LO; + + default: + return -1; + } + +CONTENT_LA: + NEXT_CHAR(); + switch (ch) { + + case 'n': + if (last) { + return -1; + } + goto CONTENT_LAN; + + default: + return -1; + } + +CONTENT_LAN: + NEXT_CHAR(); + switch (ch) { + + case 'g': + if (last) { + return -1; + } + goto CONTENT_LANG; + + default: + return -1; + } + +CONTENT_LANG: + NEXT_CHAR(); + switch (ch) { + + case 'u': + if (last) { + return -1; + } + goto CONTENT_LANGU; + + default: + return -1; + } + +CONTENT_LANGU: + NEXT_CHAR(); + switch (ch) { + + case 'a': + if (last) { + return -1; + } + goto CONTENT_LANGUA; + + default: + return -1; + } + +CONTENT_LANGUA: + NEXT_CHAR(); + switch (ch) { + + case 'g': + if (last) { + return -1; + } + goto CONTENT_LANGUAG; + + default: + return -1; + } + +CONTENT_LANGUAG: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return 20; + } + goto CONTENT_LANGUAGE; + + default: + return -1; + } + +CONTENT_LANGUAGE: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +CONTENT_LE: + NEXT_CHAR(); + switch (ch) { + + case 'n': + if (last) { + return -1; + } + goto CONTENT_LEN; + + default: + return -1; + } + +CONTENT_LEN: + NEXT_CHAR(); + switch (ch) { + + case 'g': + if (last) { + return -1; + } + goto CONTENT_LENG; + + default: + return -1; + } + +CONTENT_LENG: + NEXT_CHAR(); + switch (ch) { + + case 't': + if (last) { + return -1; + } + goto CONTENT_LENGT; + + default: + return -1; + } + +CONTENT_LENGT: + NEXT_CHAR(); + switch (ch) { + + case 'h': + if (last) { + return 21; + } + goto CONTENT_LENGTH; + + default: + return -1; + } + +CONTENT_LENGTH: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +CONTENT_LO: + NEXT_CHAR(); + switch (ch) { + + case 'c': + if (last) { + return -1; + } + goto CONTENT_LOC; + + default: + return -1; + } + +CONTENT_LOC: + NEXT_CHAR(); + switch (ch) { + + case 'a': + if (last) { + return -1; + } + goto CONTENT_LOCA; + + default: + return -1; + } + +CONTENT_LOCA: + NEXT_CHAR(); + switch (ch) { + + case 't': + if (last) { + return -1; + } + goto CONTENT_LOCAT; + + default: + return -1; + } + +CONTENT_LOCAT: + NEXT_CHAR(); + switch (ch) { + + case 'i': + if (last) { + return -1; + } + goto CONTENT_LOCATI; + + default: + return -1; + } + +CONTENT_LOCATI: + NEXT_CHAR(); + switch (ch) { + + case 'o': + if (last) { + return -1; + } + goto CONTENT_LOCATIO; + + default: + return -1; + } + +CONTENT_LOCATIO: + NEXT_CHAR(); + switch (ch) { + + case 'n': + if (last) { + return 22; + } + goto CONTENT_LOCATION; + + default: + return -1; + } + +CONTENT_LOCATION: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +CONTENT_M: + NEXT_CHAR(); + switch (ch) { + + case 'd': + if (last) { + return -1; + } + goto CONTENT_MD; + + default: + return -1; + } + +CONTENT_MD: + NEXT_CHAR(); + switch (ch) { + + case '5': + if (last) { + return 23; + } + goto CONTENT_MD5; + + default: + return -1; + } + +CONTENT_MD5: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +CONTENT_R: + NEXT_CHAR(); + switch (ch) { + + case 'a': + if (last) { + return -1; + } + goto CONTENT_RA; + + default: + return -1; + } + +CONTENT_RA: + NEXT_CHAR(); + switch (ch) { + + case 'n': + if (last) { + return -1; + } + goto CONTENT_RAN; + + default: + return -1; + } + +CONTENT_RAN: + NEXT_CHAR(); + switch (ch) { + + case 'g': + if (last) { + return -1; + } + goto CONTENT_RANG; + + default: + return -1; + } + +CONTENT_RANG: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return 24; + } + goto CONTENT_RANGE; + + default: + return -1; + } + +CONTENT_RANGE: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +CONTENT_T: + NEXT_CHAR(); + switch (ch) { + + case 'r': + if (last) { + return -1; + } + goto CONTENT_TR; + + + case 'y': + if (last) { + return -1; + } + goto CONTENT_TY; + + default: + return -1; + } + +CONTENT_TR: + NEXT_CHAR(); + switch (ch) { + + case 'a': + if (last) { + return -1; + } + goto CONTENT_TRA; + + default: + return -1; + } + +CONTENT_TRA: + NEXT_CHAR(); + switch (ch) { + + case 'n': + if (last) { + return -1; + } + goto CONTENT_TRAN; + + default: + return -1; + } + +CONTENT_TRAN: + NEXT_CHAR(); + switch (ch) { + + case 's': + if (last) { + return -1; + } + goto CONTENT_TRANS; + + default: + return -1; + } + +CONTENT_TRANS: + NEXT_CHAR(); + switch (ch) { + + case 'f': + if (last) { + return -1; + } + goto CONTENT_TRANSF; + + default: + return -1; + } + +CONTENT_TRANSF: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return -1; + } + goto CONTENT_TRANSFE; + + default: + return -1; + } + +CONTENT_TRANSFE: + NEXT_CHAR(); + switch (ch) { + + case 'r': + if (last) { + return -1; + } + goto CONTENT_TRANSFER; + + default: + return -1; + } + +CONTENT_TRANSFER: + NEXT_CHAR(); + switch (ch) { + + case '-': + if (last) { + return -1; + } + goto CONTENT_TRANSFER_; + + default: + return -1; + } + +CONTENT_TRANSFER_: + NEXT_CHAR(); + switch (ch) { + + case 'E': + if (last) { + return -1; + } + goto CONTENT_TRANSFER_E; + + + case 'e': + if (last) { + return -1; + } + goto CONTENT_TRANSFER_E; + + default: + return -1; + } + +CONTENT_TRANSFER_E: + NEXT_CHAR(); + switch (ch) { + + case 'n': + if (last) { + return -1; + } + goto CONTENT_TRANSFER_EN; + + default: + return -1; + } + +CONTENT_TRANSFER_EN: + NEXT_CHAR(); + switch (ch) { + + case 'c': + if (last) { + return -1; + } + goto CONTENT_TRANSFER_ENC; + + default: + return -1; + } + +CONTENT_TRANSFER_ENC: + NEXT_CHAR(); + switch (ch) { + + case 'o': + if (last) { + return -1; + } + goto CONTENT_TRANSFER_ENCO; + + default: + return -1; + } + +CONTENT_TRANSFER_ENCO: + NEXT_CHAR(); + switch (ch) { + + case 'd': + if (last) { + return -1; + } + goto CONTENT_TRANSFER_ENCOD; + + default: + return -1; + } + +CONTENT_TRANSFER_ENCOD: + NEXT_CHAR(); + switch (ch) { + + case 'i': + if (last) { + return -1; + } + goto CONTENT_TRANSFER_ENCODI; + + default: + return -1; + } + +CONTENT_TRANSFER_ENCODI: + NEXT_CHAR(); + switch (ch) { + + case 'n': + if (last) { + return -1; + } + goto CONTENT_TRANSFER_ENCODIN; + + default: + return -1; + } + +CONTENT_TRANSFER_ENCODIN: + NEXT_CHAR(); + switch (ch) { + + case 'g': + if (last) { + return 25; + } + goto CONTENT_TRANSFER_ENCODING; + + default: + return -1; + } + +CONTENT_TRANSFER_ENCODING: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +CONTENT_TY: + NEXT_CHAR(); + switch (ch) { + + case 'p': + if (last) { + return -1; + } + goto CONTENT_TYP; + + default: + return -1; + } + +CONTENT_TYP: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return 26; + } + goto CONTENT_TYPE; + + default: + return -1; + } + +CONTENT_TYPE: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +COO: + NEXT_CHAR(); + switch (ch) { + + case 'k': + if (last) { + return -1; + } + goto COOK; + + default: + return -1; + } + +COOK: + NEXT_CHAR(); + switch (ch) { + + case 'i': + if (last) { + return -1; + } + goto COOKI; + + default: + return -1; + } + +COOKI: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return 27; + } + goto COOKIE; + + default: + return -1; + } + +COOKIE: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +D: + NEXT_CHAR(); + switch (ch) { + + case 'a': + if (last) { + return -1; + } + goto DA; + + + case 'e': + if (last) { + return -1; + } + goto DE; + + + case 'i': + if (last) { + return -1; + } + goto DI; + + default: + return -1; + } + +DA: + NEXT_CHAR(); + switch (ch) { + + case 't': + if (last) { + return -1; + } + goto DAT; + + default: + return -1; + } + +DAT: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return 28; + } + goto DATE; + + default: + return -1; + } + +DATE: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +DE: + NEXT_CHAR(); + switch (ch) { + + case 's': + if (last) { + return -1; + } + goto DES; + + default: + return -1; + } + +DES: + NEXT_CHAR(); + switch (ch) { + + case 't': + if (last) { + return -1; + } + goto DEST; + + default: + return -1; + } + +DEST: + NEXT_CHAR(); + switch (ch) { + + case 'i': + if (last) { + return -1; + } + goto DESTI; + + default: + return -1; + } + +DESTI: + NEXT_CHAR(); + switch (ch) { + + case 'n': + if (last) { + return -1; + } + goto DESTIN; + + default: + return -1; + } + +DESTIN: + NEXT_CHAR(); + switch (ch) { + + case 'a': + if (last) { + return -1; + } + goto DESTINA; + + default: + return -1; + } + +DESTINA: + NEXT_CHAR(); + switch (ch) { + + case 't': + if (last) { + return -1; + } + goto DESTINAT; + + default: + return -1; + } + +DESTINAT: + NEXT_CHAR(); + switch (ch) { + + case 'i': + if (last) { + return -1; + } + goto DESTINATI; + + default: + return -1; + } + +DESTINATI: + NEXT_CHAR(); + switch (ch) { + + case 'o': + if (last) { + return -1; + } + goto DESTINATIO; + + default: + return -1; + } + +DESTINATIO: + NEXT_CHAR(); + switch (ch) { + + case 'n': + if (last) { + return 29; + } + goto DESTINATION; + + default: + return -1; + } + +DESTINATION: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +DI: + NEXT_CHAR(); + switch (ch) { + + case 'g': + if (last) { + return -1; + } + goto DIG; + + default: + return -1; + } + +DIG: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return -1; + } + goto DIGE; + + default: + return -1; + } + +DIGE: + NEXT_CHAR(); + switch (ch) { + + case 's': + if (last) { + return -1; + } + goto DIGES; + + default: + return -1; + } + +DIGES: + NEXT_CHAR(); + switch (ch) { + + case 't': + if (last) { + return 30; + } + goto DIGEST; + + default: + return -1; + } + +DIGEST: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +E: + NEXT_CHAR(); + switch (ch) { + + case 't': + if (last) { + return -1; + } + goto ET; + + + case 'x': + if (last) { + return -1; + } + goto EX; + + default: + return -1; + } + +ET: + NEXT_CHAR(); + switch (ch) { + + case 'a': + if (last) { + return -1; + } + goto ETA; + + default: + return -1; + } + +ETA: + NEXT_CHAR(); + switch (ch) { + + case 'g': + if (last) { + return 31; + } + goto ETAG; + + default: + return -1; + } + +ETAG: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +EX: + NEXT_CHAR(); + switch (ch) { + + case 'p': + if (last) { + return -1; + } + goto EXP; + + default: + return -1; + } + +EXP: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return -1; + } + goto EXPE; + + + case 'i': + if (last) { + return -1; + } + goto EXPI; + + default: + return -1; + } + +EXPE: + NEXT_CHAR(); + switch (ch) { + + case 'c': + if (last) { + return -1; + } + goto EXPEC; + + default: + return -1; + } + +EXPEC: + NEXT_CHAR(); + switch (ch) { + + case 't': + if (last) { + return 32; + } + goto EXPECT; + + default: + return -1; + } + +EXPECT: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +EXPI: + NEXT_CHAR(); + switch (ch) { + + case 'r': + if (last) { + return -1; + } + goto EXPIR; + + default: + return -1; + } + +EXPIR: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return -1; + } + goto EXPIRE; + + default: + return -1; + } + +EXPIRE: + NEXT_CHAR(); + switch (ch) { + + case 's': + if (last) { + return 33; + } + goto EXPIRES; + + default: + return -1; + } + +EXPIRES: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +F: + NEXT_CHAR(); + switch (ch) { + + case 'o': + if (last) { + return -1; + } + goto FO; + + + case 'r': + if (last) { + return -1; + } + goto FR; + + default: + return -1; + } + +FO: + NEXT_CHAR(); + switch (ch) { + + case 'r': + if (last) { + return -1; + } + goto FOR; + + default: + return -1; + } + +FOR: + NEXT_CHAR(); + switch (ch) { + + case 'w': + if (last) { + return -1; + } + goto FORW; + + default: + return -1; + } + +FORW: + NEXT_CHAR(); + switch (ch) { + + case 'a': + if (last) { + return -1; + } + goto FORWA; + + default: + return -1; + } + +FORWA: + NEXT_CHAR(); + switch (ch) { + + case 'r': + if (last) { + return -1; + } + goto FORWAR; + + default: + return -1; + } + +FORWAR: + NEXT_CHAR(); + switch (ch) { + + case 'd': + if (last) { + return -1; + } + goto FORWARD; + + default: + return -1; + } + +FORWARD: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return -1; + } + goto FORWARDE; + + default: + return -1; + } + +FORWARDE: + NEXT_CHAR(); + switch (ch) { + + case 'd': + if (last) { + return 34; + } + goto FORWARDED; + + default: + return -1; + } + +FORWARDED: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +FR: + NEXT_CHAR(); + switch (ch) { + + case 'o': + if (last) { + return -1; + } + goto FRO; + + default: + return -1; + } + +FRO: + NEXT_CHAR(); + switch (ch) { + + case 'm': + if (last) { + return 35; + } + goto FROM; + + default: + return -1; + } + +FROM: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +H: + NEXT_CHAR(); + switch (ch) { + + case 'o': + if (last) { + return -1; + } + goto HO; + + default: + return -1; + } + +HO: + NEXT_CHAR(); + switch (ch) { + + case 's': + if (last) { + return -1; + } + goto HOS; + + default: + return -1; + } + +HOS: + NEXT_CHAR(); + switch (ch) { + + case 't': + if (last) { + return 36; + } + goto HOST; + + default: + return -1; + } + +HOST: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +I: + NEXT_CHAR(); + switch (ch) { + + case 'f': + if (last) { + return -1; + } + goto IF; + + default: + return -1; + } + +IF: + NEXT_CHAR(); + switch (ch) { + + case '-': + if (last) { + return -1; + } + goto IF_; + + default: + return -1; + } + +IF_: + NEXT_CHAR(); + switch (ch) { + + case 'M': + if (last) { + return -1; + } + goto IF_M; + + + case 'm': + if (last) { + return -1; + } + goto IF_M; + + + case 'N': + if (last) { + return -1; + } + goto IF_N; + + + case 'n': + if (last) { + return -1; + } + goto IF_N; + + + case 'R': + if (last) { + return -1; + } + goto IF_R; + + + case 'r': + if (last) { + return -1; + } + goto IF_R; + + + case 'U': + if (last) { + return -1; + } + goto IF_U; + + + case 'u': + if (last) { + return -1; + } + goto IF_U; + + default: + return -1; + } + +IF_M: + NEXT_CHAR(); + switch (ch) { + + case 'a': + if (last) { + return -1; + } + goto IF_MA; + + + case 'o': + if (last) { + return -1; + } + goto IF_MO; + + default: + return -1; + } + +IF_MA: + NEXT_CHAR(); + switch (ch) { + + case 't': + if (last) { + return -1; + } + goto IF_MAT; + + default: + return -1; + } + +IF_MAT: + NEXT_CHAR(); + switch (ch) { + + case 'c': + if (last) { + return -1; + } + goto IF_MATC; + + default: + return -1; + } + +IF_MATC: + NEXT_CHAR(); + switch (ch) { + + case 'h': + if (last) { + return 37; + } + goto IF_MATCH; + + default: + return -1; + } + +IF_MATCH: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +IF_MO: + NEXT_CHAR(); + switch (ch) { + + case 'd': + if (last) { + return -1; + } + goto IF_MOD; + + default: + return -1; + } + +IF_MOD: + NEXT_CHAR(); + switch (ch) { + + case 'i': + if (last) { + return -1; + } + goto IF_MODI; + + default: + return -1; + } + +IF_MODI: + NEXT_CHAR(); + switch (ch) { + + case 'f': + if (last) { + return -1; + } + goto IF_MODIF; + + default: + return -1; + } + +IF_MODIF: + NEXT_CHAR(); + switch (ch) { + + case 'i': + if (last) { + return -1; + } + goto IF_MODIFI; + + default: + return -1; + } + +IF_MODIFI: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return -1; + } + goto IF_MODIFIE; + + default: + return -1; + } + +IF_MODIFIE: + NEXT_CHAR(); + switch (ch) { + + case 'd': + if (last) { + return -1; + } + goto IF_MODIFIED; + + default: + return -1; + } + +IF_MODIFIED: + NEXT_CHAR(); + switch (ch) { + + case '-': + if (last) { + return -1; + } + goto IF_MODIFIED_; + + default: + return -1; + } + +IF_MODIFIED_: + NEXT_CHAR(); + switch (ch) { + + case 'S': + if (last) { + return -1; + } + goto IF_MODIFIED_S; + + + case 's': + if (last) { + return -1; + } + goto IF_MODIFIED_S; + + default: + return -1; + } + +IF_MODIFIED_S: + NEXT_CHAR(); + switch (ch) { + + case 'i': + if (last) { + return -1; + } + goto IF_MODIFIED_SI; + + default: + return -1; + } + +IF_MODIFIED_SI: + NEXT_CHAR(); + switch (ch) { + + case 'n': + if (last) { + return -1; + } + goto IF_MODIFIED_SIN; + + default: + return -1; + } + +IF_MODIFIED_SIN: + NEXT_CHAR(); + switch (ch) { + + case 'c': + if (last) { + return -1; + } + goto IF_MODIFIED_SINC; + + default: + return -1; + } + +IF_MODIFIED_SINC: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return 38; + } + goto IF_MODIFIED_SINCE; + + default: + return -1; + } + +IF_MODIFIED_SINCE: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +IF_N: + NEXT_CHAR(); + switch (ch) { + + case 'o': + if (last) { + return -1; + } + goto IF_NO; + + default: + return -1; + } + +IF_NO: + NEXT_CHAR(); + switch (ch) { + + case 'n': + if (last) { + return -1; + } + goto IF_NON; + + default: + return -1; + } + +IF_NON: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return -1; + } + goto IF_NONE; + + default: + return -1; + } + +IF_NONE: + NEXT_CHAR(); + switch (ch) { + + case '-': + if (last) { + return -1; + } + goto IF_NONE_; + + default: + return -1; + } + +IF_NONE_: + NEXT_CHAR(); + switch (ch) { + + case 'M': + if (last) { + return -1; + } + goto IF_NONE_M; + + + case 'm': + if (last) { + return -1; + } + goto IF_NONE_M; + + default: + return -1; + } + +IF_NONE_M: + NEXT_CHAR(); + switch (ch) { + + case 'a': + if (last) { + return -1; + } + goto IF_NONE_MA; + + default: + return -1; + } + +IF_NONE_MA: + NEXT_CHAR(); + switch (ch) { + + case 't': + if (last) { + return -1; + } + goto IF_NONE_MAT; + + default: + return -1; + } + +IF_NONE_MAT: + NEXT_CHAR(); + switch (ch) { + + case 'c': + if (last) { + return -1; + } + goto IF_NONE_MATC; + + default: + return -1; + } + +IF_NONE_MATC: + NEXT_CHAR(); + switch (ch) { + + case 'h': + if (last) { + return 39; + } + goto IF_NONE_MATCH; + + default: + return -1; + } + +IF_NONE_MATCH: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +IF_R: + NEXT_CHAR(); + switch (ch) { + + case 'a': + if (last) { + return -1; + } + goto IF_RA; + + default: + return -1; + } + +IF_RA: + NEXT_CHAR(); + switch (ch) { + + case 'n': + if (last) { + return -1; + } + goto IF_RAN; + + default: + return -1; + } + +IF_RAN: + NEXT_CHAR(); + switch (ch) { + + case 'g': + if (last) { + return -1; + } + goto IF_RANG; + + default: + return -1; + } + +IF_RANG: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return 40; + } + goto IF_RANGE; + + default: + return -1; + } + +IF_RANGE: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +IF_U: + NEXT_CHAR(); + switch (ch) { + + case 'n': + if (last) { + return -1; + } + goto IF_UN; + + default: + return -1; + } + +IF_UN: + NEXT_CHAR(); + switch (ch) { + + case 'm': + if (last) { + return -1; + } + goto IF_UNM; + + default: + return -1; + } + +IF_UNM: + NEXT_CHAR(); + switch (ch) { + + case 'o': + if (last) { + return -1; + } + goto IF_UNMO; + + default: + return -1; + } + +IF_UNMO: + NEXT_CHAR(); + switch (ch) { + + case 'd': + if (last) { + return -1; + } + goto IF_UNMOD; + + default: + return -1; + } + +IF_UNMOD: + NEXT_CHAR(); + switch (ch) { + + case 'i': + if (last) { + return -1; + } + goto IF_UNMODI; + + default: + return -1; + } + +IF_UNMODI: + NEXT_CHAR(); + switch (ch) { + + case 'f': + if (last) { + return -1; + } + goto IF_UNMODIF; + + default: + return -1; + } + +IF_UNMODIF: + NEXT_CHAR(); + switch (ch) { + + case 'i': + if (last) { + return -1; + } + goto IF_UNMODIFI; + + default: + return -1; + } + +IF_UNMODIFI: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return -1; + } + goto IF_UNMODIFIE; + + default: + return -1; + } + +IF_UNMODIFIE: + NEXT_CHAR(); + switch (ch) { + + case 'd': + if (last) { + return -1; + } + goto IF_UNMODIFIED; + + default: + return -1; + } + +IF_UNMODIFIED: + NEXT_CHAR(); + switch (ch) { + + case '-': + if (last) { + return -1; + } + goto IF_UNMODIFIED_; + + default: + return -1; + } + +IF_UNMODIFIED_: + NEXT_CHAR(); + switch (ch) { + + case 'S': + if (last) { + return -1; + } + goto IF_UNMODIFIED_S; + + + case 's': + if (last) { + return -1; + } + goto IF_UNMODIFIED_S; + + default: + return -1; + } + +IF_UNMODIFIED_S: + NEXT_CHAR(); + switch (ch) { + + case 'i': + if (last) { + return -1; + } + goto IF_UNMODIFIED_SI; + + default: + return -1; + } + +IF_UNMODIFIED_SI: + NEXT_CHAR(); + switch (ch) { + + case 'n': + if (last) { + return -1; + } + goto IF_UNMODIFIED_SIN; + + default: + return -1; + } + +IF_UNMODIFIED_SIN: + NEXT_CHAR(); + switch (ch) { + + case 'c': + if (last) { + return -1; + } + goto IF_UNMODIFIED_SINC; + + default: + return -1; + } + +IF_UNMODIFIED_SINC: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return 41; + } + goto IF_UNMODIFIED_SINCE; + + default: + return -1; + } + +IF_UNMODIFIED_SINCE: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +K: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return -1; + } + goto KE; + + default: + return -1; + } + +KE: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return -1; + } + goto KEE; + + default: + return -1; + } + +KEE: + NEXT_CHAR(); + switch (ch) { + + case 'p': + if (last) { + return -1; + } + goto KEEP; + + default: + return -1; + } + +KEEP: + NEXT_CHAR(); + switch (ch) { + + case '-': + if (last) { + return -1; + } + goto KEEP_; + + default: + return -1; + } + +KEEP_: + NEXT_CHAR(); + switch (ch) { + + case 'A': + if (last) { + return -1; + } + goto KEEP_A; + + + case 'a': + if (last) { + return -1; + } + goto KEEP_A; + + default: + return -1; + } + +KEEP_A: + NEXT_CHAR(); + switch (ch) { + + case 'l': + if (last) { + return -1; + } + goto KEEP_AL; + + default: + return -1; + } + +KEEP_AL: + NEXT_CHAR(); + switch (ch) { + + case 'i': + if (last) { + return -1; + } + goto KEEP_ALI; + + default: + return -1; + } + +KEEP_ALI: + NEXT_CHAR(); + switch (ch) { + + case 'v': + if (last) { + return -1; + } + goto KEEP_ALIV; + + default: + return -1; + } + +KEEP_ALIV: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return 42; + } + goto KEEP_ALIVE; + + default: + return -1; + } + +KEEP_ALIVE: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +L: + NEXT_CHAR(); + switch (ch) { + + case 'a': + if (last) { + return -1; + } + goto LA; + + + case 'i': + if (last) { + return -1; + } + goto LI; + + + case 'o': + if (last) { + return -1; + } + goto LO; + + default: + return -1; + } + +LA: + NEXT_CHAR(); + switch (ch) { + + case 's': + if (last) { + return -1; + } + goto LAS; + + default: + return -1; + } + +LAS: + NEXT_CHAR(); + switch (ch) { + + case 't': + if (last) { + return -1; + } + goto LAST; + + default: + return -1; + } + +LAST: + NEXT_CHAR(); + switch (ch) { + + case '-': + if (last) { + return -1; + } + goto LAST_; + + default: + return -1; + } + +LAST_: + NEXT_CHAR(); + switch (ch) { + + case 'E': + if (last) { + return -1; + } + goto LAST_E; + + + case 'e': + if (last) { + return -1; + } + goto LAST_E; + + + case 'M': + if (last) { + return -1; + } + goto LAST_M; + + + case 'm': + if (last) { + return -1; + } + goto LAST_M; + + default: + return -1; + } + +LAST_E: + NEXT_CHAR(); + switch (ch) { + + case 'v': + if (last) { + return -1; + } + goto LAST_EV; + + default: + return -1; + } + +LAST_EV: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return -1; + } + goto LAST_EVE; + + default: + return -1; + } + +LAST_EVE: + NEXT_CHAR(); + switch (ch) { + + case 'n': + if (last) { + return -1; + } + goto LAST_EVEN; + + default: + return -1; + } + +LAST_EVEN: + NEXT_CHAR(); + switch (ch) { + + case 't': + if (last) { + return -1; + } + goto LAST_EVENT; + + default: + return -1; + } + +LAST_EVENT: + NEXT_CHAR(); + switch (ch) { + + case '-': + if (last) { + return -1; + } + goto LAST_EVENT_; + + default: + return -1; + } + +LAST_EVENT_: + NEXT_CHAR(); + switch (ch) { + + case 'I': + if (last) { + return -1; + } + goto LAST_EVENT_I; + + + case 'i': + if (last) { + return -1; + } + goto LAST_EVENT_I; + + default: + return -1; + } + +LAST_EVENT_I: + NEXT_CHAR(); + switch (ch) { + + case 'd': + if (last) { + return 43; + } + goto LAST_EVENT_ID; + + default: + return -1; + } + +LAST_EVENT_ID: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +LAST_M: + NEXT_CHAR(); + switch (ch) { + + case 'o': + if (last) { + return -1; + } + goto LAST_MO; + + default: + return -1; + } + +LAST_MO: + NEXT_CHAR(); + switch (ch) { + + case 'd': + if (last) { + return -1; + } + goto LAST_MOD; + + default: + return -1; + } + +LAST_MOD: + NEXT_CHAR(); + switch (ch) { + + case 'i': + if (last) { + return -1; + } + goto LAST_MODI; + + default: + return -1; + } + +LAST_MODI: + NEXT_CHAR(); + switch (ch) { + + case 'f': + if (last) { + return -1; + } + goto LAST_MODIF; + + default: + return -1; + } + +LAST_MODIF: + NEXT_CHAR(); + switch (ch) { + + case 'i': + if (last) { + return -1; + } + goto LAST_MODIFI; + + default: + return -1; + } + +LAST_MODIFI: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return -1; + } + goto LAST_MODIFIE; + + default: + return -1; + } + +LAST_MODIFIE: + NEXT_CHAR(); + switch (ch) { + + case 'd': + if (last) { + return 44; + } + goto LAST_MODIFIED; + + default: + return -1; + } + +LAST_MODIFIED: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +LI: + NEXT_CHAR(); + switch (ch) { + + case 'n': + if (last) { + return -1; + } + goto LIN; + + default: + return -1; + } + +LIN: + NEXT_CHAR(); + switch (ch) { + + case 'k': + if (last) { + return 45; + } + goto LINK; + + default: + return -1; + } + +LINK: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +LO: + NEXT_CHAR(); + switch (ch) { + + case 'c': + if (last) { + return -1; + } + goto LOC; + + default: + return -1; + } + +LOC: + NEXT_CHAR(); + switch (ch) { + + case 'a': + if (last) { + return -1; + } + goto LOCA; + + default: + return -1; + } + +LOCA: + NEXT_CHAR(); + switch (ch) { + + case 't': + if (last) { + return -1; + } + goto LOCAT; + + default: + return -1; + } + +LOCAT: + NEXT_CHAR(); + switch (ch) { + + case 'i': + if (last) { + return -1; + } + goto LOCATI; + + default: + return -1; + } + +LOCATI: + NEXT_CHAR(); + switch (ch) { + + case 'o': + if (last) { + return -1; + } + goto LOCATIO; + + default: + return -1; + } + +LOCATIO: + NEXT_CHAR(); + switch (ch) { + + case 'n': + if (last) { + return 46; + } + goto LOCATION; + + default: + return -1; + } + +LOCATION: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +M: + NEXT_CHAR(); + switch (ch) { + + case 'a': + if (last) { + return -1; + } + goto MA; + + default: + return -1; + } + +MA: + NEXT_CHAR(); + switch (ch) { + + case 'x': + if (last) { + return -1; + } + goto MAX; + + default: + return -1; + } + +MAX: + NEXT_CHAR(); + switch (ch) { + + case '-': + if (last) { + return -1; + } + goto MAX_; + + default: + return -1; + } + +MAX_: + NEXT_CHAR(); + switch (ch) { + + case 'F': + if (last) { + return -1; + } + goto MAX_F; + + + case 'f': + if (last) { + return -1; + } + goto MAX_F; + + default: + return -1; + } + +MAX_F: + NEXT_CHAR(); + switch (ch) { + + case 'o': + if (last) { + return -1; + } + goto MAX_FO; + + default: + return -1; + } + +MAX_FO: + NEXT_CHAR(); + switch (ch) { + + case 'r': + if (last) { + return -1; + } + goto MAX_FOR; + + default: + return -1; + } + +MAX_FOR: + NEXT_CHAR(); + switch (ch) { + + case 'w': + if (last) { + return -1; + } + goto MAX_FORW; + + default: + return -1; + } + +MAX_FORW: + NEXT_CHAR(); + switch (ch) { + + case 'a': + if (last) { + return -1; + } + goto MAX_FORWA; + + default: + return -1; + } + +MAX_FORWA: + NEXT_CHAR(); + switch (ch) { + + case 'r': + if (last) { + return -1; + } + goto MAX_FORWAR; + + default: + return -1; + } + +MAX_FORWAR: + NEXT_CHAR(); + switch (ch) { + + case 'd': + if (last) { + return -1; + } + goto MAX_FORWARD; + + default: + return -1; + } + +MAX_FORWARD: + NEXT_CHAR(); + switch (ch) { + + case 's': + if (last) { + return 47; + } + goto MAX_FORWARDS; + + default: + return -1; + } + +MAX_FORWARDS: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +O: + NEXT_CHAR(); + switch (ch) { + + case 'r': + if (last) { + return -1; + } + goto OR; + + default: + return -1; + } + +OR: + NEXT_CHAR(); + switch (ch) { + + case 'i': + if (last) { + return -1; + } + goto ORI; + + default: + return -1; + } + +ORI: + NEXT_CHAR(); + switch (ch) { + + case 'g': + if (last) { + return -1; + } + goto ORIG; + + default: + return -1; + } + +ORIG: + NEXT_CHAR(); + switch (ch) { + + case 'i': + if (last) { + return -1; + } + goto ORIGI; + + default: + return -1; + } + +ORIGI: + NEXT_CHAR(); + switch (ch) { + + case 'n': + if (last) { + return 48; + } + goto ORIGIN; + + default: + return -1; + } + +ORIGIN: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +P: + NEXT_CHAR(); + switch (ch) { + + case 'r': + if (last) { + return -1; + } + goto PR; + + default: + return -1; + } + +PR: + NEXT_CHAR(); + switch (ch) { + + case 'a': + if (last) { + return -1; + } + goto PRA; + + + case 'o': + if (last) { + return -1; + } + goto PRO; + + default: + return -1; + } + +PRA: + NEXT_CHAR(); + switch (ch) { + + case 'g': + if (last) { + return -1; + } + goto PRAG; + + default: + return -1; + } + +PRAG: + NEXT_CHAR(); + switch (ch) { + + case 'm': + if (last) { + return -1; + } + goto PRAGM; + + default: + return -1; + } + +PRAGM: + NEXT_CHAR(); + switch (ch) { + + case 'a': + if (last) { + return 49; + } + goto PRAGMA; + + default: + return -1; + } + +PRAGMA: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +PRO: + NEXT_CHAR(); + switch (ch) { + + case 'x': + if (last) { + return -1; + } + goto PROX; + + default: + return -1; + } + +PROX: + NEXT_CHAR(); + switch (ch) { + + case 'y': + if (last) { + return -1; + } + goto PROXY; + + default: + return -1; + } + +PROXY: + NEXT_CHAR(); + switch (ch) { + + case '_': + if (last) { + return -1; + } + goto PROXY_; + + + case '-': + if (last) { + return -1; + } + goto PROXY_; + + default: + return -1; + } + +PROXY_: + NEXT_CHAR(); + switch (ch) { + + case 'A': + if (last) { + return -1; + } + goto PROXY_A; + + + case 'a': + if (last) { + return -1; + } + goto PROXY_A; + + default: + return -1; + } + +PROXY_A: + NEXT_CHAR(); + switch (ch) { + + case 'u': + if (last) { + return -1; + } + goto PROXY_AU; + + default: + return -1; + } + +PROXY_AU: + NEXT_CHAR(); + switch (ch) { + + case 't': + if (last) { + return -1; + } + goto PROXY_AUT; + + default: + return -1; + } + +PROXY_AUT: + NEXT_CHAR(); + switch (ch) { + + case 'h': + if (last) { + return -1; + } + goto PROXY_AUTH; + + default: + return -1; + } + +PROXY_AUTH: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return -1; + } + goto PROXY_AUTHE; + + default: + return -1; + } + +PROXY_AUTHE: + NEXT_CHAR(); + switch (ch) { + + case 'n': + if (last) { + return -1; + } + goto PROXY_AUTHEN; + + default: + return -1; + } + +PROXY_AUTHEN: + NEXT_CHAR(); + switch (ch) { + + case 't': + if (last) { + return -1; + } + goto PROXY_AUTHENT; + + default: + return -1; + } + +PROXY_AUTHENT: + NEXT_CHAR(); + switch (ch) { + + case 'i': + if (last) { + return -1; + } + goto PROXY_AUTHENTI; + + default: + return -1; + } + +PROXY_AUTHENTI: + NEXT_CHAR(); + switch (ch) { + + case 'c': + if (last) { + return -1; + } + goto PROXY_AUTHENTIC; + + default: + return -1; + } + +PROXY_AUTHENTIC: + NEXT_CHAR(); + switch (ch) { + + case 'a': + if (last) { + return -1; + } + goto PROXY_AUTHENTICA; + + default: + return -1; + } + +PROXY_AUTHENTICA: + NEXT_CHAR(); + switch (ch) { + + case 't': + if (last) { + return -1; + } + goto PROXY_AUTHENTICAT; + + default: + return -1; + } + +PROXY_AUTHENTICAT: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return 50; + } + goto PROXY_AUTHENTICATE; + + default: + return -1; + } + +PROXY_AUTHENTICATE: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +R: + NEXT_CHAR(); + switch (ch) { + + case 'a': + if (last) { + return -1; + } + goto RA; + + + case 'e': + if (last) { + return -1; + } + goto RE; + + default: + return -1; + } + +RA: + NEXT_CHAR(); + switch (ch) { + + case 'n': + if (last) { + return -1; + } + goto RAN; + + default: + return -1; + } + +RAN: + NEXT_CHAR(); + switch (ch) { + + case 'g': + if (last) { + return -1; + } + goto RANG; + + default: + return -1; + } + +RANG: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return 52; + } + goto RANGE; + + default: + return -1; + } + +RANGE: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +RE: + NEXT_CHAR(); + switch (ch) { + + case 'f': + if (last) { + return -1; + } + goto REF; + + + case 't': + if (last) { + return -1; + } + goto RET; + + default: + return -1; + } + +REF: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return -1; + } + goto REFE; + + default: + return -1; + } + +REFE: + NEXT_CHAR(); + switch (ch) { + + case 'r': + if (last) { + return -1; + } + goto REFER; + + default: + return -1; + } + +REFER: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return -1; + } + goto REFERE; + + default: + return -1; + } + +REFERE: + NEXT_CHAR(); + switch (ch) { + + case 'r': + if (last) { + return 53; + } + goto REFERER; + + default: + return -1; + } + +REFERER: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +RET: + NEXT_CHAR(); + switch (ch) { + + case 'r': + if (last) { + return -1; + } + goto RETR; + + default: + return -1; + } + +RETR: + NEXT_CHAR(); + switch (ch) { + + case 'y': + if (last) { + return -1; + } + goto RETRY; + + default: + return -1; + } + +RETRY: + NEXT_CHAR(); + switch (ch) { + + case '-': + if (last) { + return -1; + } + goto RETRY_; + + default: + return -1; + } + +RETRY_: + NEXT_CHAR(); + switch (ch) { + + case 'A': + if (last) { + return -1; + } + goto RETRY_A; + + + case 'a': + if (last) { + return -1; + } + goto RETRY_A; + + default: + return -1; + } + +RETRY_A: + NEXT_CHAR(); + switch (ch) { + + case 'f': + if (last) { + return -1; + } + goto RETRY_AF; + + default: + return -1; + } + +RETRY_AF: + NEXT_CHAR(); + switch (ch) { + + case 't': + if (last) { + return -1; + } + goto RETRY_AFT; + + default: + return -1; + } + +RETRY_AFT: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return -1; + } + goto RETRY_AFTE; + + default: + return -1; + } + +RETRY_AFTE: + NEXT_CHAR(); + switch (ch) { + + case 'r': + if (last) { + return 54; + } + goto RETRY_AFTER; + + default: + return -1; + } + +RETRY_AFTER: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +S: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return -1; + } + goto SE; + + default: + return -1; + } + +SE: + NEXT_CHAR(); + switch (ch) { + + case 'c': + if (last) { + return -1; + } + goto SEC; + + + case 'r': + if (last) { + return -1; + } + goto SER; + + + case 't': + if (last) { + return -1; + } + goto SET; + + default: + return -1; + } + +SEC: + NEXT_CHAR(); + switch (ch) { + + case '-': + if (last) { + return -1; + } + goto SEC_; + + default: + return -1; + } + +SEC_: + NEXT_CHAR(); + switch (ch) { + + case 'W': + if (last) { + return -1; + } + goto SEC_W; + + + case 'w': + if (last) { + return -1; + } + goto SEC_W; + + default: + return -1; + } + +SEC_W: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return -1; + } + goto SEC_WE; + + default: + return -1; + } + +SEC_WE: + NEXT_CHAR(); + switch (ch) { + + case 'b': + if (last) { + return -1; + } + goto SEC_WEB; + + default: + return -1; + } + +SEC_WEB: + NEXT_CHAR(); + switch (ch) { + + case 's': + if (last) { + return -1; + } + goto SEC_WEBS; + + default: + return -1; + } + +SEC_WEBS: + NEXT_CHAR(); + switch (ch) { + + case 'o': + if (last) { + return -1; + } + goto SEC_WEBSO; + + default: + return -1; + } + +SEC_WEBSO: + NEXT_CHAR(); + switch (ch) { + + case 'c': + if (last) { + return -1; + } + goto SEC_WEBSOC; + + default: + return -1; + } + +SEC_WEBSOC: + NEXT_CHAR(); + switch (ch) { + + case 'k': + if (last) { + return -1; + } + goto SEC_WEBSOCK; + + default: + return -1; + } + +SEC_WEBSOCK: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return -1; + } + goto SEC_WEBSOCKE; + + default: + return -1; + } + +SEC_WEBSOCKE: + NEXT_CHAR(); + switch (ch) { + + case 't': + if (last) { + return -1; + } + goto SEC_WEBSOCKET; + + default: + return -1; + } + +SEC_WEBSOCKET: + NEXT_CHAR(); + switch (ch) { + + case '-': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_; + + default: + return -1; + } + +SEC_WEBSOCKET_: + NEXT_CHAR(); + switch (ch) { + + case 'A': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_A; + + + case 'a': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_A; + + + case 'E': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_E; + + + case 'e': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_E; + + + case 'K': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_K; + + + case 'k': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_K; + + + case 'P': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_P; + + + case 'p': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_P; + + + case 'V': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_V; + + + case 'v': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_V; + + default: + return -1; + } + +SEC_WEBSOCKET_A: + NEXT_CHAR(); + switch (ch) { + + case 'c': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_AC; + + default: + return -1; + } + +SEC_WEBSOCKET_AC: + NEXT_CHAR(); + switch (ch) { + + case 'c': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_ACC; + + default: + return -1; + } + +SEC_WEBSOCKET_ACC: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_ACCE; + + default: + return -1; + } + +SEC_WEBSOCKET_ACCE: + NEXT_CHAR(); + switch (ch) { + + case 'p': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_ACCEP; + + default: + return -1; + } + +SEC_WEBSOCKET_ACCEP: + NEXT_CHAR(); + switch (ch) { + + case 't': + if (last) { + return 55; + } + goto SEC_WEBSOCKET_ACCEPT; + + default: + return -1; + } + +SEC_WEBSOCKET_ACCEPT: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +SEC_WEBSOCKET_E: + NEXT_CHAR(); + switch (ch) { + + case 'x': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_EX; + + default: + return -1; + } + +SEC_WEBSOCKET_EX: + NEXT_CHAR(); + switch (ch) { + + case 't': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_EXT; + + default: + return -1; + } + +SEC_WEBSOCKET_EXT: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_EXTE; + + default: + return -1; + } + +SEC_WEBSOCKET_EXTE: + NEXT_CHAR(); + switch (ch) { + + case 'n': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_EXTEN; + + default: + return -1; + } + +SEC_WEBSOCKET_EXTEN: + NEXT_CHAR(); + switch (ch) { + + case 's': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_EXTENS; + + default: + return -1; + } + +SEC_WEBSOCKET_EXTENS: + NEXT_CHAR(); + switch (ch) { + + case 'i': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_EXTENSI; + + default: + return -1; + } + +SEC_WEBSOCKET_EXTENSI: + NEXT_CHAR(); + switch (ch) { + + case 'o': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_EXTENSIO; + + default: + return -1; + } + +SEC_WEBSOCKET_EXTENSIO: + NEXT_CHAR(); + switch (ch) { + + case 'n': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_EXTENSION; + + default: + return -1; + } + +SEC_WEBSOCKET_EXTENSION: + NEXT_CHAR(); + switch (ch) { + + case 's': + if (last) { + return 56; + } + goto SEC_WEBSOCKET_EXTENSIONS; + + default: + return -1; + } + +SEC_WEBSOCKET_EXTENSIONS: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +SEC_WEBSOCKET_K: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_KE; + + default: + return -1; + } + +SEC_WEBSOCKET_KE: + NEXT_CHAR(); + switch (ch) { + + case 'y': + if (last) { + return 57; + } + goto SEC_WEBSOCKET_KEY; + + default: + return -1; + } + +SEC_WEBSOCKET_KEY: + NEXT_CHAR(); + switch (ch) { + + case '1': + if (last) { + return 58; + } + goto SEC_WEBSOCKET_KEY1; + + default: + return -1; + } + +SEC_WEBSOCKET_KEY1: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +SEC_WEBSOCKET_P: + NEXT_CHAR(); + switch (ch) { + + case 'r': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_PR; + + default: + return -1; + } + +SEC_WEBSOCKET_PR: + NEXT_CHAR(); + switch (ch) { + + case 'o': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_PRO; + + default: + return -1; + } + +SEC_WEBSOCKET_PRO: + NEXT_CHAR(); + switch (ch) { + + case 't': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_PROT; + + default: + return -1; + } + +SEC_WEBSOCKET_PROT: + NEXT_CHAR(); + switch (ch) { + + case 'o': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_PROTO; + + default: + return -1; + } + +SEC_WEBSOCKET_PROTO: + NEXT_CHAR(); + switch (ch) { + + case 'c': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_PROTOC; + + default: + return -1; + } + +SEC_WEBSOCKET_PROTOC: + NEXT_CHAR(); + switch (ch) { + + case 'o': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_PROTOCO; + + default: + return -1; + } + +SEC_WEBSOCKET_PROTOCO: + NEXT_CHAR(); + switch (ch) { + + case 'l': + if (last) { + return 59; + } + goto SEC_WEBSOCKET_PROTOCOL; + + default: + return -1; + } + +SEC_WEBSOCKET_PROTOCOL: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +SEC_WEBSOCKET_V: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_VE; + + default: + return -1; + } + +SEC_WEBSOCKET_VE: + NEXT_CHAR(); + switch (ch) { + + case 'r': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_VER; + + default: + return -1; + } + +SEC_WEBSOCKET_VER: + NEXT_CHAR(); + switch (ch) { + + case 's': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_VERS; + + default: + return -1; + } + +SEC_WEBSOCKET_VERS: + NEXT_CHAR(); + switch (ch) { + + case 'i': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_VERSI; + + default: + return -1; + } + +SEC_WEBSOCKET_VERSI: + NEXT_CHAR(); + switch (ch) { + + case 'o': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_VERSIO; + + default: + return -1; + } + +SEC_WEBSOCKET_VERSIO: + NEXT_CHAR(); + switch (ch) { + + case 'n': + if (last) { + return 60; + } + goto SEC_WEBSOCKET_VERSION; + + default: + return -1; + } + +SEC_WEBSOCKET_VERSION: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +SER: + NEXT_CHAR(); + switch (ch) { + + case 'v': + if (last) { + return -1; + } + goto SERV; + + default: + return -1; + } + +SERV: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return -1; + } + goto SERVE; + + default: + return -1; + } + +SERVE: + NEXT_CHAR(); + switch (ch) { + + case 'r': + if (last) { + return 61; + } + goto SERVER; + + default: + return -1; + } + +SERVER: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +SET: + NEXT_CHAR(); + switch (ch) { + + case '-': + if (last) { + return -1; + } + goto SET_; + + default: + return -1; + } + +SET_: + NEXT_CHAR(); + switch (ch) { + + case 'C': + if (last) { + return -1; + } + goto SET_C; + + + case 'c': + if (last) { + return -1; + } + goto SET_C; + + default: + return -1; + } + +SET_C: + NEXT_CHAR(); + switch (ch) { + + case 'o': + if (last) { + return -1; + } + goto SET_CO; + + default: + return -1; + } + +SET_CO: + NEXT_CHAR(); + switch (ch) { + + case 'o': + if (last) { + return -1; + } + goto SET_COO; + + default: + return -1; + } + +SET_COO: + NEXT_CHAR(); + switch (ch) { + + case 'k': + if (last) { + return -1; + } + goto SET_COOK; + + default: + return -1; + } + +SET_COOK: + NEXT_CHAR(); + switch (ch) { + + case 'i': + if (last) { + return -1; + } + goto SET_COOKI; + + default: + return -1; + } + +SET_COOKI: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return 62; + } + goto SET_COOKIE; + + default: + return -1; + } + +SET_COOKIE: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +T: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return 63; + } + goto TE; + + + case 'r': + if (last) { + return -1; + } + goto TR; + + default: + return -1; + } + +TE: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +TR: + NEXT_CHAR(); + switch (ch) { + + case 'a': + if (last) { + return -1; + } + goto TRA; + + default: + return -1; + } + +TRA: + NEXT_CHAR(); + switch (ch) { + + case 'i': + if (last) { + return -1; + } + goto TRAI; + + + case 'n': + if (last) { + return -1; + } + goto TRAN; + + default: + return -1; + } + +TRAI: + NEXT_CHAR(); + switch (ch) { + + case 'l': + if (last) { + return -1; + } + goto TRAIL; + + default: + return -1; + } + +TRAIL: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return -1; + } + goto TRAILE; + + default: + return -1; + } + +TRAILE: + NEXT_CHAR(); + switch (ch) { + + case 'r': + if (last) { + return 64; + } + goto TRAILER; + + default: + return -1; + } + +TRAILER: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +TRAN: + NEXT_CHAR(); + switch (ch) { + + case 's': + if (last) { + return -1; + } + goto TRANS; + + default: + return -1; + } + +TRANS: + NEXT_CHAR(); + switch (ch) { + + case 'f': + if (last) { + return -1; + } + goto TRANSF; + + default: + return -1; + } + +TRANSF: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return -1; + } + goto TRANSFE; + + default: + return -1; + } + +TRANSFE: + NEXT_CHAR(); + switch (ch) { + + case 'r': + if (last) { + return -1; + } + goto TRANSFER; + + default: + return -1; + } + +TRANSFER: + NEXT_CHAR(); + switch (ch) { + + case '-': + if (last) { + return -1; + } + goto TRANSFER_; + + default: + return -1; + } + +TRANSFER_: + NEXT_CHAR(); + switch (ch) { + + case 'E': + if (last) { + return -1; + } + goto TRANSFER_E; + + + case 'e': + if (last) { + return -1; + } + goto TRANSFER_E; + + default: + return -1; + } + +TRANSFER_E: + NEXT_CHAR(); + switch (ch) { + + case 'n': + if (last) { + return -1; + } + goto TRANSFER_EN; + + default: + return -1; + } + +TRANSFER_EN: + NEXT_CHAR(); + switch (ch) { + + case 'c': + if (last) { + return -1; + } + goto TRANSFER_ENC; + + default: + return -1; + } + +TRANSFER_ENC: + NEXT_CHAR(); + switch (ch) { + + case 'o': + if (last) { + return -1; + } + goto TRANSFER_ENCO; + + default: + return -1; + } + +TRANSFER_ENCO: + NEXT_CHAR(); + switch (ch) { + + case 'd': + if (last) { + return -1; + } + goto TRANSFER_ENCOD; + + default: + return -1; + } + +TRANSFER_ENCOD: + NEXT_CHAR(); + switch (ch) { + + case 'i': + if (last) { + return -1; + } + goto TRANSFER_ENCODI; + + default: + return -1; + } + +TRANSFER_ENCODI: + NEXT_CHAR(); + switch (ch) { + + case 'n': + if (last) { + return -1; + } + goto TRANSFER_ENCODIN; + + default: + return -1; + } + +TRANSFER_ENCODIN: + NEXT_CHAR(); + switch (ch) { + + case 'g': + if (last) { + return 65; + } + goto TRANSFER_ENCODING; + + default: + return -1; + } + +TRANSFER_ENCODING: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +U: + NEXT_CHAR(); + switch (ch) { + + case 'p': + if (last) { + return -1; + } + goto UP; + + + case 'r': + if (last) { + return -1; + } + goto UR; + + + case 's': + if (last) { + return -1; + } + goto US; + + default: + return -1; + } + +UP: + NEXT_CHAR(); + switch (ch) { + + case 'g': + if (last) { + return -1; + } + goto UPG; + + default: + return -1; + } + +UPG: + NEXT_CHAR(); + switch (ch) { + + case 'r': + if (last) { + return -1; + } + goto UPGR; + + default: + return -1; + } + +UPGR: + NEXT_CHAR(); + switch (ch) { + + case 'a': + if (last) { + return -1; + } + goto UPGRA; + + default: + return -1; + } + +UPGRA: + NEXT_CHAR(); + switch (ch) { + + case 'd': + if (last) { + return -1; + } + goto UPGRAD; + + default: + return -1; + } + +UPGRAD: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return 66; + } + goto UPGRADE; + + default: + return -1; + } + +UPGRADE: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +UR: + NEXT_CHAR(); + switch (ch) { + + case 'i': + if (last) { + return 67; + } + goto URI; + + default: + return -1; + } + +URI: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +US: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return -1; + } + goto USE; + + default: + return -1; + } + +USE: + NEXT_CHAR(); + switch (ch) { + + case 'r': + if (last) { + return -1; + } + goto USER; + + default: + return -1; + } + +USER: + NEXT_CHAR(); + switch (ch) { + + case '-': + if (last) { + return -1; + } + goto USER_; + + default: + return -1; + } + +USER_: + NEXT_CHAR(); + switch (ch) { + + case 'A': + if (last) { + return -1; + } + goto USER_A; + + + case 'a': + if (last) { + return -1; + } + goto USER_A; + + default: + return -1; + } + +USER_A: + NEXT_CHAR(); + switch (ch) { + + case 'g': + if (last) { + return -1; + } + goto USER_AG; + + default: + return -1; + } + +USER_AG: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return -1; + } + goto USER_AGE; + + default: + return -1; + } + +USER_AGE: + NEXT_CHAR(); + switch (ch) { + + case 'n': + if (last) { + return -1; + } + goto USER_AGEN; + + default: + return -1; + } + +USER_AGEN: + NEXT_CHAR(); + switch (ch) { + + case 't': + if (last) { + return 68; + } + goto USER_AGENT; + + default: + return -1; + } + +USER_AGENT: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +V: + NEXT_CHAR(); + switch (ch) { + + case 'a': + if (last) { + return -1; + } + goto VA; + + + case 'i': + if (last) { + return -1; + } + goto VI; + + default: + return -1; + } + +VA: + NEXT_CHAR(); + switch (ch) { + + case 'r': + if (last) { + return -1; + } + goto VAR; + + default: + return -1; + } + +VAR: + NEXT_CHAR(); + switch (ch) { + + case 'y': + if (last) { + return 69; + } + goto VARY; + + default: + return -1; + } + +VARY: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +VI: + NEXT_CHAR(); + switch (ch) { + + case 'a': + if (last) { + return 70; + } + goto VIA; + + default: + return -1; + } + +VIA: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +W: + NEXT_CHAR(); + switch (ch) { + + case 'a': + if (last) { + return -1; + } + goto WA; + + + case 'e': + if (last) { + return -1; + } + goto WE; + + + case 'w': + if (last) { + return -1; + } + goto WW; + + default: + return -1; + } + +WA: + NEXT_CHAR(); + switch (ch) { + + case 'n': + if (last) { + return -1; + } + goto WAN; + + + case 'r': + if (last) { + return -1; + } + goto WAR; + + default: + return -1; + } + +WAN: + NEXT_CHAR(); + switch (ch) { + + case 't': + if (last) { + return -1; + } + goto WANT; + + default: + return -1; + } + +WANT: + NEXT_CHAR(); + switch (ch) { + + case '-': + if (last) { + return -1; + } + goto WANT_; + + default: + return -1; + } + +WANT_: + NEXT_CHAR(); + switch (ch) { + + case 'D': + if (last) { + return -1; + } + goto WANT_D; + + + case 'd': + if (last) { + return -1; + } + goto WANT_D; + + default: + return -1; + } + +WANT_D: + NEXT_CHAR(); + switch (ch) { + + case 'i': + if (last) { + return -1; + } + goto WANT_DI; + + default: + return -1; + } + +WANT_DI: + NEXT_CHAR(); + switch (ch) { + + case 'g': + if (last) { + return -1; + } + goto WANT_DIG; + + default: + return -1; + } + +WANT_DIG: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return -1; + } + goto WANT_DIGE; + + default: + return -1; + } + +WANT_DIGE: + NEXT_CHAR(); + switch (ch) { + + case 's': + if (last) { + return -1; + } + goto WANT_DIGES; + + default: + return -1; + } + +WANT_DIGES: + NEXT_CHAR(); + switch (ch) { + + case 't': + if (last) { + return 71; + } + goto WANT_DIGEST; + + default: + return -1; + } + +WANT_DIGEST: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +WAR: + NEXT_CHAR(); + switch (ch) { + + case 'n': + if (last) { + return -1; + } + goto WARN; + + default: + return -1; + } + +WARN: + NEXT_CHAR(); + switch (ch) { + + case 'i': + if (last) { + return -1; + } + goto WARNI; + + default: + return -1; + } + +WARNI: + NEXT_CHAR(); + switch (ch) { + + case 'n': + if (last) { + return -1; + } + goto WARNIN; + + default: + return -1; + } + +WARNIN: + NEXT_CHAR(); + switch (ch) { + + case 'g': + if (last) { + return 72; + } + goto WARNING; + + default: + return -1; + } + +WARNING: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +WE: + NEXT_CHAR(); + switch (ch) { + + case 'b': + if (last) { + return -1; + } + goto WEB; + + default: + return -1; + } + +WEB: + NEXT_CHAR(); + switch (ch) { + + case 's': + if (last) { + return -1; + } + goto WEBS; + + default: + return -1; + } + +WEBS: + NEXT_CHAR(); + switch (ch) { + + case 'o': + if (last) { + return -1; + } + goto WEBSO; + + default: + return -1; + } + +WEBSO: + NEXT_CHAR(); + switch (ch) { + + case 'c': + if (last) { + return -1; + } + goto WEBSOC; + + default: + return -1; + } + +WEBSOC: + NEXT_CHAR(); + switch (ch) { + + case 'k': + if (last) { + return -1; + } + goto WEBSOCK; + + default: + return -1; + } + +WEBSOCK: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return -1; + } + goto WEBSOCKE; + + default: + return -1; + } + +WEBSOCKE: + NEXT_CHAR(); + switch (ch) { + + case 't': + if (last) { + return 73; + } + goto WEBSOCKET; + + default: + return -1; + } + +WEBSOCKET: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +WW: + NEXT_CHAR(); + switch (ch) { + + case 'w': + if (last) { + return -1; + } + goto WWW; + + default: + return -1; + } + +WWW: + NEXT_CHAR(); + switch (ch) { + + case '-': + if (last) { + return -1; + } + goto WWW_; + + default: + return -1; + } + +WWW_: + NEXT_CHAR(); + switch (ch) { + + case 'A': + if (last) { + return -1; + } + goto WWW_A; + + + case 'a': + if (last) { + return -1; + } + goto WWW_A; + + default: + return -1; + } + +WWW_A: + NEXT_CHAR(); + switch (ch) { + + case 'u': + if (last) { + return -1; + } + goto WWW_AU; + + default: + return -1; + } + +WWW_AU: + NEXT_CHAR(); + switch (ch) { + + case 't': + if (last) { + return -1; + } + goto WWW_AUT; + + default: + return -1; + } + +WWW_AUT: + NEXT_CHAR(); + switch (ch) { + + case 'h': + if (last) { + return -1; + } + goto WWW_AUTH; + + default: + return -1; + } + +WWW_AUTH: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return -1; + } + goto WWW_AUTHE; + + default: + return -1; + } + +WWW_AUTHE: + NEXT_CHAR(); + switch (ch) { + + case 'n': + if (last) { + return -1; + } + goto WWW_AUTHEN; + + default: + return -1; + } + +WWW_AUTHEN: + NEXT_CHAR(); + switch (ch) { + + case 't': + if (last) { + return -1; + } + goto WWW_AUTHENT; + + default: + return -1; + } + +WWW_AUTHENT: + NEXT_CHAR(); + switch (ch) { + + case 'i': + if (last) { + return -1; + } + goto WWW_AUTHENTI; + + default: + return -1; + } + +WWW_AUTHENTI: + NEXT_CHAR(); + switch (ch) { + + case 'c': + if (last) { + return -1; + } + goto WWW_AUTHENTIC; + + default: + return -1; + } + +WWW_AUTHENTIC: + NEXT_CHAR(); + switch (ch) { + + case 'a': + if (last) { + return -1; + } + goto WWW_AUTHENTICA; + + default: + return -1; + } + +WWW_AUTHENTICA: + NEXT_CHAR(); + switch (ch) { + + case 't': + if (last) { + return -1; + } + goto WWW_AUTHENTICAT; + + default: + return -1; + } + +WWW_AUTHENTICAT: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return 74; + } + goto WWW_AUTHENTICATE; + + default: + return -1; + } + +WWW_AUTHENTICATE: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +X: + NEXT_CHAR(); + switch (ch) { + + case '-': + if (last) { + return -1; + } + goto X_; + + default: + return -1; + } + +X_: + NEXT_CHAR(); + switch (ch) { + + case 'F': + if (last) { + return -1; + } + goto X_F; + + + case 'f': + if (last) { + return -1; + } + goto X_F; + + default: + return -1; + } + +X_F: + NEXT_CHAR(); + switch (ch) { + + case 'o': + if (last) { + return -1; + } + goto X_FO; + + default: + return -1; + } + +X_FO: + NEXT_CHAR(); + switch (ch) { + + case 'r': + if (last) { + return -1; + } + goto X_FOR; + + default: + return -1; + } + +X_FOR: + NEXT_CHAR(); + switch (ch) { + + case 'w': + if (last) { + return -1; + } + goto X_FORW; + + default: + return -1; + } + +X_FORW: + NEXT_CHAR(); + switch (ch) { + + case 'a': + if (last) { + return -1; + } + goto X_FORWA; + + default: + return -1; + } + +X_FORWA: + NEXT_CHAR(); + switch (ch) { + + case 'r': + if (last) { + return -1; + } + goto X_FORWAR; + + default: + return -1; + } + +X_FORWAR: + NEXT_CHAR(); + switch (ch) { + + case 'd': + if (last) { + return -1; + } + goto X_FORWARD; + + default: + return -1; + } + +X_FORWARD: + NEXT_CHAR(); + switch (ch) { + + case 'e': + if (last) { + return -1; + } + goto X_FORWARDE; + + default: + return -1; + } + +X_FORWARDE: + NEXT_CHAR(); + switch (ch) { + + case 'd': + if (last) { + return -1; + } + goto X_FORWARDED; + + default: + return -1; + } + +X_FORWARDED: + NEXT_CHAR(); + switch (ch) { + + case '-': + if (last) { + return -1; + } + goto X_FORWARDED_; + + default: + return -1; + } + +X_FORWARDED_: + NEXT_CHAR(); + switch (ch) { + + case 'F': + if (last) { + return -1; + } + goto X_FORWARDED_F; + + + case 'f': + if (last) { + return -1; + } + goto X_FORWARDED_F; + + + case 'H': + if (last) { + return -1; + } + goto X_FORWARDED_H; + + + case 'h': + if (last) { + return -1; + } + goto X_FORWARDED_H; + + + case 'P': + if (last) { + return -1; + } + goto X_FORWARDED_P; + + + case 'p': + if (last) { + return -1; + } + goto X_FORWARDED_P; + + default: + return -1; + } + +X_FORWARDED_F: + NEXT_CHAR(); + switch (ch) { + + case 'o': + if (last) { + return -1; + } + goto X_FORWARDED_FO; + + default: + return -1; + } + +X_FORWARDED_FO: + NEXT_CHAR(); + switch (ch) { + + case 'r': + if (last) { + return 75; + } + goto X_FORWARDED_FOR; + + default: + return -1; + } + +X_FORWARDED_FOR: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +X_FORWARDED_H: + NEXT_CHAR(); + switch (ch) { + + case 'o': + if (last) { + return -1; + } + goto X_FORWARDED_HO; + + default: + return -1; + } + +X_FORWARDED_HO: + NEXT_CHAR(); + switch (ch) { + + case 's': + if (last) { + return -1; + } + goto X_FORWARDED_HOS; + + default: + return -1; + } + +X_FORWARDED_HOS: + NEXT_CHAR(); + switch (ch) { + + case 't': + if (last) { + return 76; + } + goto X_FORWARDED_HOST; + + default: + return -1; + } + +X_FORWARDED_HOST: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +X_FORWARDED_P: + NEXT_CHAR(); + switch (ch) { + + case 'r': + if (last) { + return -1; + } + goto X_FORWARDED_PR; + + default: + return -1; + } + +X_FORWARDED_PR: + NEXT_CHAR(); + switch (ch) { + + case 'o': + if (last) { + return -1; + } + goto X_FORWARDED_PRO; + + default: + return -1; + } + +X_FORWARDED_PRO: + NEXT_CHAR(); + switch (ch) { + + case 't': + if (last) { + return -1; + } + goto X_FORWARDED_PROT; + + default: + return -1; + } + +X_FORWARDED_PROT: + NEXT_CHAR(); + switch (ch) { + + case 'o': + if (last) { + return 77; + } + goto X_FORWARDED_PROTO; + + default: + return -1; + } + +X_FORWARDED_PROTO: + NEXT_CHAR(); + switch (ch) { + + default: + return -1; + } + +missing: + return -1; +} diff --git a/aiohttp/_find_header.h b/aiohttp/_find_header.h new file mode 100644 index 00000000000..99b7b4f8282 --- /dev/null +++ b/aiohttp/_find_header.h @@ -0,0 +1,14 @@ +#ifndef _FIND_HEADERS_H +#define _FIND_HEADERS_H + +#ifdef __cplusplus +extern "C" { +#endif + +int find_header(const char *str, int size); + + +#ifdef __cplusplus +} +#endif +#endif diff --git a/aiohttp/_find_header.pxd b/aiohttp/_find_header.pxd new file mode 100644 index 00000000000..37a6c37268e --- /dev/null +++ b/aiohttp/_find_header.pxd @@ -0,0 +1,2 @@ +cdef extern from "_find_header.h": + int find_header(char *, int) diff --git a/aiohttp/_headers.pxi b/aiohttp/_headers.pxi new file mode 100644 index 00000000000..06e1b76d41f --- /dev/null +++ b/aiohttp/_headers.pxi @@ -0,0 +1,81 @@ +from . import hdrs +cdef tuple headers = ( + hdrs.ACCEPT, + hdrs.ACCEPT_CHARSET, + hdrs.ACCEPT_ENCODING, + hdrs.ACCEPT_LANGUAGE, + hdrs.ACCEPT_RANGES, + hdrs.ACCESS_CONTROL_ALLOW_CREDENTIALS, + hdrs.ACCESS_CONTROL_ALLOW_HEADERS, + hdrs.ACCESS_CONTROL_ALLOW_METHODS, + hdrs.ACCESS_CONTROL_ALLOW_ORIGIN, + hdrs.ACCESS_CONTROL_EXPOSE_HEADERS, + hdrs.ACCESS_CONTROL_MAX_AGE, + hdrs.ACCESS_CONTROL_REQUEST_HEADERS, + hdrs.ACCESS_CONTROL_REQUEST_METHOD, + hdrs.AGE, + hdrs.ALLOW, + hdrs.AUTHORIZATION, + hdrs.CACHE_CONTROL, + hdrs.CONNECTION, + hdrs.CONTENT_DISPOSITION, + hdrs.CONTENT_ENCODING, + hdrs.CONTENT_LANGUAGE, + hdrs.CONTENT_LENGTH, + hdrs.CONTENT_LOCATION, + hdrs.CONTENT_MD5, + hdrs.CONTENT_RANGE, + hdrs.CONTENT_TRANSFER_ENCODING, + hdrs.CONTENT_TYPE, + hdrs.COOKIE, + hdrs.DATE, + hdrs.DESTINATION, + hdrs.DIGEST, + hdrs.ETAG, + hdrs.EXPECT, + hdrs.EXPIRES, + hdrs.FORWARDED, + hdrs.FROM, + hdrs.HOST, + hdrs.IF_MATCH, + hdrs.IF_MODIFIED_SINCE, + hdrs.IF_NONE_MATCH, + hdrs.IF_RANGE, + hdrs.IF_UNMODIFIED_SINCE, + hdrs.KEEP_ALIVE, + hdrs.LAST_EVENT_ID, + hdrs.LAST_MODIFIED, + hdrs.LINK, + hdrs.LOCATION, + hdrs.MAX_FORWARDS, + hdrs.ORIGIN, + hdrs.PRAGMA, + hdrs.PROXY_AUTHENTICATE, + hdrs.PROXY_AUTHORIZATION, + hdrs.RANGE, + hdrs.REFERER, + hdrs.RETRY_AFTER, + hdrs.SEC_WEBSOCKET_ACCEPT, + hdrs.SEC_WEBSOCKET_EXTENSIONS, + hdrs.SEC_WEBSOCKET_KEY, + hdrs.SEC_WEBSOCKET_KEY1, + hdrs.SEC_WEBSOCKET_PROTOCOL, + hdrs.SEC_WEBSOCKET_VERSION, + hdrs.SERVER, + hdrs.SET_COOKIE, + hdrs.TE, + hdrs.TRAILER, + hdrs.TRANSFER_ENCODING, + hdrs.UPGRADE, + hdrs.URI, + hdrs.USER_AGENT, + hdrs.VARY, + hdrs.VIA, + hdrs.WANT_DIGEST, + hdrs.WARNING, + hdrs.WEBSOCKET, + hdrs.WWW_AUTHENTICATE, + hdrs.X_FORWARDED_FOR, + hdrs.X_FORWARDED_HOST, + hdrs.X_FORWARDED_PROTO, +) diff --git a/aiohttp/_http_parser.pyx b/aiohttp/_http_parser.pyx index 8c67ece4633..ed58fcfa664 100644 --- a/aiohttp/_http_parser.pyx +++ b/aiohttp/_http_parser.pyx @@ -24,10 +24,11 @@ from .streams import (EMPTY_PAYLOAD as _EMPTY_PAYLOAD, StreamReader as _StreamReader) cimport cython -from . cimport _cparser as cparser +from aiohttp cimport _cparser as cparser -import re +include "_headers.pxi" +from aiohttp cimport _find_header DEF DEFAULT_FREELIST_SIZE = 250 @@ -53,7 +54,7 @@ cdef object StreamReader = _StreamReader cdef object DeflateBuffer = _DeflateBuffer -cdef inline object extend(object buf, char* at, size_t length): +cdef inline object extend(object buf, const char* at, size_t length): cdef Py_ssize_t s cdef char* ptr s = PyByteArray_Size(buf) @@ -77,34 +78,15 @@ cdef inline str http_method_str(int i): else: return "" -cdef list _headers -cdef object _re - - -cdef fill_headers(): - global _headers - global _re - cdef list headers - cdef object h - cdef bytes b - headers = [getattr(hdrs, name) - for name in dir(hdrs) - if isinstance(getattr(hdrs, name), hdrs.istr)] - if len(headers) > 0x7f: - raise RuntimeError("Too many headers for table") - - _headers = headers - b = b'|'.join(b'(' + h.encode('utf-8') + b')' for h in headers) - _re = re.compile(b, re.IGNORECASE) - -fill_headers() - - cdef inline object find_header(bytes raw_header): - m = _re.fullmatch(raw_header) - if m is None: + cdef Py_ssize_t size + cdef char *buf + cdef int idx + PyBytes_AsStringAndSize(raw_header, &buf, &size) + idx = _find_header.find_header(buf, size) + if idx == -1: return raw_header.decode('utf-8', 'surrogateescape') - return _headers[m.lastindex - 1] + return headers[idx] @cython.freelist(DEFAULT_FREELIST_SIZE) diff --git a/setup.py b/setup.py index c3693f62777..0d5f89c3cf2 100644 --- a/setup.py +++ b/setup.py @@ -25,7 +25,8 @@ extensions = [Extension('aiohttp._websocket', ['aiohttp/_websocket' + ext]), Extension('aiohttp._http_parser', ['aiohttp/_http_parser' + ext, - 'vendor/http-parser/http_parser.c'], + 'vendor/http-parser/http_parser.c', + 'aiohttp/_find_header.c'], define_macros=[('HTTP_PARSER_STRICT', 0)], ), Extension('aiohttp._frozenlist', diff --git a/tools/gen.py b/tools/gen.py new file mode 100755 index 00000000000..2cc8f5eef00 --- /dev/null +++ b/tools/gen.py @@ -0,0 +1,145 @@ +#!/usr/bin/env python3 + +import aiohttp +import pathlib +from aiohttp import hdrs +from collections import defaultdict +import io +from pprint import pprint + +headers = [getattr(hdrs, name) + for name in dir(hdrs) + if isinstance(getattr(hdrs, name), hdrs.istr)] + +def factory(): + return defaultdict(factory) + + +TERMINAL = object() + + +def build(headers): + dct = defaultdict(factory) + for hdr in headers: + d = dct + for ch in hdr: + d = d[ch] + d[TERMINAL] = hdr + return dct + +dct = build(headers) + + +HEADER = """ +#include "_find_header.h" + +#define NEXT_CHAR() \\ +{ \\ + count++; \\ + if (count == size) { \\ + /* end of search */ \\ + return -1; \\ + } \\ + pchar++; \\ + ch = *pchar; \\ + last = (count == size -1); \\ +} while(0); + +int +find_header(const char *str, int size) +{ + char *pchar = str; + int last; + char ch; + int count = -1; + pchar--; +""" + +BLOCK = """ +{label}: + NEXT_CHAR(); + switch (ch) {{ +{cases} + default: + return -1; + }} +""" + +CASE = """ + case '{char}': + if (last) {{ + return {index}; + }} + goto {next}; +""" + +FOOTER = """ +missing: + return -1; +} +""" + +def gen_prefix(prefix, k): + if k == '-': + return prefix + '_' + else: + return prefix + k.upper() + + +def gen_block(dct, prefix, used_blocks, out): + cases = [] + for k, v in dct.items(): + if k is TERMINAL: + continue + next_prefix = gen_prefix(prefix, k) + term = v.get(TERMINAL) + if term is not None: + index = headers.index(term) + else: + index = -1 + case = CASE.format(char=k, index=index, next=next_prefix) + cases.append(case) + lo = k.lower() + if lo != k: + case = CASE.format(char=lo, index=index, next=next_prefix) + cases.append(case) + label = prefix if prefix else 'INITIAL' + block = BLOCK.format(label=label, cases='\n'.join(cases)) + out.write(block) + for k, v in dct.items(): + if not isinstance(v, defaultdict): + continue + block_name = gen_prefix(prefix, k) + if block_name in used_blocks: + continue + used_blocks.add(block_name) + gen_block(v, block_name, used_blocks, out) + + +def gen(dct): + out = io.StringIO() + out.write(HEADER) + gen_block(dct, '', set(), out) + out.write(FOOTER) + return out + + +def gen_headers(headers): + out = io.StringIO() + out.write("from . import hdrs\n") + out.write("cdef tuple headers = (\n") + for hdr in headers: + out.write(" hdrs.{},\n".format(hdr.upper().replace('-', '_'))) + out.write(")\n") + return out + +# print(gen(dct).getvalue()) +# print(gen_headers(headers).getvalue()) + +folder = pathlib.Path(aiohttp.__file__).parent + +with (folder / '_find_header.c').open('w') as f: + f.write(gen(dct).getvalue()) + +with (folder / '_headers.pxi').open('w') as f: + f.write(gen_headers(headers).getvalue()) From 87f1dcb63d893db12cab3308ebddad7857ef809e Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Thu, 21 Jun 2018 17:22:30 +0300 Subject: [PATCH 17/22] Process header case insensitively --- aiohttp/_find_header.c | 3613 +++++++++++++++++++++++++++++++++++++++- tools/gen.py | 5 +- 2 files changed, 3591 insertions(+), 27 deletions(-) diff --git a/aiohttp/_find_header.c b/aiohttp/_find_header.c index 3bcecec5886..2ea9981bd14 100644 --- a/aiohttp/_find_header.c +++ b/aiohttp/_find_header.c @@ -299,6 +299,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'C': + if (last) { + return -1; + } + goto AC; + + case 'c': if (last) { return -1; @@ -306,6 +313,13 @@ find_header(const char *str, int size) goto AC; + case 'G': + if (last) { + return -1; + } + goto AG; + + case 'g': if (last) { return -1; @@ -313,6 +327,13 @@ find_header(const char *str, int size) goto AG; + case 'L': + if (last) { + return -1; + } + goto AL; + + case 'l': if (last) { return -1; @@ -320,6 +341,13 @@ find_header(const char *str, int size) goto AL; + case 'U': + if (last) { + return -1; + } + goto AU; + + case 'u': if (last) { return -1; @@ -334,6 +362,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'C': + if (last) { + return -1; + } + goto ACC; + + case 'c': if (last) { return -1; @@ -348,6 +383,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return -1; + } + goto ACCE; + + case 'e': if (last) { return -1; @@ -362,6 +404,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'P': + if (last) { + return -1; + } + goto ACCEP; + + case 'p': if (last) { return -1; @@ -369,6 +418,13 @@ find_header(const char *str, int size) goto ACCEP; + case 'S': + if (last) { + return -1; + } + goto ACCES; + + case 's': if (last) { return -1; @@ -383,6 +439,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'T': + if (last) { + return 0; + } + goto ACCEPT; + + case 't': if (last) { return 0; @@ -474,6 +537,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'H': + if (last) { + return -1; + } + goto ACCEPT_CH; + + case 'h': if (last) { return -1; @@ -488,6 +558,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'A': + if (last) { + return -1; + } + goto ACCEPT_CHA; + + case 'a': if (last) { return -1; @@ -502,6 +579,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'R': + if (last) { + return -1; + } + goto ACCEPT_CHAR; + + case 'r': if (last) { return -1; @@ -516,6 +600,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'S': + if (last) { + return -1; + } + goto ACCEPT_CHARS; + + case 's': if (last) { return -1; @@ -530,6 +621,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return -1; + } + goto ACCEPT_CHARSE; + + case 'e': if (last) { return -1; @@ -544,6 +642,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'T': + if (last) { + return 1; + } + goto ACCEPT_CHARSET; + + case 't': if (last) { return 1; @@ -566,6 +671,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'N': + if (last) { + return -1; + } + goto ACCEPT_EN; + + case 'n': if (last) { return -1; @@ -580,6 +692,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'C': + if (last) { + return -1; + } + goto ACCEPT_ENC; + + case 'c': if (last) { return -1; @@ -594,6 +713,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'O': + if (last) { + return -1; + } + goto ACCEPT_ENCO; + + case 'o': if (last) { return -1; @@ -608,6 +734,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'D': + if (last) { + return -1; + } + goto ACCEPT_ENCOD; + + case 'd': if (last) { return -1; @@ -622,6 +755,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'I': + if (last) { + return -1; + } + goto ACCEPT_ENCODI; + + case 'i': if (last) { return -1; @@ -636,6 +776,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'N': + if (last) { + return -1; + } + goto ACCEPT_ENCODIN; + + case 'n': if (last) { return -1; @@ -650,6 +797,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'G': + if (last) { + return 2; + } + goto ACCEPT_ENCODING; + + case 'g': if (last) { return 2; @@ -672,6 +826,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'A': + if (last) { + return -1; + } + goto ACCEPT_LA; + + case 'a': if (last) { return -1; @@ -686,6 +847,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'N': + if (last) { + return -1; + } + goto ACCEPT_LAN; + + case 'n': if (last) { return -1; @@ -700,6 +868,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'G': + if (last) { + return -1; + } + goto ACCEPT_LANG; + + case 'g': if (last) { return -1; @@ -714,6 +889,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'U': + if (last) { + return -1; + } + goto ACCEPT_LANGU; + + case 'u': if (last) { return -1; @@ -728,6 +910,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'A': + if (last) { + return -1; + } + goto ACCEPT_LANGUA; + + case 'a': if (last) { return -1; @@ -742,6 +931,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'G': + if (last) { + return -1; + } + goto ACCEPT_LANGUAG; + + case 'g': if (last) { return -1; @@ -756,6 +952,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return 3; + } + goto ACCEPT_LANGUAGE; + + case 'e': if (last) { return 3; @@ -778,6 +981,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'A': + if (last) { + return -1; + } + goto ACCEPT_RA; + + case 'a': if (last) { return -1; @@ -792,6 +1002,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'N': + if (last) { + return -1; + } + goto ACCEPT_RAN; + + case 'n': if (last) { return -1; @@ -806,6 +1023,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'G': + if (last) { + return -1; + } + goto ACCEPT_RANG; + + case 'g': if (last) { return -1; @@ -820,6 +1044,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return -1; + } + goto ACCEPT_RANGE; + + case 'e': if (last) { return -1; @@ -834,6 +1065,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'S': + if (last) { + return 4; + } + goto ACCEPT_RANGES; + + case 's': if (last) { return 4; @@ -856,6 +1094,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'S': + if (last) { + return -1; + } + goto ACCESS; + + case 's': if (last) { return -1; @@ -905,6 +1150,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'O': + if (last) { + return -1; + } + goto ACCESS_CO; + + case 'o': if (last) { return -1; @@ -919,6 +1171,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'N': + if (last) { + return -1; + } + goto ACCESS_CON; + + case 'n': if (last) { return -1; @@ -933,7 +1192,14 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { - case 't': + case 'T': + if (last) { + return -1; + } + goto ACCESS_CONT; + + + case 't': if (last) { return -1; } @@ -947,6 +1213,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'R': + if (last) { + return -1; + } + goto ACCESS_CONTR; + + case 'r': if (last) { return -1; @@ -961,6 +1234,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'O': + if (last) { + return -1; + } + goto ACCESS_CONTRO; + + case 'o': if (last) { return -1; @@ -975,6 +1255,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'L': + if (last) { + return -1; + } + goto ACCESS_CONTROL; + + case 'l': if (last) { return -1; @@ -1066,6 +1353,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'L': + if (last) { + return -1; + } + goto ACCESS_CONTROL_AL; + + case 'l': if (last) { return -1; @@ -1080,6 +1374,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'L': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALL; + + case 'l': if (last) { return -1; @@ -1094,6 +1395,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'O': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLO; + + case 'o': if (last) { return -1; @@ -1108,6 +1416,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'W': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW; + + case 'w': if (last) { return -1; @@ -1199,6 +1514,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'R': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_CR; + + case 'r': if (last) { return -1; @@ -1213,6 +1535,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_CRE; + + case 'e': if (last) { return -1; @@ -1227,6 +1556,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'D': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_CRED; + + case 'd': if (last) { return -1; @@ -1241,6 +1577,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_CREDE; + + case 'e': if (last) { return -1; @@ -1255,6 +1598,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'N': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_CREDEN; + + case 'n': if (last) { return -1; @@ -1269,6 +1619,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'T': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_CREDENT; + + case 't': if (last) { return -1; @@ -1283,6 +1640,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'I': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_CREDENTI; + + case 'i': if (last) { return -1; @@ -1297,6 +1661,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'A': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_CREDENTIA; + + case 'a': if (last) { return -1; @@ -1311,6 +1682,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'L': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_CREDENTIAL; + + case 'l': if (last) { return -1; @@ -1325,6 +1703,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'S': + if (last) { + return 5; + } + goto ACCESS_CONTROL_ALLOW_CREDENTIALS; + + case 's': if (last) { return 5; @@ -1347,6 +1732,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_HE; + + case 'e': if (last) { return -1; @@ -1361,6 +1753,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'A': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_HEA; + + case 'a': if (last) { return -1; @@ -1375,6 +1774,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'D': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_HEAD; + + case 'd': if (last) { return -1; @@ -1389,6 +1795,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_HEADE; + + case 'e': if (last) { return -1; @@ -1403,6 +1816,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'R': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_HEADER; + + case 'r': if (last) { return -1; @@ -1417,6 +1837,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'S': + if (last) { + return 6; + } + goto ACCESS_CONTROL_ALLOW_HEADERS; + + case 's': if (last) { return 6; @@ -1439,6 +1866,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_ME; + + case 'e': if (last) { return -1; @@ -1453,6 +1887,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'T': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_MET; + + case 't': if (last) { return -1; @@ -1467,6 +1908,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'H': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_METH; + + case 'h': if (last) { return -1; @@ -1481,6 +1929,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'O': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_METHO; + + case 'o': if (last) { return -1; @@ -1495,6 +1950,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'D': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_METHOD; + + case 'd': if (last) { return -1; @@ -1509,6 +1971,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'S': + if (last) { + return 7; + } + goto ACCESS_CONTROL_ALLOW_METHODS; + + case 's': if (last) { return 7; @@ -1531,6 +2000,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'R': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_OR; + + case 'r': if (last) { return -1; @@ -1545,6 +2021,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'I': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_ORI; + + case 'i': if (last) { return -1; @@ -1559,6 +2042,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'G': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_ORIG; + + case 'g': if (last) { return -1; @@ -1573,6 +2063,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'I': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_ORIGI; + + case 'i': if (last) { return -1; @@ -1587,6 +2084,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'N': + if (last) { + return 8; + } + goto ACCESS_CONTROL_ALLOW_ORIGIN; + + case 'n': if (last) { return 8; @@ -1609,6 +2113,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'X': + if (last) { + return -1; + } + goto ACCESS_CONTROL_EX; + + case 'x': if (last) { return -1; @@ -1623,20 +2134,34 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { - case 'p': + case 'P': if (last) { return -1; } goto ACCESS_CONTROL_EXP; - default: - return -1; - } + + case 'p': + if (last) { + return -1; + } + goto ACCESS_CONTROL_EXP; + + default: + return -1; + } ACCESS_CONTROL_EXP: NEXT_CHAR(); switch (ch) { + case 'O': + if (last) { + return -1; + } + goto ACCESS_CONTROL_EXPO; + + case 'o': if (last) { return -1; @@ -1651,6 +2176,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'S': + if (last) { + return -1; + } + goto ACCESS_CONTROL_EXPOS; + + case 's': if (last) { return -1; @@ -1665,6 +2197,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return -1; + } + goto ACCESS_CONTROL_EXPOSE; + + case 'e': if (last) { return -1; @@ -1714,6 +2253,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return -1; + } + goto ACCESS_CONTROL_EXPOSE_HE; + + case 'e': if (last) { return -1; @@ -1728,6 +2274,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'A': + if (last) { + return -1; + } + goto ACCESS_CONTROL_EXPOSE_HEA; + + case 'a': if (last) { return -1; @@ -1742,6 +2295,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'D': + if (last) { + return -1; + } + goto ACCESS_CONTROL_EXPOSE_HEAD; + + case 'd': if (last) { return -1; @@ -1756,6 +2316,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return -1; + } + goto ACCESS_CONTROL_EXPOSE_HEADE; + + case 'e': if (last) { return -1; @@ -1770,6 +2337,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'R': + if (last) { + return -1; + } + goto ACCESS_CONTROL_EXPOSE_HEADER; + + case 'r': if (last) { return -1; @@ -1784,6 +2358,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'S': + if (last) { + return 9; + } + goto ACCESS_CONTROL_EXPOSE_HEADERS; + + case 's': if (last) { return 9; @@ -1806,6 +2387,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'A': + if (last) { + return -1; + } + goto ACCESS_CONTROL_MA; + + case 'a': if (last) { return -1; @@ -1820,6 +2408,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'X': + if (last) { + return -1; + } + goto ACCESS_CONTROL_MAX; + + case 'x': if (last) { return -1; @@ -1869,6 +2464,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'G': + if (last) { + return -1; + } + goto ACCESS_CONTROL_MAX_AG; + + case 'g': if (last) { return -1; @@ -1883,6 +2485,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return 10; + } + goto ACCESS_CONTROL_MAX_AGE; + + case 'e': if (last) { return 10; @@ -1905,6 +2514,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return -1; + } + goto ACCESS_CONTROL_RE; + + case 'e': if (last) { return -1; @@ -1919,6 +2535,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'Q': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQ; + + case 'q': if (last) { return -1; @@ -1933,6 +2556,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'U': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQU; + + case 'u': if (last) { return -1; @@ -1947,6 +2577,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUE; + + case 'e': if (last) { return -1; @@ -1961,6 +2598,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'S': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUES; + + case 's': if (last) { return -1; @@ -1975,6 +2619,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'T': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUEST; + + case 't': if (last) { return -1; @@ -2038,6 +2689,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUEST_HE; + + case 'e': if (last) { return -1; @@ -2052,6 +2710,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'A': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUEST_HEA; + + case 'a': if (last) { return -1; @@ -2066,6 +2731,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'D': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUEST_HEAD; + + case 'd': if (last) { return -1; @@ -2080,6 +2752,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUEST_HEADE; + + case 'e': if (last) { return -1; @@ -2094,6 +2773,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'R': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUEST_HEADER; + + case 'r': if (last) { return -1; @@ -2108,6 +2794,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'S': + if (last) { + return 11; + } + goto ACCESS_CONTROL_REQUEST_HEADERS; + + case 's': if (last) { return 11; @@ -2130,6 +2823,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUEST_ME; + + case 'e': if (last) { return -1; @@ -2144,6 +2844,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'T': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUEST_MET; + + case 't': if (last) { return -1; @@ -2158,6 +2865,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'H': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUEST_METH; + + case 'h': if (last) { return -1; @@ -2172,6 +2886,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'O': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUEST_METHO; + + case 'o': if (last) { return -1; @@ -2186,6 +2907,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'D': + if (last) { + return 12; + } + goto ACCESS_CONTROL_REQUEST_METHOD; + + case 'd': if (last) { return 12; @@ -2208,6 +2936,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return 13; + } + goto AGE; + + case 'e': if (last) { return 13; @@ -2230,6 +2965,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'L': + if (last) { + return -1; + } + goto ALL; + + case 'l': if (last) { return -1; @@ -2244,6 +2986,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'O': + if (last) { + return -1; + } + goto ALLO; + + case 'o': if (last) { return -1; @@ -2258,6 +3007,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'W': + if (last) { + return 14; + } + goto ALLOW; + + case 'w': if (last) { return 14; @@ -2280,6 +3036,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'T': + if (last) { + return -1; + } + goto AUT; + + case 't': if (last) { return -1; @@ -2294,13 +3057,20 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { - case 'h': + case 'H': if (last) { return -1; } goto AUTH; - default: + + case 'h': + if (last) { + return -1; + } + goto AUTH; + + default: return -1; } @@ -2308,6 +3078,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'O': + if (last) { + return -1; + } + goto AUTHO; + + case 'o': if (last) { return -1; @@ -2322,6 +3099,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'R': + if (last) { + return -1; + } + goto AUTHOR; + + case 'r': if (last) { return -1; @@ -2336,6 +3120,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'I': + if (last) { + return -1; + } + goto AUTHORI; + + case 'i': if (last) { return -1; @@ -2350,6 +3141,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'Z': + if (last) { + return -1; + } + goto AUTHORIZ; + + case 'z': if (last) { return -1; @@ -2364,6 +3162,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'A': + if (last) { + return -1; + } + goto AUTHORIZA; + + case 'a': if (last) { return -1; @@ -2378,6 +3183,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'T': + if (last) { + return -1; + } + goto AUTHORIZAT; + + case 't': if (last) { return -1; @@ -2392,6 +3204,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'I': + if (last) { + return -1; + } + goto AUTHORIZATI; + + case 'i': if (last) { return -1; @@ -2406,6 +3225,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'O': + if (last) { + return -1; + } + goto AUTHORIZATIO; + + case 'o': if (last) { return -1; @@ -2420,6 +3246,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'N': + if (last) { + return 15; + } + goto AUTHORIZATION; + + case 'n': if (last) { return 15; @@ -2442,6 +3275,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'A': + if (last) { + return -1; + } + goto CA; + + case 'a': if (last) { return -1; @@ -2449,6 +3289,13 @@ find_header(const char *str, int size) goto CA; + case 'O': + if (last) { + return -1; + } + goto CO; + + case 'o': if (last) { return -1; @@ -2463,6 +3310,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'C': + if (last) { + return -1; + } + goto CAC; + + case 'c': if (last) { return -1; @@ -2477,6 +3331,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'H': + if (last) { + return -1; + } + goto CACH; + + case 'h': if (last) { return -1; @@ -2491,6 +3352,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return -1; + } + goto CACHE; + + case 'e': if (last) { return -1; @@ -2540,6 +3408,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'O': + if (last) { + return -1; + } + goto CACHE_CO; + + case 'o': if (last) { return -1; @@ -2554,6 +3429,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'N': + if (last) { + return -1; + } + goto CACHE_CON; + + case 'n': if (last) { return -1; @@ -2568,6 +3450,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'T': + if (last) { + return -1; + } + goto CACHE_CONT; + + case 't': if (last) { return -1; @@ -2582,6 +3471,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'R': + if (last) { + return -1; + } + goto CACHE_CONTR; + + case 'r': if (last) { return -1; @@ -2596,6 +3492,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'O': + if (last) { + return -1; + } + goto CACHE_CONTRO; + + case 'o': if (last) { return -1; @@ -2610,6 +3513,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'L': + if (last) { + return 16; + } + goto CACHE_CONTROL; + + case 'l': if (last) { return 16; @@ -2632,6 +3542,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'N': + if (last) { + return -1; + } + goto CON; + + case 'n': if (last) { return -1; @@ -2639,6 +3556,13 @@ find_header(const char *str, int size) goto CON; + case 'O': + if (last) { + return -1; + } + goto COO; + + case 'o': if (last) { return -1; @@ -2653,6 +3577,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'N': + if (last) { + return -1; + } + goto CONN; + + case 'n': if (last) { return -1; @@ -2660,6 +3591,13 @@ find_header(const char *str, int size) goto CONN; + case 'T': + if (last) { + return -1; + } + goto CONT; + + case 't': if (last) { return -1; @@ -2674,6 +3612,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return -1; + } + goto CONNE; + + case 'e': if (last) { return -1; @@ -2688,6 +3633,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'C': + if (last) { + return -1; + } + goto CONNEC; + + case 'c': if (last) { return -1; @@ -2702,6 +3654,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'T': + if (last) { + return -1; + } + goto CONNECT; + + case 't': if (last) { return -1; @@ -2716,6 +3675,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'I': + if (last) { + return -1; + } + goto CONNECTI; + + case 'i': if (last) { return -1; @@ -2730,6 +3696,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'O': + if (last) { + return -1; + } + goto CONNECTIO; + + case 'o': if (last) { return -1; @@ -2744,6 +3717,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'N': + if (last) { + return 17; + } + goto CONNECTION; + + case 'n': if (last) { return 17; @@ -2766,6 +3746,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return -1; + } + goto CONTE; + + case 'e': if (last) { return -1; @@ -2780,6 +3767,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'N': + if (last) { + return -1; + } + goto CONTEN; + + case 'n': if (last) { return -1; @@ -2794,6 +3788,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'T': + if (last) { + return -1; + } + goto CONTENT; + + case 't': if (last) { return -1; @@ -2913,6 +3914,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'I': + if (last) { + return -1; + } + goto CONTENT_DI; + + case 'i': if (last) { return -1; @@ -2927,6 +3935,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'S': + if (last) { + return -1; + } + goto CONTENT_DIS; + + case 's': if (last) { return -1; @@ -2941,20 +3956,34 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { - case 'p': + case 'P': if (last) { return -1; } goto CONTENT_DISP; - default: - return -1; + + case 'p': + if (last) { + return -1; + } + goto CONTENT_DISP; + + default: + return -1; } CONTENT_DISP: NEXT_CHAR(); switch (ch) { + case 'O': + if (last) { + return -1; + } + goto CONTENT_DISPO; + + case 'o': if (last) { return -1; @@ -2969,6 +3998,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'S': + if (last) { + return -1; + } + goto CONTENT_DISPOS; + + case 's': if (last) { return -1; @@ -2983,6 +4019,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'I': + if (last) { + return -1; + } + goto CONTENT_DISPOSI; + + case 'i': if (last) { return -1; @@ -2997,6 +4040,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'T': + if (last) { + return -1; + } + goto CONTENT_DISPOSIT; + + case 't': if (last) { return -1; @@ -3011,6 +4061,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'I': + if (last) { + return -1; + } + goto CONTENT_DISPOSITI; + + case 'i': if (last) { return -1; @@ -3025,6 +4082,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'O': + if (last) { + return -1; + } + goto CONTENT_DISPOSITIO; + + case 'o': if (last) { return -1; @@ -3039,6 +4103,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'N': + if (last) { + return 18; + } + goto CONTENT_DISPOSITION; + + case 'n': if (last) { return 18; @@ -3061,6 +4132,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'N': + if (last) { + return -1; + } + goto CONTENT_EN; + + case 'n': if (last) { return -1; @@ -3075,6 +4153,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'C': + if (last) { + return -1; + } + goto CONTENT_ENC; + + case 'c': if (last) { return -1; @@ -3089,6 +4174,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'O': + if (last) { + return -1; + } + goto CONTENT_ENCO; + + case 'o': if (last) { return -1; @@ -3103,6 +4195,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'D': + if (last) { + return -1; + } + goto CONTENT_ENCOD; + + case 'd': if (last) { return -1; @@ -3117,6 +4216,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'I': + if (last) { + return -1; + } + goto CONTENT_ENCODI; + + case 'i': if (last) { return -1; @@ -3131,6 +4237,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'N': + if (last) { + return -1; + } + goto CONTENT_ENCODIN; + + case 'n': if (last) { return -1; @@ -3145,6 +4258,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'G': + if (last) { + return 19; + } + goto CONTENT_ENCODING; + + case 'g': if (last) { return 19; @@ -3167,6 +4287,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'A': + if (last) { + return -1; + } + goto CONTENT_LA; + + case 'a': if (last) { return -1; @@ -3174,6 +4301,13 @@ find_header(const char *str, int size) goto CONTENT_LA; + case 'E': + if (last) { + return -1; + } + goto CONTENT_LE; + + case 'e': if (last) { return -1; @@ -3181,6 +4315,13 @@ find_header(const char *str, int size) goto CONTENT_LE; + case 'O': + if (last) { + return -1; + } + goto CONTENT_LO; + + case 'o': if (last) { return -1; @@ -3195,6 +4336,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'N': + if (last) { + return -1; + } + goto CONTENT_LAN; + + case 'n': if (last) { return -1; @@ -3209,6 +4357,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'G': + if (last) { + return -1; + } + goto CONTENT_LANG; + + case 'g': if (last) { return -1; @@ -3223,6 +4378,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'U': + if (last) { + return -1; + } + goto CONTENT_LANGU; + + case 'u': if (last) { return -1; @@ -3237,6 +4399,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'A': + if (last) { + return -1; + } + goto CONTENT_LANGUA; + + case 'a': if (last) { return -1; @@ -3251,6 +4420,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'G': + if (last) { + return -1; + } + goto CONTENT_LANGUAG; + + case 'g': if (last) { return -1; @@ -3265,6 +4441,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return 20; + } + goto CONTENT_LANGUAGE; + + case 'e': if (last) { return 20; @@ -3287,6 +4470,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'N': + if (last) { + return -1; + } + goto CONTENT_LEN; + + case 'n': if (last) { return -1; @@ -3301,6 +4491,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'G': + if (last) { + return -1; + } + goto CONTENT_LENG; + + case 'g': if (last) { return -1; @@ -3315,6 +4512,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'T': + if (last) { + return -1; + } + goto CONTENT_LENGT; + + case 't': if (last) { return -1; @@ -3329,6 +4533,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'H': + if (last) { + return 21; + } + goto CONTENT_LENGTH; + + case 'h': if (last) { return 21; @@ -3351,6 +4562,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'C': + if (last) { + return -1; + } + goto CONTENT_LOC; + + case 'c': if (last) { return -1; @@ -3365,6 +4583,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'A': + if (last) { + return -1; + } + goto CONTENT_LOCA; + + case 'a': if (last) { return -1; @@ -3379,6 +4604,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'T': + if (last) { + return -1; + } + goto CONTENT_LOCAT; + + case 't': if (last) { return -1; @@ -3393,6 +4625,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'I': + if (last) { + return -1; + } + goto CONTENT_LOCATI; + + case 'i': if (last) { return -1; @@ -3407,6 +4646,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'O': + if (last) { + return -1; + } + goto CONTENT_LOCATIO; + + case 'o': if (last) { return -1; @@ -3421,6 +4667,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'N': + if (last) { + return 22; + } + goto CONTENT_LOCATION; + + case 'n': if (last) { return 22; @@ -3443,6 +4696,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'D': + if (last) { + return -1; + } + goto CONTENT_MD; + + case 'd': if (last) { return -1; @@ -3479,6 +4739,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'A': + if (last) { + return -1; + } + goto CONTENT_RA; + + case 'a': if (last) { return -1; @@ -3493,6 +4760,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'N': + if (last) { + return -1; + } + goto CONTENT_RAN; + + case 'n': if (last) { return -1; @@ -3507,6 +4781,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'G': + if (last) { + return -1; + } + goto CONTENT_RANG; + + case 'g': if (last) { return -1; @@ -3521,6 +4802,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return 24; + } + goto CONTENT_RANGE; + + case 'e': if (last) { return 24; @@ -3543,6 +4831,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'R': + if (last) { + return -1; + } + goto CONTENT_TR; + + case 'r': if (last) { return -1; @@ -3550,6 +4845,13 @@ find_header(const char *str, int size) goto CONTENT_TR; + case 'Y': + if (last) { + return -1; + } + goto CONTENT_TY; + + case 'y': if (last) { return -1; @@ -3564,6 +4866,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'A': + if (last) { + return -1; + } + goto CONTENT_TRA; + + case 'a': if (last) { return -1; @@ -3578,6 +4887,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'N': + if (last) { + return -1; + } + goto CONTENT_TRAN; + + case 'n': if (last) { return -1; @@ -3592,6 +4908,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'S': + if (last) { + return -1; + } + goto CONTENT_TRANS; + + case 's': if (last) { return -1; @@ -3606,6 +4929,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'F': + if (last) { + return -1; + } + goto CONTENT_TRANSF; + + case 'f': if (last) { return -1; @@ -3620,6 +4950,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return -1; + } + goto CONTENT_TRANSFE; + + case 'e': if (last) { return -1; @@ -3634,6 +4971,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'R': + if (last) { + return -1; + } + goto CONTENT_TRANSFER; + + case 'r': if (last) { return -1; @@ -3683,6 +5027,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'N': + if (last) { + return -1; + } + goto CONTENT_TRANSFER_EN; + + case 'n': if (last) { return -1; @@ -3697,6 +5048,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'C': + if (last) { + return -1; + } + goto CONTENT_TRANSFER_ENC; + + case 'c': if (last) { return -1; @@ -3711,6 +5069,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'O': + if (last) { + return -1; + } + goto CONTENT_TRANSFER_ENCO; + + case 'o': if (last) { return -1; @@ -3725,6 +5090,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'D': + if (last) { + return -1; + } + goto CONTENT_TRANSFER_ENCOD; + + case 'd': if (last) { return -1; @@ -3739,6 +5111,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'I': + if (last) { + return -1; + } + goto CONTENT_TRANSFER_ENCODI; + + case 'i': if (last) { return -1; @@ -3753,6 +5132,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'N': + if (last) { + return -1; + } + goto CONTENT_TRANSFER_ENCODIN; + + case 'n': if (last) { return -1; @@ -3767,6 +5153,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'G': + if (last) { + return 25; + } + goto CONTENT_TRANSFER_ENCODING; + + case 'g': if (last) { return 25; @@ -3789,6 +5182,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'P': + if (last) { + return -1; + } + goto CONTENT_TYP; + + case 'p': if (last) { return -1; @@ -3803,6 +5203,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return 26; + } + goto CONTENT_TYPE; + + case 'e': if (last) { return 26; @@ -3825,6 +5232,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'K': + if (last) { + return -1; + } + goto COOK; + + case 'k': if (last) { return -1; @@ -3839,6 +5253,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'I': + if (last) { + return -1; + } + goto COOKI; + + case 'i': if (last) { return -1; @@ -3853,6 +5274,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return 27; + } + goto COOKIE; + + case 'e': if (last) { return 27; @@ -3875,6 +5303,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'A': + if (last) { + return -1; + } + goto DA; + + case 'a': if (last) { return -1; @@ -3882,6 +5317,13 @@ find_header(const char *str, int size) goto DA; + case 'E': + if (last) { + return -1; + } + goto DE; + + case 'e': if (last) { return -1; @@ -3889,6 +5331,13 @@ find_header(const char *str, int size) goto DE; + case 'I': + if (last) { + return -1; + } + goto DI; + + case 'i': if (last) { return -1; @@ -3903,6 +5352,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'T': + if (last) { + return -1; + } + goto DAT; + + case 't': if (last) { return -1; @@ -3917,6 +5373,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return 28; + } + goto DATE; + + case 'e': if (last) { return 28; @@ -3939,6 +5402,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'S': + if (last) { + return -1; + } + goto DES; + + case 's': if (last) { return -1; @@ -3953,6 +5423,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'T': + if (last) { + return -1; + } + goto DEST; + + case 't': if (last) { return -1; @@ -3967,6 +5444,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'I': + if (last) { + return -1; + } + goto DESTI; + + case 'i': if (last) { return -1; @@ -3981,6 +5465,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'N': + if (last) { + return -1; + } + goto DESTIN; + + case 'n': if (last) { return -1; @@ -3995,6 +5486,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'A': + if (last) { + return -1; + } + goto DESTINA; + + case 'a': if (last) { return -1; @@ -4009,6 +5507,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'T': + if (last) { + return -1; + } + goto DESTINAT; + + case 't': if (last) { return -1; @@ -4023,6 +5528,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'I': + if (last) { + return -1; + } + goto DESTINATI; + + case 'i': if (last) { return -1; @@ -4037,6 +5549,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'O': + if (last) { + return -1; + } + goto DESTINATIO; + + case 'o': if (last) { return -1; @@ -4047,9 +5566,16 @@ find_header(const char *str, int size) return -1; } -DESTINATIO: - NEXT_CHAR(); - switch (ch) { +DESTINATIO: + NEXT_CHAR(); + switch (ch) { + + case 'N': + if (last) { + return 29; + } + goto DESTINATION; + case 'n': if (last) { @@ -4073,6 +5599,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'G': + if (last) { + return -1; + } + goto DIG; + + case 'g': if (last) { return -1; @@ -4087,6 +5620,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return -1; + } + goto DIGE; + + case 'e': if (last) { return -1; @@ -4101,6 +5641,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'S': + if (last) { + return -1; + } + goto DIGES; + + case 's': if (last) { return -1; @@ -4115,6 +5662,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'T': + if (last) { + return 30; + } + goto DIGEST; + + case 't': if (last) { return 30; @@ -4137,6 +5691,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'T': + if (last) { + return -1; + } + goto ET; + + case 't': if (last) { return -1; @@ -4144,6 +5705,13 @@ find_header(const char *str, int size) goto ET; + case 'X': + if (last) { + return -1; + } + goto EX; + + case 'x': if (last) { return -1; @@ -4158,6 +5726,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'A': + if (last) { + return -1; + } + goto ETA; + + case 'a': if (last) { return -1; @@ -4172,6 +5747,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'G': + if (last) { + return 31; + } + goto ETAG; + + case 'g': if (last) { return 31; @@ -4194,6 +5776,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'P': + if (last) { + return -1; + } + goto EXP; + + case 'p': if (last) { return -1; @@ -4208,6 +5797,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return -1; + } + goto EXPE; + + case 'e': if (last) { return -1; @@ -4215,6 +5811,13 @@ find_header(const char *str, int size) goto EXPE; + case 'I': + if (last) { + return -1; + } + goto EXPI; + + case 'i': if (last) { return -1; @@ -4229,6 +5832,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'C': + if (last) { + return -1; + } + goto EXPEC; + + case 'c': if (last) { return -1; @@ -4243,6 +5853,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'T': + if (last) { + return 32; + } + goto EXPECT; + + case 't': if (last) { return 32; @@ -4265,6 +5882,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'R': + if (last) { + return -1; + } + goto EXPIR; + + case 'r': if (last) { return -1; @@ -4279,6 +5903,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return -1; + } + goto EXPIRE; + + case 'e': if (last) { return -1; @@ -4293,6 +5924,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'S': + if (last) { + return 33; + } + goto EXPIRES; + + case 's': if (last) { return 33; @@ -4315,6 +5953,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'O': + if (last) { + return -1; + } + goto FO; + + case 'o': if (last) { return -1; @@ -4322,6 +5967,13 @@ find_header(const char *str, int size) goto FO; + case 'R': + if (last) { + return -1; + } + goto FR; + + case 'r': if (last) { return -1; @@ -4336,6 +5988,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'R': + if (last) { + return -1; + } + goto FOR; + + case 'r': if (last) { return -1; @@ -4350,6 +6009,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'W': + if (last) { + return -1; + } + goto FORW; + + case 'w': if (last) { return -1; @@ -4364,6 +6030,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'A': + if (last) { + return -1; + } + goto FORWA; + + case 'a': if (last) { return -1; @@ -4378,6 +6051,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'R': + if (last) { + return -1; + } + goto FORWAR; + + case 'r': if (last) { return -1; @@ -4392,6 +6072,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'D': + if (last) { + return -1; + } + goto FORWARD; + + case 'd': if (last) { return -1; @@ -4406,6 +6093,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return -1; + } + goto FORWARDE; + + case 'e': if (last) { return -1; @@ -4420,6 +6114,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'D': + if (last) { + return 34; + } + goto FORWARDED; + + case 'd': if (last) { return 34; @@ -4442,6 +6143,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'O': + if (last) { + return -1; + } + goto FRO; + + case 'o': if (last) { return -1; @@ -4456,6 +6164,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'M': + if (last) { + return 35; + } + goto FROM; + + case 'm': if (last) { return 35; @@ -4478,6 +6193,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'O': + if (last) { + return -1; + } + goto HO; + + case 'o': if (last) { return -1; @@ -4492,6 +6214,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'S': + if (last) { + return -1; + } + goto HOS; + + case 's': if (last) { return -1; @@ -4506,6 +6235,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'T': + if (last) { + return 36; + } + goto HOST; + + case 't': if (last) { return 36; @@ -4528,6 +6264,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'F': + if (last) { + return -1; + } + goto IF; + + case 'f': if (last) { return -1; @@ -4619,6 +6362,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'A': + if (last) { + return -1; + } + goto IF_MA; + + case 'a': if (last) { return -1; @@ -4626,6 +6376,13 @@ find_header(const char *str, int size) goto IF_MA; + case 'O': + if (last) { + return -1; + } + goto IF_MO; + + case 'o': if (last) { return -1; @@ -4640,6 +6397,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'T': + if (last) { + return -1; + } + goto IF_MAT; + + case 't': if (last) { return -1; @@ -4654,6 +6418,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'C': + if (last) { + return -1; + } + goto IF_MATC; + + case 'c': if (last) { return -1; @@ -4664,9 +6435,16 @@ find_header(const char *str, int size) return -1; } -IF_MATC: - NEXT_CHAR(); - switch (ch) { +IF_MATC: + NEXT_CHAR(); + switch (ch) { + + case 'H': + if (last) { + return 37; + } + goto IF_MATCH; + case 'h': if (last) { @@ -4690,6 +6468,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'D': + if (last) { + return -1; + } + goto IF_MOD; + + case 'd': if (last) { return -1; @@ -4704,6 +6489,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'I': + if (last) { + return -1; + } + goto IF_MODI; + + case 'i': if (last) { return -1; @@ -4718,6 +6510,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'F': + if (last) { + return -1; + } + goto IF_MODIF; + + case 'f': if (last) { return -1; @@ -4732,6 +6531,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'I': + if (last) { + return -1; + } + goto IF_MODIFI; + + case 'i': if (last) { return -1; @@ -4746,6 +6552,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return -1; + } + goto IF_MODIFIE; + + case 'e': if (last) { return -1; @@ -4760,6 +6573,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'D': + if (last) { + return -1; + } + goto IF_MODIFIED; + + case 'd': if (last) { return -1; @@ -4809,6 +6629,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'I': + if (last) { + return -1; + } + goto IF_MODIFIED_SI; + + case 'i': if (last) { return -1; @@ -4823,6 +6650,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'N': + if (last) { + return -1; + } + goto IF_MODIFIED_SIN; + + case 'n': if (last) { return -1; @@ -4837,6 +6671,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'C': + if (last) { + return -1; + } + goto IF_MODIFIED_SINC; + + case 'c': if (last) { return -1; @@ -4851,6 +6692,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return 38; + } + goto IF_MODIFIED_SINCE; + + case 'e': if (last) { return 38; @@ -4873,6 +6721,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'O': + if (last) { + return -1; + } + goto IF_NO; + + case 'o': if (last) { return -1; @@ -4887,6 +6742,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'N': + if (last) { + return -1; + } + goto IF_NON; + + case 'n': if (last) { return -1; @@ -4901,6 +6763,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return -1; + } + goto IF_NONE; + + case 'e': if (last) { return -1; @@ -4950,6 +6819,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'A': + if (last) { + return -1; + } + goto IF_NONE_MA; + + case 'a': if (last) { return -1; @@ -4964,6 +6840,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'T': + if (last) { + return -1; + } + goto IF_NONE_MAT; + + case 't': if (last) { return -1; @@ -4978,6 +6861,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'C': + if (last) { + return -1; + } + goto IF_NONE_MATC; + + case 'c': if (last) { return -1; @@ -4992,6 +6882,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'H': + if (last) { + return 39; + } + goto IF_NONE_MATCH; + + case 'h': if (last) { return 39; @@ -5014,6 +6911,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'A': + if (last) { + return -1; + } + goto IF_RA; + + case 'a': if (last) { return -1; @@ -5028,6 +6932,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'N': + if (last) { + return -1; + } + goto IF_RAN; + + case 'n': if (last) { return -1; @@ -5042,6 +6953,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'G': + if (last) { + return -1; + } + goto IF_RANG; + + case 'g': if (last) { return -1; @@ -5056,6 +6974,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return 40; + } + goto IF_RANGE; + + case 'e': if (last) { return 40; @@ -5078,6 +7003,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'N': + if (last) { + return -1; + } + goto IF_UN; + + case 'n': if (last) { return -1; @@ -5092,6 +7024,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'M': + if (last) { + return -1; + } + goto IF_UNM; + + case 'm': if (last) { return -1; @@ -5106,6 +7045,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'O': + if (last) { + return -1; + } + goto IF_UNMO; + + case 'o': if (last) { return -1; @@ -5120,6 +7066,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'D': + if (last) { + return -1; + } + goto IF_UNMOD; + + case 'd': if (last) { return -1; @@ -5134,6 +7087,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'I': + if (last) { + return -1; + } + goto IF_UNMODI; + + case 'i': if (last) { return -1; @@ -5148,6 +7108,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'F': + if (last) { + return -1; + } + goto IF_UNMODIF; + + case 'f': if (last) { return -1; @@ -5162,6 +7129,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'I': + if (last) { + return -1; + } + goto IF_UNMODIFI; + + case 'i': if (last) { return -1; @@ -5176,6 +7150,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return -1; + } + goto IF_UNMODIFIE; + + case 'e': if (last) { return -1; @@ -5190,6 +7171,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'D': + if (last) { + return -1; + } + goto IF_UNMODIFIED; + + case 'd': if (last) { return -1; @@ -5239,6 +7227,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'I': + if (last) { + return -1; + } + goto IF_UNMODIFIED_SI; + + case 'i': if (last) { return -1; @@ -5253,6 +7248,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'N': + if (last) { + return -1; + } + goto IF_UNMODIFIED_SIN; + + case 'n': if (last) { return -1; @@ -5267,6 +7269,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'C': + if (last) { + return -1; + } + goto IF_UNMODIFIED_SINC; + + case 'c': if (last) { return -1; @@ -5281,6 +7290,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return 41; + } + goto IF_UNMODIFIED_SINCE; + + case 'e': if (last) { return 41; @@ -5303,6 +7319,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return -1; + } + goto KE; + + case 'e': if (last) { return -1; @@ -5313,9 +7336,16 @@ find_header(const char *str, int size) return -1; } -KE: - NEXT_CHAR(); - switch (ch) { +KE: + NEXT_CHAR(); + switch (ch) { + + case 'E': + if (last) { + return -1; + } + goto KEE; + case 'e': if (last) { @@ -5331,6 +7361,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'P': + if (last) { + return -1; + } + goto KEEP; + + case 'p': if (last) { return -1; @@ -5380,6 +7417,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'L': + if (last) { + return -1; + } + goto KEEP_AL; + + case 'l': if (last) { return -1; @@ -5394,6 +7438,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'I': + if (last) { + return -1; + } + goto KEEP_ALI; + + case 'i': if (last) { return -1; @@ -5408,6 +7459,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'V': + if (last) { + return -1; + } + goto KEEP_ALIV; + + case 'v': if (last) { return -1; @@ -5422,6 +7480,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return 42; + } + goto KEEP_ALIVE; + + case 'e': if (last) { return 42; @@ -5444,6 +7509,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'A': + if (last) { + return -1; + } + goto LA; + + case 'a': if (last) { return -1; @@ -5451,6 +7523,13 @@ find_header(const char *str, int size) goto LA; + case 'I': + if (last) { + return -1; + } + goto LI; + + case 'i': if (last) { return -1; @@ -5458,6 +7537,13 @@ find_header(const char *str, int size) goto LI; + case 'O': + if (last) { + return -1; + } + goto LO; + + case 'o': if (last) { return -1; @@ -5472,6 +7558,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'S': + if (last) { + return -1; + } + goto LAS; + + case 's': if (last) { return -1; @@ -5486,6 +7579,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'T': + if (last) { + return -1; + } + goto LAST; + + case 't': if (last) { return -1; @@ -5549,6 +7649,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'V': + if (last) { + return -1; + } + goto LAST_EV; + + case 'v': if (last) { return -1; @@ -5563,6 +7670,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return -1; + } + goto LAST_EVE; + + case 'e': if (last) { return -1; @@ -5577,6 +7691,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'N': + if (last) { + return -1; + } + goto LAST_EVEN; + + case 'n': if (last) { return -1; @@ -5591,6 +7712,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'T': + if (last) { + return -1; + } + goto LAST_EVENT; + + case 't': if (last) { return -1; @@ -5640,6 +7768,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'D': + if (last) { + return 43; + } + goto LAST_EVENT_ID; + + case 'd': if (last) { return 43; @@ -5662,6 +7797,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'O': + if (last) { + return -1; + } + goto LAST_MO; + + case 'o': if (last) { return -1; @@ -5676,6 +7818,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'D': + if (last) { + return -1; + } + goto LAST_MOD; + + case 'd': if (last) { return -1; @@ -5690,6 +7839,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'I': + if (last) { + return -1; + } + goto LAST_MODI; + + case 'i': if (last) { return -1; @@ -5704,6 +7860,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'F': + if (last) { + return -1; + } + goto LAST_MODIF; + + case 'f': if (last) { return -1; @@ -5718,6 +7881,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'I': + if (last) { + return -1; + } + goto LAST_MODIFI; + + case 'i': if (last) { return -1; @@ -5732,6 +7902,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return -1; + } + goto LAST_MODIFIE; + + case 'e': if (last) { return -1; @@ -5746,6 +7923,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'D': + if (last) { + return 44; + } + goto LAST_MODIFIED; + + case 'd': if (last) { return 44; @@ -5768,6 +7952,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'N': + if (last) { + return -1; + } + goto LIN; + + case 'n': if (last) { return -1; @@ -5782,6 +7973,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'K': + if (last) { + return 45; + } + goto LINK; + + case 'k': if (last) { return 45; @@ -5804,6 +8002,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'C': + if (last) { + return -1; + } + goto LOC; + + case 'c': if (last) { return -1; @@ -5818,6 +8023,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'A': + if (last) { + return -1; + } + goto LOCA; + + case 'a': if (last) { return -1; @@ -5832,6 +8044,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'T': + if (last) { + return -1; + } + goto LOCAT; + + case 't': if (last) { return -1; @@ -5846,6 +8065,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'I': + if (last) { + return -1; + } + goto LOCATI; + + case 'i': if (last) { return -1; @@ -5860,6 +8086,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'O': + if (last) { + return -1; + } + goto LOCATIO; + + case 'o': if (last) { return -1; @@ -5874,6 +8107,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'N': + if (last) { + return 46; + } + goto LOCATION; + + case 'n': if (last) { return 46; @@ -5896,6 +8136,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'A': + if (last) { + return -1; + } + goto MA; + + case 'a': if (last) { return -1; @@ -5910,6 +8157,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'X': + if (last) { + return -1; + } + goto MAX; + + case 'x': if (last) { return -1; @@ -5959,6 +8213,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'O': + if (last) { + return -1; + } + goto MAX_FO; + + case 'o': if (last) { return -1; @@ -5973,6 +8234,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'R': + if (last) { + return -1; + } + goto MAX_FOR; + + case 'r': if (last) { return -1; @@ -5987,6 +8255,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'W': + if (last) { + return -1; + } + goto MAX_FORW; + + case 'w': if (last) { return -1; @@ -6001,6 +8276,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'A': + if (last) { + return -1; + } + goto MAX_FORWA; + + case 'a': if (last) { return -1; @@ -6015,6 +8297,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'R': + if (last) { + return -1; + } + goto MAX_FORWAR; + + case 'r': if (last) { return -1; @@ -6029,6 +8318,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'D': + if (last) { + return -1; + } + goto MAX_FORWARD; + + case 'd': if (last) { return -1; @@ -6043,6 +8339,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'S': + if (last) { + return 47; + } + goto MAX_FORWARDS; + + case 's': if (last) { return 47; @@ -6065,6 +8368,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'R': + if (last) { + return -1; + } + goto OR; + + case 'r': if (last) { return -1; @@ -6079,6 +8389,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'I': + if (last) { + return -1; + } + goto ORI; + + case 'i': if (last) { return -1; @@ -6093,6 +8410,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'G': + if (last) { + return -1; + } + goto ORIG; + + case 'g': if (last) { return -1; @@ -6107,6 +8431,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'I': + if (last) { + return -1; + } + goto ORIGI; + + case 'i': if (last) { return -1; @@ -6121,6 +8452,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'N': + if (last) { + return 48; + } + goto ORIGIN; + + case 'n': if (last) { return 48; @@ -6143,6 +8481,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'R': + if (last) { + return -1; + } + goto PR; + + case 'r': if (last) { return -1; @@ -6157,6 +8502,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'A': + if (last) { + return -1; + } + goto PRA; + + case 'a': if (last) { return -1; @@ -6164,6 +8516,13 @@ find_header(const char *str, int size) goto PRA; + case 'O': + if (last) { + return -1; + } + goto PRO; + + case 'o': if (last) { return -1; @@ -6178,6 +8537,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'G': + if (last) { + return -1; + } + goto PRAG; + + case 'g': if (last) { return -1; @@ -6192,6 +8558,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'M': + if (last) { + return -1; + } + goto PRAGM; + + case 'm': if (last) { return -1; @@ -6206,6 +8579,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'A': + if (last) { + return 49; + } + goto PRAGMA; + + case 'a': if (last) { return 49; @@ -6228,6 +8608,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'X': + if (last) { + return -1; + } + goto PROX; + + case 'x': if (last) { return -1; @@ -6242,6 +8629,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'Y': + if (last) { + return -1; + } + goto PROXY; + + case 'y': if (last) { return -1; @@ -6298,6 +8692,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'U': + if (last) { + return -1; + } + goto PROXY_AU; + + case 'u': if (last) { return -1; @@ -6312,6 +8713,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'T': + if (last) { + return -1; + } + goto PROXY_AUT; + + case 't': if (last) { return -1; @@ -6326,6 +8734,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'H': + if (last) { + return -1; + } + goto PROXY_AUTH; + + case 'h': if (last) { return -1; @@ -6340,6 +8755,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return -1; + } + goto PROXY_AUTHE; + + case 'e': if (last) { return -1; @@ -6354,6 +8776,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'N': + if (last) { + return -1; + } + goto PROXY_AUTHEN; + + case 'n': if (last) { return -1; @@ -6368,6 +8797,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'T': + if (last) { + return -1; + } + goto PROXY_AUTHENT; + + case 't': if (last) { return -1; @@ -6382,6 +8818,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'I': + if (last) { + return -1; + } + goto PROXY_AUTHENTI; + + case 'i': if (last) { return -1; @@ -6396,6 +8839,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'C': + if (last) { + return -1; + } + goto PROXY_AUTHENTIC; + + case 'c': if (last) { return -1; @@ -6410,6 +8860,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'A': + if (last) { + return -1; + } + goto PROXY_AUTHENTICA; + + case 'a': if (last) { return -1; @@ -6424,6 +8881,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'T': + if (last) { + return -1; + } + goto PROXY_AUTHENTICAT; + + case 't': if (last) { return -1; @@ -6438,6 +8902,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return 50; + } + goto PROXY_AUTHENTICATE; + + case 'e': if (last) { return 50; @@ -6460,6 +8931,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'A': + if (last) { + return -1; + } + goto RA; + + case 'a': if (last) { return -1; @@ -6467,6 +8945,13 @@ find_header(const char *str, int size) goto RA; + case 'E': + if (last) { + return -1; + } + goto RE; + + case 'e': if (last) { return -1; @@ -6481,6 +8966,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'N': + if (last) { + return -1; + } + goto RAN; + + case 'n': if (last) { return -1; @@ -6495,6 +8987,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'G': + if (last) { + return -1; + } + goto RANG; + + case 'g': if (last) { return -1; @@ -6509,6 +9008,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return 52; + } + goto RANGE; + + case 'e': if (last) { return 52; @@ -6531,6 +9037,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'F': + if (last) { + return -1; + } + goto REF; + + case 'f': if (last) { return -1; @@ -6538,6 +9051,13 @@ find_header(const char *str, int size) goto REF; + case 'T': + if (last) { + return -1; + } + goto RET; + + case 't': if (last) { return -1; @@ -6552,6 +9072,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return -1; + } + goto REFE; + + case 'e': if (last) { return -1; @@ -6566,6 +9093,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'R': + if (last) { + return -1; + } + goto REFER; + + case 'r': if (last) { return -1; @@ -6580,6 +9114,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return -1; + } + goto REFERE; + + case 'e': if (last) { return -1; @@ -6594,6 +9135,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'R': + if (last) { + return 53; + } + goto REFERER; + + case 'r': if (last) { return 53; @@ -6616,6 +9164,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'R': + if (last) { + return -1; + } + goto RETR; + + case 'r': if (last) { return -1; @@ -6630,6 +9185,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'Y': + if (last) { + return -1; + } + goto RETRY; + + case 'y': if (last) { return -1; @@ -6679,6 +9241,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'F': + if (last) { + return -1; + } + goto RETRY_AF; + + case 'f': if (last) { return -1; @@ -6693,6 +9262,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'T': + if (last) { + return -1; + } + goto RETRY_AFT; + + case 't': if (last) { return -1; @@ -6707,6 +9283,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return -1; + } + goto RETRY_AFTE; + + case 'e': if (last) { return -1; @@ -6721,6 +9304,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'R': + if (last) { + return 54; + } + goto RETRY_AFTER; + + case 'r': if (last) { return 54; @@ -6743,6 +9333,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return -1; + } + goto SE; + + case 'e': if (last) { return -1; @@ -6757,6 +9354,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'C': + if (last) { + return -1; + } + goto SEC; + + case 'c': if (last) { return -1; @@ -6764,6 +9368,13 @@ find_header(const char *str, int size) goto SEC; + case 'R': + if (last) { + return -1; + } + goto SER; + + case 'r': if (last) { return -1; @@ -6771,6 +9382,13 @@ find_header(const char *str, int size) goto SER; + case 'T': + if (last) { + return -1; + } + goto SET; + + case 't': if (last) { return -1; @@ -6820,6 +9438,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return -1; + } + goto SEC_WE; + + case 'e': if (last) { return -1; @@ -6834,6 +9459,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'B': + if (last) { + return -1; + } + goto SEC_WEB; + + case 'b': if (last) { return -1; @@ -6848,6 +9480,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'S': + if (last) { + return -1; + } + goto SEC_WEBS; + + case 's': if (last) { return -1; @@ -6862,6 +9501,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'O': + if (last) { + return -1; + } + goto SEC_WEBSO; + + case 'o': if (last) { return -1; @@ -6876,6 +9522,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'C': + if (last) { + return -1; + } + goto SEC_WEBSOC; + + case 'c': if (last) { return -1; @@ -6890,6 +9543,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'K': + if (last) { + return -1; + } + goto SEC_WEBSOCK; + + case 'k': if (last) { return -1; @@ -6904,6 +9564,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return -1; + } + goto SEC_WEBSOCKE; + + case 'e': if (last) { return -1; @@ -6918,6 +9585,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'T': + if (last) { + return -1; + } + goto SEC_WEBSOCKET; + + case 't': if (last) { return -1; @@ -7023,6 +9697,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'C': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_AC; + + case 'c': if (last) { return -1; @@ -7037,6 +9718,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'C': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_ACC; + + case 'c': if (last) { return -1; @@ -7051,6 +9739,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_ACCE; + + case 'e': if (last) { return -1; @@ -7065,6 +9760,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'P': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_ACCEP; + + case 'p': if (last) { return -1; @@ -7079,6 +9781,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'T': + if (last) { + return 55; + } + goto SEC_WEBSOCKET_ACCEPT; + + case 't': if (last) { return 55; @@ -7101,6 +9810,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'X': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_EX; + + case 'x': if (last) { return -1; @@ -7115,6 +9831,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'T': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_EXT; + + case 't': if (last) { return -1; @@ -7129,6 +9852,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_EXTE; + + case 'e': if (last) { return -1; @@ -7143,6 +9873,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'N': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_EXTEN; + + case 'n': if (last) { return -1; @@ -7157,6 +9894,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'S': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_EXTENS; + + case 's': if (last) { return -1; @@ -7171,6 +9915,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'I': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_EXTENSI; + + case 'i': if (last) { return -1; @@ -7185,6 +9936,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'O': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_EXTENSIO; + + case 'o': if (last) { return -1; @@ -7199,6 +9957,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'N': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_EXTENSION; + + case 'n': if (last) { return -1; @@ -7213,6 +9978,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'S': + if (last) { + return 56; + } + goto SEC_WEBSOCKET_EXTENSIONS; + + case 's': if (last) { return 56; @@ -7235,6 +10007,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_KE; + + case 'e': if (last) { return -1; @@ -7249,6 +10028,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'Y': + if (last) { + return 57; + } + goto SEC_WEBSOCKET_KEY; + + case 'y': if (last) { return 57; @@ -7285,6 +10071,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'R': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_PR; + + case 'r': if (last) { return -1; @@ -7295,9 +10088,16 @@ find_header(const char *str, int size) return -1; } -SEC_WEBSOCKET_PR: - NEXT_CHAR(); - switch (ch) { +SEC_WEBSOCKET_PR: + NEXT_CHAR(); + switch (ch) { + + case 'O': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_PRO; + case 'o': if (last) { @@ -7313,6 +10113,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'T': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_PROT; + + case 't': if (last) { return -1; @@ -7327,6 +10134,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'O': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_PROTO; + + case 'o': if (last) { return -1; @@ -7341,6 +10155,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'C': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_PROTOC; + + case 'c': if (last) { return -1; @@ -7355,6 +10176,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'O': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_PROTOCO; + + case 'o': if (last) { return -1; @@ -7369,6 +10197,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'L': + if (last) { + return 59; + } + goto SEC_WEBSOCKET_PROTOCOL; + + case 'l': if (last) { return 59; @@ -7391,6 +10226,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_VE; + + case 'e': if (last) { return -1; @@ -7405,6 +10247,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'R': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_VER; + + case 'r': if (last) { return -1; @@ -7419,6 +10268,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'S': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_VERS; + + case 's': if (last) { return -1; @@ -7433,6 +10289,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'I': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_VERSI; + + case 'i': if (last) { return -1; @@ -7447,6 +10310,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'O': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_VERSIO; + + case 'o': if (last) { return -1; @@ -7461,6 +10331,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'N': + if (last) { + return 60; + } + goto SEC_WEBSOCKET_VERSION; + + case 'n': if (last) { return 60; @@ -7483,6 +10360,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'V': + if (last) { + return -1; + } + goto SERV; + + case 'v': if (last) { return -1; @@ -7497,6 +10381,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return -1; + } + goto SERVE; + + case 'e': if (last) { return -1; @@ -7511,6 +10402,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'R': + if (last) { + return 61; + } + goto SERVER; + + case 'r': if (last) { return 61; @@ -7568,6 +10466,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'O': + if (last) { + return -1; + } + goto SET_CO; + + case 'o': if (last) { return -1; @@ -7582,6 +10487,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'O': + if (last) { + return -1; + } + goto SET_COO; + + case 'o': if (last) { return -1; @@ -7596,6 +10508,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'K': + if (last) { + return -1; + } + goto SET_COOK; + + case 'k': if (last) { return -1; @@ -7610,6 +10529,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'I': + if (last) { + return -1; + } + goto SET_COOKI; + + case 'i': if (last) { return -1; @@ -7624,6 +10550,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return 62; + } + goto SET_COOKIE; + + case 'e': if (last) { return 62; @@ -7646,6 +10579,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return 63; + } + goto TE; + + case 'e': if (last) { return 63; @@ -7653,6 +10593,13 @@ find_header(const char *str, int size) goto TE; + case 'R': + if (last) { + return -1; + } + goto TR; + + case 'r': if (last) { return -1; @@ -7675,6 +10622,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'A': + if (last) { + return -1; + } + goto TRA; + + case 'a': if (last) { return -1; @@ -7689,6 +10643,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'I': + if (last) { + return -1; + } + goto TRAI; + + case 'i': if (last) { return -1; @@ -7696,6 +10657,13 @@ find_header(const char *str, int size) goto TRAI; + case 'N': + if (last) { + return -1; + } + goto TRAN; + + case 'n': if (last) { return -1; @@ -7710,6 +10678,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'L': + if (last) { + return -1; + } + goto TRAIL; + + case 'l': if (last) { return -1; @@ -7724,6 +10699,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return -1; + } + goto TRAILE; + + case 'e': if (last) { return -1; @@ -7738,6 +10720,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'R': + if (last) { + return 64; + } + goto TRAILER; + + case 'r': if (last) { return 64; @@ -7760,6 +10749,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'S': + if (last) { + return -1; + } + goto TRANS; + + case 's': if (last) { return -1; @@ -7774,6 +10770,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'F': + if (last) { + return -1; + } + goto TRANSF; + + case 'f': if (last) { return -1; @@ -7788,6 +10791,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return -1; + } + goto TRANSFE; + + case 'e': if (last) { return -1; @@ -7802,6 +10812,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'R': + if (last) { + return -1; + } + goto TRANSFER; + + case 'r': if (last) { return -1; @@ -7851,6 +10868,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'N': + if (last) { + return -1; + } + goto TRANSFER_EN; + + case 'n': if (last) { return -1; @@ -7865,6 +10889,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'C': + if (last) { + return -1; + } + goto TRANSFER_ENC; + + case 'c': if (last) { return -1; @@ -7879,6 +10910,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'O': + if (last) { + return -1; + } + goto TRANSFER_ENCO; + + case 'o': if (last) { return -1; @@ -7893,6 +10931,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'D': + if (last) { + return -1; + } + goto TRANSFER_ENCOD; + + case 'd': if (last) { return -1; @@ -7907,6 +10952,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'I': + if (last) { + return -1; + } + goto TRANSFER_ENCODI; + + case 'i': if (last) { return -1; @@ -7921,6 +10973,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'N': + if (last) { + return -1; + } + goto TRANSFER_ENCODIN; + + case 'n': if (last) { return -1; @@ -7935,6 +10994,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'G': + if (last) { + return 65; + } + goto TRANSFER_ENCODING; + + case 'g': if (last) { return 65; @@ -7957,6 +11023,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'P': + if (last) { + return -1; + } + goto UP; + + case 'p': if (last) { return -1; @@ -7964,6 +11037,13 @@ find_header(const char *str, int size) goto UP; + case 'R': + if (last) { + return -1; + } + goto UR; + + case 'r': if (last) { return -1; @@ -7971,6 +11051,13 @@ find_header(const char *str, int size) goto UR; + case 'S': + if (last) { + return -1; + } + goto US; + + case 's': if (last) { return -1; @@ -7985,6 +11072,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'G': + if (last) { + return -1; + } + goto UPG; + + case 'g': if (last) { return -1; @@ -7999,6 +11093,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'R': + if (last) { + return -1; + } + goto UPGR; + + case 'r': if (last) { return -1; @@ -8013,6 +11114,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'A': + if (last) { + return -1; + } + goto UPGRA; + + case 'a': if (last) { return -1; @@ -8027,6 +11135,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'D': + if (last) { + return -1; + } + goto UPGRAD; + + case 'd': if (last) { return -1; @@ -8041,6 +11156,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return 66; + } + goto UPGRADE; + + case 'e': if (last) { return 66; @@ -8063,6 +11185,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'I': + if (last) { + return 67; + } + goto URI; + + case 'i': if (last) { return 67; @@ -8085,6 +11214,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return -1; + } + goto USE; + + case 'e': if (last) { return -1; @@ -8099,6 +11235,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'R': + if (last) { + return -1; + } + goto USER; + + case 'r': if (last) { return -1; @@ -8148,6 +11291,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'G': + if (last) { + return -1; + } + goto USER_AG; + + case 'g': if (last) { return -1; @@ -8162,6 +11312,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return -1; + } + goto USER_AGE; + + case 'e': if (last) { return -1; @@ -8176,6 +11333,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'N': + if (last) { + return -1; + } + goto USER_AGEN; + + case 'n': if (last) { return -1; @@ -8190,6 +11354,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'T': + if (last) { + return 68; + } + goto USER_AGENT; + + case 't': if (last) { return 68; @@ -8212,6 +11383,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'A': + if (last) { + return -1; + } + goto VA; + + case 'a': if (last) { return -1; @@ -8219,6 +11397,13 @@ find_header(const char *str, int size) goto VA; + case 'I': + if (last) { + return -1; + } + goto VI; + + case 'i': if (last) { return -1; @@ -8233,6 +11418,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'R': + if (last) { + return -1; + } + goto VAR; + + case 'r': if (last) { return -1; @@ -8247,6 +11439,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'Y': + if (last) { + return 69; + } + goto VARY; + + case 'y': if (last) { return 69; @@ -8269,6 +11468,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'A': + if (last) { + return 70; + } + goto VIA; + + case 'a': if (last) { return 70; @@ -8291,6 +11497,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'A': + if (last) { + return -1; + } + goto WA; + + case 'a': if (last) { return -1; @@ -8298,6 +11511,13 @@ find_header(const char *str, int size) goto WA; + case 'E': + if (last) { + return -1; + } + goto WE; + + case 'e': if (last) { return -1; @@ -8305,6 +11525,13 @@ find_header(const char *str, int size) goto WE; + case 'W': + if (last) { + return -1; + } + goto WW; + + case 'w': if (last) { return -1; @@ -8319,6 +11546,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'N': + if (last) { + return -1; + } + goto WAN; + + case 'n': if (last) { return -1; @@ -8326,6 +11560,13 @@ find_header(const char *str, int size) goto WAN; + case 'R': + if (last) { + return -1; + } + goto WAR; + + case 'r': if (last) { return -1; @@ -8340,6 +11581,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'T': + if (last) { + return -1; + } + goto WANT; + + case 't': if (last) { return -1; @@ -8389,6 +11637,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'I': + if (last) { + return -1; + } + goto WANT_DI; + + case 'i': if (last) { return -1; @@ -8403,6 +11658,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'G': + if (last) { + return -1; + } + goto WANT_DIG; + + case 'g': if (last) { return -1; @@ -8417,6 +11679,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return -1; + } + goto WANT_DIGE; + + case 'e': if (last) { return -1; @@ -8431,6 +11700,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'S': + if (last) { + return -1; + } + goto WANT_DIGES; + + case 's': if (last) { return -1; @@ -8445,6 +11721,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'T': + if (last) { + return 71; + } + goto WANT_DIGEST; + + case 't': if (last) { return 71; @@ -8467,6 +11750,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'N': + if (last) { + return -1; + } + goto WARN; + + case 'n': if (last) { return -1; @@ -8481,6 +11771,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'I': + if (last) { + return -1; + } + goto WARNI; + + case 'i': if (last) { return -1; @@ -8495,6 +11792,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'N': + if (last) { + return -1; + } + goto WARNIN; + + case 'n': if (last) { return -1; @@ -8505,9 +11809,16 @@ find_header(const char *str, int size) return -1; } -WARNIN: - NEXT_CHAR(); - switch (ch) { +WARNIN: + NEXT_CHAR(); + switch (ch) { + + case 'G': + if (last) { + return 72; + } + goto WARNING; + case 'g': if (last) { @@ -8531,6 +11842,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'B': + if (last) { + return -1; + } + goto WEB; + + case 'b': if (last) { return -1; @@ -8545,6 +11863,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'S': + if (last) { + return -1; + } + goto WEBS; + + case 's': if (last) { return -1; @@ -8559,6 +11884,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'O': + if (last) { + return -1; + } + goto WEBSO; + + case 'o': if (last) { return -1; @@ -8573,6 +11905,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'C': + if (last) { + return -1; + } + goto WEBSOC; + + case 'c': if (last) { return -1; @@ -8587,6 +11926,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'K': + if (last) { + return -1; + } + goto WEBSOCK; + + case 'k': if (last) { return -1; @@ -8601,6 +11947,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return -1; + } + goto WEBSOCKE; + + case 'e': if (last) { return -1; @@ -8615,6 +11968,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'T': + if (last) { + return 73; + } + goto WEBSOCKET; + + case 't': if (last) { return 73; @@ -8637,6 +11997,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'W': + if (last) { + return -1; + } + goto WWW; + + case 'w': if (last) { return -1; @@ -8686,6 +12053,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'U': + if (last) { + return -1; + } + goto WWW_AU; + + case 'u': if (last) { return -1; @@ -8700,6 +12074,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'T': + if (last) { + return -1; + } + goto WWW_AUT; + + case 't': if (last) { return -1; @@ -8714,6 +12095,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'H': + if (last) { + return -1; + } + goto WWW_AUTH; + + case 'h': if (last) { return -1; @@ -8728,6 +12116,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return -1; + } + goto WWW_AUTHE; + + case 'e': if (last) { return -1; @@ -8742,6 +12137,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'N': + if (last) { + return -1; + } + goto WWW_AUTHEN; + + case 'n': if (last) { return -1; @@ -8756,6 +12158,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'T': + if (last) { + return -1; + } + goto WWW_AUTHENT; + + case 't': if (last) { return -1; @@ -8770,6 +12179,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'I': + if (last) { + return -1; + } + goto WWW_AUTHENTI; + + case 'i': if (last) { return -1; @@ -8784,6 +12200,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'C': + if (last) { + return -1; + } + goto WWW_AUTHENTIC; + + case 'c': if (last) { return -1; @@ -8798,6 +12221,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'A': + if (last) { + return -1; + } + goto WWW_AUTHENTICA; + + case 'a': if (last) { return -1; @@ -8812,6 +12242,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'T': + if (last) { + return -1; + } + goto WWW_AUTHENTICAT; + + case 't': if (last) { return -1; @@ -8826,6 +12263,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return 74; + } + goto WWW_AUTHENTICATE; + + case 'e': if (last) { return 74; @@ -8883,6 +12327,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'O': + if (last) { + return -1; + } + goto X_FO; + + case 'o': if (last) { return -1; @@ -8897,6 +12348,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'R': + if (last) { + return -1; + } + goto X_FOR; + + case 'r': if (last) { return -1; @@ -8911,6 +12369,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'W': + if (last) { + return -1; + } + goto X_FORW; + + case 'w': if (last) { return -1; @@ -8925,6 +12390,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'A': + if (last) { + return -1; + } + goto X_FORWA; + + case 'a': if (last) { return -1; @@ -8939,6 +12411,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'R': + if (last) { + return -1; + } + goto X_FORWAR; + + case 'r': if (last) { return -1; @@ -8953,6 +12432,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'D': + if (last) { + return -1; + } + goto X_FORWARD; + + case 'd': if (last) { return -1; @@ -8967,6 +12453,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'E': + if (last) { + return -1; + } + goto X_FORWARDE; + + case 'e': if (last) { return -1; @@ -8981,6 +12474,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'D': + if (last) { + return -1; + } + goto X_FORWARDED; + + case 'd': if (last) { return -1; @@ -9058,6 +12558,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'O': + if (last) { + return -1; + } + goto X_FORWARDED_FO; + + case 'o': if (last) { return -1; @@ -9072,6 +12579,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'R': + if (last) { + return 75; + } + goto X_FORWARDED_FOR; + + case 'r': if (last) { return 75; @@ -9094,6 +12608,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'O': + if (last) { + return -1; + } + goto X_FORWARDED_HO; + + case 'o': if (last) { return -1; @@ -9108,6 +12629,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'S': + if (last) { + return -1; + } + goto X_FORWARDED_HOS; + + case 's': if (last) { return -1; @@ -9122,6 +12650,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'T': + if (last) { + return 76; + } + goto X_FORWARDED_HOST; + + case 't': if (last) { return 76; @@ -9144,6 +12679,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'R': + if (last) { + return -1; + } + goto X_FORWARDED_PR; + + case 'r': if (last) { return -1; @@ -9158,6 +12700,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'O': + if (last) { + return -1; + } + goto X_FORWARDED_PRO; + + case 'o': if (last) { return -1; @@ -9172,6 +12721,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'T': + if (last) { + return -1; + } + goto X_FORWARDED_PROT; + + case 't': if (last) { return -1; @@ -9186,6 +12742,13 @@ find_header(const char *str, int size) NEXT_CHAR(); switch (ch) { + case 'O': + if (last) { + return 77; + } + goto X_FORWARDED_PROTO; + + case 'o': if (last) { return 77; diff --git a/tools/gen.py b/tools/gen.py index 2cc8f5eef00..1f55b9f7d51 100755 --- a/tools/gen.py +++ b/tools/gen.py @@ -97,10 +97,11 @@ def gen_block(dct, prefix, used_blocks, out): index = headers.index(term) else: index = -1 - case = CASE.format(char=k, index=index, next=next_prefix) + hi = k.upper() + case = CASE.format(char=hi, index=index, next=next_prefix) cases.append(case) lo = k.lower() - if lo != k: + if lo != hi: case = CASE.format(char=lo, index=index, next=next_prefix) cases.append(case) label = prefix if prefix else 'INITIAL' From f8fa6a646add4b027291bf8bbb30e8ead6ba4415 Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Thu, 21 Jun 2018 18:06:06 +0300 Subject: [PATCH 18/22] Remove redundant type check --- aiohttp/_http_parser.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aiohttp/_http_parser.pyx b/aiohttp/_http_parser.pyx index ed58fcfa664..b0a214c1c16 100644 --- a/aiohttp/_http_parser.pyx +++ b/aiohttp/_http_parser.pyx @@ -74,7 +74,7 @@ for i in range(METHODS_COUNT): cdef inline str http_method_str(int i): if i < METHODS_COUNT: - return _http_method[i] + return _http_method[i] else: return "" From bf2c42220e96bc8b7343508ca9550394700d739e Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Thu, 21 Jun 2018 20:51:52 +0300 Subject: [PATCH 19/22] Improve generated code formatting --- aiohttp/_find_header.c | 15928 +++++++++++++++++---------------------- tools/gen.py | 17 +- 2 files changed, 6776 insertions(+), 9169 deletions(-) diff --git a/aiohttp/_find_header.c b/aiohttp/_find_header.c index 2ea9981bd14..63b15a5f6c3 100644 --- a/aiohttp/_find_header.c +++ b/aiohttp/_find_header.c @@ -25,12746 +25,10354 @@ find_header(const char *str, int size) INITIAL: NEXT_CHAR(); switch (ch) { - - case 'A': - if (last) { - return -1; - } - goto A; - - - case 'a': - if (last) { - return -1; - } - goto A; - - - case 'C': - if (last) { - return -1; - } - goto C; - - - case 'c': - if (last) { + case 'A': + if (last) { + return -1; + } + goto A; + case 'a': + if (last) { + return -1; + } + goto A; + case 'C': + if (last) { + return -1; + } + goto C; + case 'c': + if (last) { + return -1; + } + goto C; + case 'D': + if (last) { + return -1; + } + goto D; + case 'd': + if (last) { + return -1; + } + goto D; + case 'E': + if (last) { + return -1; + } + goto E; + case 'e': + if (last) { + return -1; + } + goto E; + case 'F': + if (last) { + return -1; + } + goto F; + case 'f': + if (last) { + return -1; + } + goto F; + case 'H': + if (last) { + return -1; + } + goto H; + case 'h': + if (last) { + return -1; + } + goto H; + case 'I': + if (last) { + return -1; + } + goto I; + case 'i': + if (last) { + return -1; + } + goto I; + case 'K': + if (last) { + return -1; + } + goto K; + case 'k': + if (last) { + return -1; + } + goto K; + case 'L': + if (last) { + return -1; + } + goto L; + case 'l': + if (last) { + return -1; + } + goto L; + case 'M': + if (last) { + return -1; + } + goto M; + case 'm': + if (last) { + return -1; + } + goto M; + case 'O': + if (last) { + return -1; + } + goto O; + case 'o': + if (last) { + return -1; + } + goto O; + case 'P': + if (last) { + return -1; + } + goto P; + case 'p': + if (last) { + return -1; + } + goto P; + case 'R': + if (last) { + return -1; + } + goto R; + case 'r': + if (last) { + return -1; + } + goto R; + case 'S': + if (last) { + return -1; + } + goto S; + case 's': + if (last) { + return -1; + } + goto S; + case 'T': + if (last) { + return -1; + } + goto T; + case 't': + if (last) { + return -1; + } + goto T; + case 'U': + if (last) { + return -1; + } + goto U; + case 'u': + if (last) { + return -1; + } + goto U; + case 'V': + if (last) { + return -1; + } + goto V; + case 'v': + if (last) { + return -1; + } + goto V; + case 'W': + if (last) { + return -1; + } + goto W; + case 'w': + if (last) { + return -1; + } + goto W; + case 'X': + if (last) { + return -1; + } + goto X; + case 'x': + if (last) { + return -1; + } + goto X; + default: return -1; - } - goto C; - - - case 'D': - if (last) { - return -1; - } - goto D; - - - case 'd': - if (last) { - return -1; - } - goto D; - - - case 'E': - if (last) { - return -1; - } - goto E; - - - case 'e': - if (last) { - return -1; - } - goto E; - - - case 'F': - if (last) { - return -1; - } - goto F; - - - case 'f': - if (last) { - return -1; - } - goto F; - - - case 'H': - if (last) { - return -1; - } - goto H; - - - case 'h': - if (last) { - return -1; - } - goto H; - - - case 'I': - if (last) { - return -1; - } - goto I; - - - case 'i': - if (last) { - return -1; - } - goto I; - - - case 'K': - if (last) { - return -1; - } - goto K; - - - case 'k': - if (last) { - return -1; - } - goto K; - - - case 'L': - if (last) { - return -1; - } - goto L; - - - case 'l': - if (last) { - return -1; - } - goto L; - - - case 'M': - if (last) { - return -1; - } - goto M; - - - case 'm': - if (last) { - return -1; - } - goto M; - - - case 'O': - if (last) { - return -1; - } - goto O; - - - case 'o': - if (last) { - return -1; - } - goto O; - - - case 'P': - if (last) { - return -1; - } - goto P; - - - case 'p': - if (last) { - return -1; - } - goto P; - - - case 'R': - if (last) { - return -1; - } - goto R; - - - case 'r': - if (last) { - return -1; - } - goto R; - - - case 'S': - if (last) { - return -1; - } - goto S; - - - case 's': - if (last) { - return -1; - } - goto S; - - - case 'T': - if (last) { - return -1; - } - goto T; - - - case 't': - if (last) { - return -1; - } - goto T; - - - case 'U': - if (last) { - return -1; - } - goto U; - - - case 'u': - if (last) { - return -1; - } - goto U; - - - case 'V': - if (last) { - return -1; - } - goto V; - - - case 'v': - if (last) { - return -1; - } - goto V; - - - case 'W': - if (last) { - return -1; - } - goto W; - - - case 'w': - if (last) { - return -1; - } - goto W; - - - case 'X': - if (last) { - return -1; - } - goto X; - - - case 'x': - if (last) { - return -1; - } - goto X; - - default: - return -1; } A: NEXT_CHAR(); switch (ch) { - - case 'C': - if (last) { - return -1; - } - goto AC; - - - case 'c': - if (last) { - return -1; - } - goto AC; - - - case 'G': - if (last) { - return -1; - } - goto AG; - - - case 'g': - if (last) { - return -1; - } - goto AG; - - - case 'L': - if (last) { - return -1; - } - goto AL; - - - case 'l': - if (last) { - return -1; - } - goto AL; - - - case 'U': - if (last) { - return -1; - } - goto AU; - - - case 'u': - if (last) { + case 'C': + if (last) { + return -1; + } + goto AC; + case 'c': + if (last) { + return -1; + } + goto AC; + case 'G': + if (last) { + return -1; + } + goto AG; + case 'g': + if (last) { + return -1; + } + goto AG; + case 'L': + if (last) { + return -1; + } + goto AL; + case 'l': + if (last) { + return -1; + } + goto AL; + case 'U': + if (last) { + return -1; + } + goto AU; + case 'u': + if (last) { + return -1; + } + goto AU; + default: return -1; - } - goto AU; - - default: - return -1; } AC: NEXT_CHAR(); switch (ch) { - - case 'C': - if (last) { + case 'C': + if (last) { + return -1; + } + goto ACC; + case 'c': + if (last) { + return -1; + } + goto ACC; + default: return -1; - } - goto ACC; - - - case 'c': - if (last) { - return -1; - } - goto ACC; - - default: - return -1; } ACC: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return -1; - } - goto ACCE; - - - case 'e': - if (last) { + case 'E': + if (last) { + return -1; + } + goto ACCE; + case 'e': + if (last) { + return -1; + } + goto ACCE; + default: return -1; - } - goto ACCE; - - default: - return -1; } ACCE: NEXT_CHAR(); switch (ch) { - - case 'P': - if (last) { - return -1; - } - goto ACCEP; - - - case 'p': - if (last) { - return -1; - } - goto ACCEP; - - - case 'S': - if (last) { - return -1; - } - goto ACCES; - - - case 's': - if (last) { + case 'P': + if (last) { + return -1; + } + goto ACCEP; + case 'p': + if (last) { + return -1; + } + goto ACCEP; + case 'S': + if (last) { + return -1; + } + goto ACCES; + case 's': + if (last) { + return -1; + } + goto ACCES; + default: return -1; - } - goto ACCES; - - default: - return -1; } ACCEP: NEXT_CHAR(); switch (ch) { - - case 'T': - if (last) { - return 0; - } - goto ACCEPT; - - - case 't': - if (last) { - return 0; - } - goto ACCEPT; - - default: - return -1; + case 'T': + if (last) { + return 0; + } + goto ACCEPT; + case 't': + if (last) { + return 0; + } + goto ACCEPT; + default: + return -1; } ACCEPT: NEXT_CHAR(); switch (ch) { - - case '-': - if (last) { + case '-': + if (last) { + return -1; + } + goto ACCEPT_; + default: return -1; - } - goto ACCEPT_; - - default: - return -1; } ACCEPT_: NEXT_CHAR(); switch (ch) { - - case 'C': - if (last) { - return -1; - } - goto ACCEPT_C; - - - case 'c': - if (last) { - return -1; - } - goto ACCEPT_C; - - - case 'E': - if (last) { - return -1; - } - goto ACCEPT_E; - - - case 'e': - if (last) { - return -1; - } - goto ACCEPT_E; - - - case 'L': - if (last) { + case 'C': + if (last) { + return -1; + } + goto ACCEPT_C; + case 'c': + if (last) { + return -1; + } + goto ACCEPT_C; + case 'E': + if (last) { + return -1; + } + goto ACCEPT_E; + case 'e': + if (last) { + return -1; + } + goto ACCEPT_E; + case 'L': + if (last) { + return -1; + } + goto ACCEPT_L; + case 'l': + if (last) { + return -1; + } + goto ACCEPT_L; + case 'R': + if (last) { + return -1; + } + goto ACCEPT_R; + case 'r': + if (last) { + return -1; + } + goto ACCEPT_R; + default: return -1; - } - goto ACCEPT_L; - - - case 'l': - if (last) { - return -1; - } - goto ACCEPT_L; - - - case 'R': - if (last) { - return -1; - } - goto ACCEPT_R; - - - case 'r': - if (last) { - return -1; - } - goto ACCEPT_R; - - default: - return -1; } ACCEPT_C: NEXT_CHAR(); switch (ch) { - - case 'H': - if (last) { + case 'H': + if (last) { + return -1; + } + goto ACCEPT_CH; + case 'h': + if (last) { + return -1; + } + goto ACCEPT_CH; + default: return -1; - } - goto ACCEPT_CH; - - - case 'h': - if (last) { - return -1; - } - goto ACCEPT_CH; - - default: - return -1; } ACCEPT_CH: NEXT_CHAR(); switch (ch) { - - case 'A': - if (last) { + case 'A': + if (last) { + return -1; + } + goto ACCEPT_CHA; + case 'a': + if (last) { + return -1; + } + goto ACCEPT_CHA; + default: return -1; - } - goto ACCEPT_CHA; - - - case 'a': - if (last) { - return -1; - } - goto ACCEPT_CHA; - - default: - return -1; } ACCEPT_CHA: NEXT_CHAR(); switch (ch) { - - case 'R': - if (last) { + case 'R': + if (last) { + return -1; + } + goto ACCEPT_CHAR; + case 'r': + if (last) { + return -1; + } + goto ACCEPT_CHAR; + default: return -1; - } - goto ACCEPT_CHAR; - - - case 'r': - if (last) { - return -1; - } - goto ACCEPT_CHAR; - - default: - return -1; } ACCEPT_CHAR: NEXT_CHAR(); switch (ch) { - - case 'S': - if (last) { - return -1; - } - goto ACCEPT_CHARS; - - - case 's': - if (last) { + case 'S': + if (last) { + return -1; + } + goto ACCEPT_CHARS; + case 's': + if (last) { + return -1; + } + goto ACCEPT_CHARS; + default: return -1; - } - goto ACCEPT_CHARS; - - default: - return -1; } ACCEPT_CHARS: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return -1; - } - goto ACCEPT_CHARSE; - - - case 'e': - if (last) { + case 'E': + if (last) { + return -1; + } + goto ACCEPT_CHARSE; + case 'e': + if (last) { + return -1; + } + goto ACCEPT_CHARSE; + default: return -1; - } - goto ACCEPT_CHARSE; - - default: - return -1; } ACCEPT_CHARSE: NEXT_CHAR(); switch (ch) { - - case 'T': - if (last) { - return 1; - } - goto ACCEPT_CHARSET; - - - case 't': - if (last) { - return 1; - } - goto ACCEPT_CHARSET; - - default: - return -1; + case 'T': + if (last) { + return 1; + } + goto ACCEPT_CHARSET; + case 't': + if (last) { + return 1; + } + goto ACCEPT_CHARSET; + default: + return -1; } ACCEPT_CHARSET: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } ACCEPT_E: NEXT_CHAR(); switch (ch) { - - case 'N': - if (last) { - return -1; - } - goto ACCEPT_EN; - - - case 'n': - if (last) { + case 'N': + if (last) { + return -1; + } + goto ACCEPT_EN; + case 'n': + if (last) { + return -1; + } + goto ACCEPT_EN; + default: return -1; - } - goto ACCEPT_EN; - - default: - return -1; } ACCEPT_EN: NEXT_CHAR(); switch (ch) { - - case 'C': - if (last) { - return -1; - } - goto ACCEPT_ENC; - - - case 'c': - if (last) { + case 'C': + if (last) { + return -1; + } + goto ACCEPT_ENC; + case 'c': + if (last) { + return -1; + } + goto ACCEPT_ENC; + default: return -1; - } - goto ACCEPT_ENC; - - default: - return -1; } ACCEPT_ENC: NEXT_CHAR(); switch (ch) { - - case 'O': - if (last) { + case 'O': + if (last) { + return -1; + } + goto ACCEPT_ENCO; + case 'o': + if (last) { + return -1; + } + goto ACCEPT_ENCO; + default: return -1; - } - goto ACCEPT_ENCO; - - - case 'o': - if (last) { - return -1; - } - goto ACCEPT_ENCO; - - default: - return -1; } ACCEPT_ENCO: NEXT_CHAR(); switch (ch) { - - case 'D': - if (last) { - return -1; - } - goto ACCEPT_ENCOD; - - - case 'd': - if (last) { + case 'D': + if (last) { + return -1; + } + goto ACCEPT_ENCOD; + case 'd': + if (last) { + return -1; + } + goto ACCEPT_ENCOD; + default: return -1; - } - goto ACCEPT_ENCOD; - - default: - return -1; } ACCEPT_ENCOD: NEXT_CHAR(); switch (ch) { - - case 'I': - if (last) { + case 'I': + if (last) { + return -1; + } + goto ACCEPT_ENCODI; + case 'i': + if (last) { + return -1; + } + goto ACCEPT_ENCODI; + default: return -1; - } - goto ACCEPT_ENCODI; - - - case 'i': - if (last) { - return -1; - } - goto ACCEPT_ENCODI; - - default: - return -1; } ACCEPT_ENCODI: NEXT_CHAR(); switch (ch) { - - case 'N': - if (last) { + case 'N': + if (last) { + return -1; + } + goto ACCEPT_ENCODIN; + case 'n': + if (last) { + return -1; + } + goto ACCEPT_ENCODIN; + default: return -1; - } - goto ACCEPT_ENCODIN; - - - case 'n': - if (last) { - return -1; - } - goto ACCEPT_ENCODIN; - - default: - return -1; } ACCEPT_ENCODIN: NEXT_CHAR(); switch (ch) { - - case 'G': - if (last) { - return 2; - } - goto ACCEPT_ENCODING; - - - case 'g': - if (last) { - return 2; - } - goto ACCEPT_ENCODING; - - default: - return -1; + case 'G': + if (last) { + return 2; + } + goto ACCEPT_ENCODING; + case 'g': + if (last) { + return 2; + } + goto ACCEPT_ENCODING; + default: + return -1; } ACCEPT_ENCODING: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } ACCEPT_L: NEXT_CHAR(); switch (ch) { - - case 'A': - if (last) { + case 'A': + if (last) { + return -1; + } + goto ACCEPT_LA; + case 'a': + if (last) { + return -1; + } + goto ACCEPT_LA; + default: return -1; - } - goto ACCEPT_LA; - - - case 'a': - if (last) { - return -1; - } - goto ACCEPT_LA; - - default: - return -1; } ACCEPT_LA: NEXT_CHAR(); switch (ch) { - - case 'N': - if (last) { + case 'N': + if (last) { + return -1; + } + goto ACCEPT_LAN; + case 'n': + if (last) { + return -1; + } + goto ACCEPT_LAN; + default: return -1; - } - goto ACCEPT_LAN; - - - case 'n': - if (last) { - return -1; - } - goto ACCEPT_LAN; - - default: - return -1; } ACCEPT_LAN: NEXT_CHAR(); switch (ch) { - - case 'G': - if (last) { + case 'G': + if (last) { + return -1; + } + goto ACCEPT_LANG; + case 'g': + if (last) { + return -1; + } + goto ACCEPT_LANG; + default: return -1; - } - goto ACCEPT_LANG; - - - case 'g': - if (last) { - return -1; - } - goto ACCEPT_LANG; - - default: - return -1; } ACCEPT_LANG: NEXT_CHAR(); switch (ch) { - - case 'U': - if (last) { + case 'U': + if (last) { + return -1; + } + goto ACCEPT_LANGU; + case 'u': + if (last) { + return -1; + } + goto ACCEPT_LANGU; + default: return -1; - } - goto ACCEPT_LANGU; - - - case 'u': - if (last) { - return -1; - } - goto ACCEPT_LANGU; - - default: - return -1; } ACCEPT_LANGU: NEXT_CHAR(); switch (ch) { - - case 'A': - if (last) { - return -1; - } - goto ACCEPT_LANGUA; - - - case 'a': - if (last) { + case 'A': + if (last) { + return -1; + } + goto ACCEPT_LANGUA; + case 'a': + if (last) { + return -1; + } + goto ACCEPT_LANGUA; + default: return -1; - } - goto ACCEPT_LANGUA; - - default: - return -1; } ACCEPT_LANGUA: NEXT_CHAR(); switch (ch) { - - case 'G': - if (last) { - return -1; - } - goto ACCEPT_LANGUAG; - - - case 'g': - if (last) { + case 'G': + if (last) { + return -1; + } + goto ACCEPT_LANGUAG; + case 'g': + if (last) { + return -1; + } + goto ACCEPT_LANGUAG; + default: return -1; - } - goto ACCEPT_LANGUAG; - - default: - return -1; } ACCEPT_LANGUAG: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return 3; - } - goto ACCEPT_LANGUAGE; - - - case 'e': - if (last) { - return 3; - } - goto ACCEPT_LANGUAGE; - - default: - return -1; + case 'E': + if (last) { + return 3; + } + goto ACCEPT_LANGUAGE; + case 'e': + if (last) { + return 3; + } + goto ACCEPT_LANGUAGE; + default: + return -1; } ACCEPT_LANGUAGE: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } ACCEPT_R: NEXT_CHAR(); switch (ch) { - - case 'A': - if (last) { - return -1; - } - goto ACCEPT_RA; - - - case 'a': - if (last) { + case 'A': + if (last) { + return -1; + } + goto ACCEPT_RA; + case 'a': + if (last) { + return -1; + } + goto ACCEPT_RA; + default: return -1; - } - goto ACCEPT_RA; - - default: - return -1; } ACCEPT_RA: NEXT_CHAR(); switch (ch) { - - case 'N': - if (last) { - return -1; - } - goto ACCEPT_RAN; - - - case 'n': - if (last) { + case 'N': + if (last) { + return -1; + } + goto ACCEPT_RAN; + case 'n': + if (last) { + return -1; + } + goto ACCEPT_RAN; + default: return -1; - } - goto ACCEPT_RAN; - - default: - return -1; } ACCEPT_RAN: NEXT_CHAR(); switch (ch) { - - case 'G': - if (last) { - return -1; - } - goto ACCEPT_RANG; - - - case 'g': - if (last) { + case 'G': + if (last) { + return -1; + } + goto ACCEPT_RANG; + case 'g': + if (last) { + return -1; + } + goto ACCEPT_RANG; + default: return -1; - } - goto ACCEPT_RANG; - - default: - return -1; } ACCEPT_RANG: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { + case 'E': + if (last) { + return -1; + } + goto ACCEPT_RANGE; + case 'e': + if (last) { + return -1; + } + goto ACCEPT_RANGE; + default: return -1; - } - goto ACCEPT_RANGE; - - - case 'e': - if (last) { - return -1; - } - goto ACCEPT_RANGE; - - default: - return -1; } ACCEPT_RANGE: NEXT_CHAR(); switch (ch) { - - case 'S': - if (last) { - return 4; - } - goto ACCEPT_RANGES; - - - case 's': - if (last) { - return 4; - } - goto ACCEPT_RANGES; - - default: - return -1; + case 'S': + if (last) { + return 4; + } + goto ACCEPT_RANGES; + case 's': + if (last) { + return 4; + } + goto ACCEPT_RANGES; + default: + return -1; } ACCEPT_RANGES: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } ACCES: NEXT_CHAR(); switch (ch) { - - case 'S': - if (last) { + case 'S': + if (last) { + return -1; + } + goto ACCESS; + case 's': + if (last) { + return -1; + } + goto ACCESS; + default: return -1; - } - goto ACCESS; - - - case 's': - if (last) { - return -1; - } - goto ACCESS; - - default: - return -1; } ACCESS: NEXT_CHAR(); switch (ch) { - - case '-': - if (last) { + case '-': + if (last) { + return -1; + } + goto ACCESS_; + default: return -1; - } - goto ACCESS_; - - default: - return -1; } ACCESS_: NEXT_CHAR(); switch (ch) { - - case 'C': - if (last) { - return -1; - } - goto ACCESS_C; - - - case 'c': - if (last) { + case 'C': + if (last) { + return -1; + } + goto ACCESS_C; + case 'c': + if (last) { + return -1; + } + goto ACCESS_C; + default: return -1; - } - goto ACCESS_C; - - default: - return -1; } ACCESS_C: NEXT_CHAR(); switch (ch) { - - case 'O': - if (last) { - return -1; - } - goto ACCESS_CO; - - - case 'o': - if (last) { + case 'O': + if (last) { + return -1; + } + goto ACCESS_CO; + case 'o': + if (last) { + return -1; + } + goto ACCESS_CO; + default: return -1; - } - goto ACCESS_CO; - - default: - return -1; } ACCESS_CO: NEXT_CHAR(); switch (ch) { - - case 'N': - if (last) { - return -1; - } - goto ACCESS_CON; - - - case 'n': - if (last) { + case 'N': + if (last) { + return -1; + } + goto ACCESS_CON; + case 'n': + if (last) { + return -1; + } + goto ACCESS_CON; + default: return -1; - } - goto ACCESS_CON; - - default: - return -1; } ACCESS_CON: NEXT_CHAR(); switch (ch) { - - case 'T': - if (last) { + case 'T': + if (last) { + return -1; + } + goto ACCESS_CONT; + case 't': + if (last) { + return -1; + } + goto ACCESS_CONT; + default: return -1; - } - goto ACCESS_CONT; - - - case 't': - if (last) { - return -1; - } - goto ACCESS_CONT; - - default: - return -1; } ACCESS_CONT: NEXT_CHAR(); switch (ch) { - - case 'R': - if (last) { - return -1; - } - goto ACCESS_CONTR; - - - case 'r': - if (last) { + case 'R': + if (last) { + return -1; + } + goto ACCESS_CONTR; + case 'r': + if (last) { + return -1; + } + goto ACCESS_CONTR; + default: return -1; - } - goto ACCESS_CONTR; - - default: - return -1; } ACCESS_CONTR: - NEXT_CHAR(); - switch (ch) { - - case 'O': - if (last) { - return -1; - } - goto ACCESS_CONTRO; - - - case 'o': - if (last) { + NEXT_CHAR(); + switch (ch) { + case 'O': + if (last) { + return -1; + } + goto ACCESS_CONTRO; + case 'o': + if (last) { + return -1; + } + goto ACCESS_CONTRO; + default: return -1; - } - goto ACCESS_CONTRO; - - default: - return -1; } ACCESS_CONTRO: NEXT_CHAR(); switch (ch) { - - case 'L': - if (last) { + case 'L': + if (last) { + return -1; + } + goto ACCESS_CONTROL; + case 'l': + if (last) { + return -1; + } + goto ACCESS_CONTROL; + default: return -1; - } - goto ACCESS_CONTROL; - - - case 'l': - if (last) { - return -1; - } - goto ACCESS_CONTROL; - - default: - return -1; } ACCESS_CONTROL: NEXT_CHAR(); switch (ch) { - - case '-': - if (last) { + case '-': + if (last) { + return -1; + } + goto ACCESS_CONTROL_; + default: return -1; - } - goto ACCESS_CONTROL_; - - default: - return -1; } ACCESS_CONTROL_: NEXT_CHAR(); switch (ch) { - - case 'A': - if (last) { - return -1; - } - goto ACCESS_CONTROL_A; - - - case 'a': - if (last) { - return -1; - } - goto ACCESS_CONTROL_A; - - - case 'E': - if (last) { - return -1; - } - goto ACCESS_CONTROL_E; - - - case 'e': - if (last) { - return -1; - } - goto ACCESS_CONTROL_E; - - - case 'M': - if (last) { - return -1; - } - goto ACCESS_CONTROL_M; - - - case 'm': - if (last) { - return -1; - } - goto ACCESS_CONTROL_M; - - - case 'R': - if (last) { - return -1; - } - goto ACCESS_CONTROL_R; - - - case 'r': - if (last) { + case 'A': + if (last) { + return -1; + } + goto ACCESS_CONTROL_A; + case 'a': + if (last) { + return -1; + } + goto ACCESS_CONTROL_A; + case 'E': + if (last) { + return -1; + } + goto ACCESS_CONTROL_E; + case 'e': + if (last) { + return -1; + } + goto ACCESS_CONTROL_E; + case 'M': + if (last) { + return -1; + } + goto ACCESS_CONTROL_M; + case 'm': + if (last) { + return -1; + } + goto ACCESS_CONTROL_M; + case 'R': + if (last) { + return -1; + } + goto ACCESS_CONTROL_R; + case 'r': + if (last) { + return -1; + } + goto ACCESS_CONTROL_R; + default: return -1; - } - goto ACCESS_CONTROL_R; - - default: - return -1; } ACCESS_CONTROL_A: NEXT_CHAR(); switch (ch) { - - case 'L': - if (last) { - return -1; - } - goto ACCESS_CONTROL_AL; - - - case 'l': - if (last) { + case 'L': + if (last) { + return -1; + } + goto ACCESS_CONTROL_AL; + case 'l': + if (last) { + return -1; + } + goto ACCESS_CONTROL_AL; + default: return -1; - } - goto ACCESS_CONTROL_AL; - - default: - return -1; } ACCESS_CONTROL_AL: NEXT_CHAR(); switch (ch) { - - case 'L': - if (last) { - return -1; - } - goto ACCESS_CONTROL_ALL; - - - case 'l': - if (last) { + case 'L': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALL; + case 'l': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALL; + default: return -1; - } - goto ACCESS_CONTROL_ALL; - - default: - return -1; } ACCESS_CONTROL_ALL: NEXT_CHAR(); switch (ch) { - - case 'O': - if (last) { + case 'O': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLO; + case 'o': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLO; + default: return -1; - } - goto ACCESS_CONTROL_ALLO; - - - case 'o': - if (last) { - return -1; - } - goto ACCESS_CONTROL_ALLO; - - default: - return -1; } ACCESS_CONTROL_ALLO: NEXT_CHAR(); switch (ch) { - - case 'W': - if (last) { - return -1; - } - goto ACCESS_CONTROL_ALLOW; - - - case 'w': - if (last) { + case 'W': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW; + case 'w': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW; + default: return -1; - } - goto ACCESS_CONTROL_ALLOW; - - default: - return -1; } ACCESS_CONTROL_ALLOW: NEXT_CHAR(); switch (ch) { - - case '-': - if (last) { + case '-': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_; + default: return -1; - } - goto ACCESS_CONTROL_ALLOW_; - - default: - return -1; } ACCESS_CONTROL_ALLOW_: NEXT_CHAR(); switch (ch) { - - case 'C': - if (last) { - return -1; - } - goto ACCESS_CONTROL_ALLOW_C; - - - case 'c': - if (last) { - return -1; - } - goto ACCESS_CONTROL_ALLOW_C; - - - case 'H': - if (last) { - return -1; - } - goto ACCESS_CONTROL_ALLOW_H; - - - case 'h': - if (last) { - return -1; - } - goto ACCESS_CONTROL_ALLOW_H; - - - case 'M': - if (last) { - return -1; - } - goto ACCESS_CONTROL_ALLOW_M; - - - case 'm': - if (last) { - return -1; - } - goto ACCESS_CONTROL_ALLOW_M; - - - case 'O': - if (last) { - return -1; - } - goto ACCESS_CONTROL_ALLOW_O; - - - case 'o': - if (last) { + case 'C': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_C; + case 'c': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_C; + case 'H': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_H; + case 'h': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_H; + case 'M': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_M; + case 'm': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_M; + case 'O': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_O; + case 'o': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_O; + default: return -1; - } - goto ACCESS_CONTROL_ALLOW_O; - - default: - return -1; } ACCESS_CONTROL_ALLOW_C: NEXT_CHAR(); switch (ch) { - - case 'R': - if (last) { - return -1; - } - goto ACCESS_CONTROL_ALLOW_CR; - - - case 'r': - if (last) { + case 'R': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_CR; + case 'r': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_CR; + default: return -1; - } - goto ACCESS_CONTROL_ALLOW_CR; - - default: - return -1; } ACCESS_CONTROL_ALLOW_CR: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { + case 'E': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_CRE; + case 'e': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_CRE; + default: return -1; - } - goto ACCESS_CONTROL_ALLOW_CRE; - - - case 'e': - if (last) { - return -1; - } - goto ACCESS_CONTROL_ALLOW_CRE; - - default: - return -1; } ACCESS_CONTROL_ALLOW_CRE: NEXT_CHAR(); switch (ch) { - - case 'D': - if (last) { - return -1; - } - goto ACCESS_CONTROL_ALLOW_CRED; - - - case 'd': - if (last) { + case 'D': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_CRED; + case 'd': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_CRED; + default: return -1; - } - goto ACCESS_CONTROL_ALLOW_CRED; - - default: - return -1; } ACCESS_CONTROL_ALLOW_CRED: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return -1; - } - goto ACCESS_CONTROL_ALLOW_CREDE; - - - case 'e': - if (last) { + case 'E': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_CREDE; + case 'e': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_CREDE; + default: return -1; - } - goto ACCESS_CONTROL_ALLOW_CREDE; - - default: - return -1; } ACCESS_CONTROL_ALLOW_CREDE: NEXT_CHAR(); switch (ch) { - - case 'N': - if (last) { - return -1; - } - goto ACCESS_CONTROL_ALLOW_CREDEN; - - - case 'n': - if (last) { + case 'N': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_CREDEN; + case 'n': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_CREDEN; + default: return -1; - } - goto ACCESS_CONTROL_ALLOW_CREDEN; - - default: - return -1; } ACCESS_CONTROL_ALLOW_CREDEN: NEXT_CHAR(); switch (ch) { - - case 'T': - if (last) { + case 'T': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_CREDENT; + case 't': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_CREDENT; + default: return -1; - } - goto ACCESS_CONTROL_ALLOW_CREDENT; - - - case 't': - if (last) { - return -1; - } - goto ACCESS_CONTROL_ALLOW_CREDENT; - - default: - return -1; } ACCESS_CONTROL_ALLOW_CREDENT: NEXT_CHAR(); switch (ch) { - - case 'I': - if (last) { - return -1; - } - goto ACCESS_CONTROL_ALLOW_CREDENTI; - - - case 'i': - if (last) { + case 'I': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_CREDENTI; + case 'i': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_CREDENTI; + default: return -1; - } - goto ACCESS_CONTROL_ALLOW_CREDENTI; - - default: - return -1; } ACCESS_CONTROL_ALLOW_CREDENTI: NEXT_CHAR(); switch (ch) { - - case 'A': - if (last) { - return -1; - } - goto ACCESS_CONTROL_ALLOW_CREDENTIA; - - - case 'a': - if (last) { + case 'A': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_CREDENTIA; + case 'a': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_CREDENTIA; + default: return -1; - } - goto ACCESS_CONTROL_ALLOW_CREDENTIA; - - default: - return -1; } ACCESS_CONTROL_ALLOW_CREDENTIA: NEXT_CHAR(); switch (ch) { - - case 'L': - if (last) { - return -1; - } - goto ACCESS_CONTROL_ALLOW_CREDENTIAL; - - - case 'l': - if (last) { + case 'L': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_CREDENTIAL; + case 'l': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_CREDENTIAL; + default: return -1; - } - goto ACCESS_CONTROL_ALLOW_CREDENTIAL; - - default: - return -1; } ACCESS_CONTROL_ALLOW_CREDENTIAL: NEXT_CHAR(); switch (ch) { - - case 'S': - if (last) { - return 5; - } - goto ACCESS_CONTROL_ALLOW_CREDENTIALS; - - - case 's': - if (last) { - return 5; - } - goto ACCESS_CONTROL_ALLOW_CREDENTIALS; - - default: - return -1; + case 'S': + if (last) { + return 5; + } + goto ACCESS_CONTROL_ALLOW_CREDENTIALS; + case 's': + if (last) { + return 5; + } + goto ACCESS_CONTROL_ALLOW_CREDENTIALS; + default: + return -1; } ACCESS_CONTROL_ALLOW_CREDENTIALS: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } ACCESS_CONTROL_ALLOW_H: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return -1; - } - goto ACCESS_CONTROL_ALLOW_HE; - - - case 'e': - if (last) { + case 'E': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_HE; + case 'e': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_HE; + default: return -1; - } - goto ACCESS_CONTROL_ALLOW_HE; - - default: - return -1; } ACCESS_CONTROL_ALLOW_HE: NEXT_CHAR(); switch (ch) { - - case 'A': - if (last) { - return -1; - } - goto ACCESS_CONTROL_ALLOW_HEA; - - - case 'a': - if (last) { + case 'A': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_HEA; + case 'a': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_HEA; + default: return -1; - } - goto ACCESS_CONTROL_ALLOW_HEA; - - default: - return -1; } ACCESS_CONTROL_ALLOW_HEA: NEXT_CHAR(); switch (ch) { - - case 'D': - if (last) { + case 'D': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_HEAD; + case 'd': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_HEAD; + default: return -1; - } - goto ACCESS_CONTROL_ALLOW_HEAD; - - - case 'd': - if (last) { - return -1; - } - goto ACCESS_CONTROL_ALLOW_HEAD; - - default: - return -1; } ACCESS_CONTROL_ALLOW_HEAD: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return -1; - } - goto ACCESS_CONTROL_ALLOW_HEADE; - - - case 'e': - if (last) { + case 'E': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_HEADE; + case 'e': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_HEADE; + default: return -1; - } - goto ACCESS_CONTROL_ALLOW_HEADE; - - default: - return -1; } ACCESS_CONTROL_ALLOW_HEADE: NEXT_CHAR(); switch (ch) { - - case 'R': - if (last) { - return -1; - } - goto ACCESS_CONTROL_ALLOW_HEADER; - - - case 'r': - if (last) { + case 'R': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_HEADER; + case 'r': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_HEADER; + default: return -1; - } - goto ACCESS_CONTROL_ALLOW_HEADER; - - default: - return -1; } ACCESS_CONTROL_ALLOW_HEADER: NEXT_CHAR(); switch (ch) { - - case 'S': - if (last) { - return 6; - } - goto ACCESS_CONTROL_ALLOW_HEADERS; - - - case 's': - if (last) { - return 6; - } - goto ACCESS_CONTROL_ALLOW_HEADERS; - - default: - return -1; + case 'S': + if (last) { + return 6; + } + goto ACCESS_CONTROL_ALLOW_HEADERS; + case 's': + if (last) { + return 6; + } + goto ACCESS_CONTROL_ALLOW_HEADERS; + default: + return -1; } ACCESS_CONTROL_ALLOW_HEADERS: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } ACCESS_CONTROL_ALLOW_M: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return -1; - } - goto ACCESS_CONTROL_ALLOW_ME; - - - case 'e': - if (last) { + case 'E': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_ME; + case 'e': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_ME; + default: return -1; - } - goto ACCESS_CONTROL_ALLOW_ME; - - default: - return -1; } ACCESS_CONTROL_ALLOW_ME: NEXT_CHAR(); switch (ch) { - - case 'T': - if (last) { - return -1; - } - goto ACCESS_CONTROL_ALLOW_MET; - - - case 't': - if (last) { + case 'T': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_MET; + case 't': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_MET; + default: return -1; - } - goto ACCESS_CONTROL_ALLOW_MET; - - default: - return -1; } ACCESS_CONTROL_ALLOW_MET: NEXT_CHAR(); switch (ch) { - - case 'H': - if (last) { - return -1; - } - goto ACCESS_CONTROL_ALLOW_METH; - - - case 'h': - if (last) { + case 'H': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_METH; + case 'h': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_METH; + default: return -1; - } - goto ACCESS_CONTROL_ALLOW_METH; - - default: - return -1; } ACCESS_CONTROL_ALLOW_METH: NEXT_CHAR(); switch (ch) { - - case 'O': - if (last) { + case 'O': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_METHO; + case 'o': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_METHO; + default: return -1; - } - goto ACCESS_CONTROL_ALLOW_METHO; - - - case 'o': - if (last) { - return -1; - } - goto ACCESS_CONTROL_ALLOW_METHO; - - default: - return -1; } ACCESS_CONTROL_ALLOW_METHO: NEXT_CHAR(); switch (ch) { - - case 'D': - if (last) { - return -1; - } - goto ACCESS_CONTROL_ALLOW_METHOD; - - - case 'd': - if (last) { + case 'D': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_METHOD; + case 'd': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_METHOD; + default: return -1; - } - goto ACCESS_CONTROL_ALLOW_METHOD; - - default: - return -1; } ACCESS_CONTROL_ALLOW_METHOD: NEXT_CHAR(); switch (ch) { - - case 'S': - if (last) { - return 7; - } - goto ACCESS_CONTROL_ALLOW_METHODS; - - - case 's': - if (last) { - return 7; - } - goto ACCESS_CONTROL_ALLOW_METHODS; - - default: - return -1; + case 'S': + if (last) { + return 7; + } + goto ACCESS_CONTROL_ALLOW_METHODS; + case 's': + if (last) { + return 7; + } + goto ACCESS_CONTROL_ALLOW_METHODS; + default: + return -1; } ACCESS_CONTROL_ALLOW_METHODS: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } ACCESS_CONTROL_ALLOW_O: NEXT_CHAR(); switch (ch) { - - case 'R': - if (last) { + case 'R': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_OR; + case 'r': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_OR; + default: return -1; - } - goto ACCESS_CONTROL_ALLOW_OR; - - - case 'r': - if (last) { - return -1; - } - goto ACCESS_CONTROL_ALLOW_OR; - - default: - return -1; } ACCESS_CONTROL_ALLOW_OR: NEXT_CHAR(); switch (ch) { - - case 'I': - if (last) { - return -1; - } - goto ACCESS_CONTROL_ALLOW_ORI; - - - case 'i': - if (last) { + case 'I': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_ORI; + case 'i': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_ORI; + default: return -1; - } - goto ACCESS_CONTROL_ALLOW_ORI; - - default: - return -1; } ACCESS_CONTROL_ALLOW_ORI: NEXT_CHAR(); switch (ch) { - - case 'G': - if (last) { - return -1; - } - goto ACCESS_CONTROL_ALLOW_ORIG; - - - case 'g': - if (last) { + case 'G': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_ORIG; + case 'g': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_ORIG; + default: return -1; - } - goto ACCESS_CONTROL_ALLOW_ORIG; - - default: - return -1; } ACCESS_CONTROL_ALLOW_ORIG: NEXT_CHAR(); switch (ch) { - - case 'I': - if (last) { - return -1; - } - goto ACCESS_CONTROL_ALLOW_ORIGI; - - - case 'i': - if (last) { + case 'I': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_ORIGI; + case 'i': + if (last) { + return -1; + } + goto ACCESS_CONTROL_ALLOW_ORIGI; + default: return -1; - } - goto ACCESS_CONTROL_ALLOW_ORIGI; - - default: - return -1; } ACCESS_CONTROL_ALLOW_ORIGI: NEXT_CHAR(); switch (ch) { - - case 'N': - if (last) { - return 8; - } - goto ACCESS_CONTROL_ALLOW_ORIGIN; - - - case 'n': - if (last) { - return 8; - } - goto ACCESS_CONTROL_ALLOW_ORIGIN; - - default: - return -1; + case 'N': + if (last) { + return 8; + } + goto ACCESS_CONTROL_ALLOW_ORIGIN; + case 'n': + if (last) { + return 8; + } + goto ACCESS_CONTROL_ALLOW_ORIGIN; + default: + return -1; } ACCESS_CONTROL_ALLOW_ORIGIN: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } ACCESS_CONTROL_E: NEXT_CHAR(); switch (ch) { - - case 'X': - if (last) { - return -1; - } - goto ACCESS_CONTROL_EX; - - - case 'x': - if (last) { + case 'X': + if (last) { + return -1; + } + goto ACCESS_CONTROL_EX; + case 'x': + if (last) { + return -1; + } + goto ACCESS_CONTROL_EX; + default: return -1; - } - goto ACCESS_CONTROL_EX; - - default: - return -1; } ACCESS_CONTROL_EX: NEXT_CHAR(); switch (ch) { - - case 'P': - if (last) { - return -1; - } - goto ACCESS_CONTROL_EXP; - - - case 'p': - if (last) { + case 'P': + if (last) { + return -1; + } + goto ACCESS_CONTROL_EXP; + case 'p': + if (last) { + return -1; + } + goto ACCESS_CONTROL_EXP; + default: return -1; - } - goto ACCESS_CONTROL_EXP; - - default: - return -1; } ACCESS_CONTROL_EXP: NEXT_CHAR(); switch (ch) { - - case 'O': - if (last) { + case 'O': + if (last) { + return -1; + } + goto ACCESS_CONTROL_EXPO; + case 'o': + if (last) { + return -1; + } + goto ACCESS_CONTROL_EXPO; + default: return -1; - } - goto ACCESS_CONTROL_EXPO; - - - case 'o': - if (last) { - return -1; - } - goto ACCESS_CONTROL_EXPO; - - default: - return -1; } ACCESS_CONTROL_EXPO: NEXT_CHAR(); switch (ch) { - - case 'S': - if (last) { - return -1; - } - goto ACCESS_CONTROL_EXPOS; - - - case 's': - if (last) { + case 'S': + if (last) { + return -1; + } + goto ACCESS_CONTROL_EXPOS; + case 's': + if (last) { + return -1; + } + goto ACCESS_CONTROL_EXPOS; + default: return -1; - } - goto ACCESS_CONTROL_EXPOS; - - default: - return -1; } ACCESS_CONTROL_EXPOS: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return -1; - } - goto ACCESS_CONTROL_EXPOSE; - - - case 'e': - if (last) { + case 'E': + if (last) { + return -1; + } + goto ACCESS_CONTROL_EXPOSE; + case 'e': + if (last) { + return -1; + } + goto ACCESS_CONTROL_EXPOSE; + default: return -1; - } - goto ACCESS_CONTROL_EXPOSE; - - default: - return -1; } ACCESS_CONTROL_EXPOSE: NEXT_CHAR(); switch (ch) { - - case '-': - if (last) { + case '-': + if (last) { + return -1; + } + goto ACCESS_CONTROL_EXPOSE_; + default: return -1; - } - goto ACCESS_CONTROL_EXPOSE_; - - default: - return -1; } ACCESS_CONTROL_EXPOSE_: NEXT_CHAR(); switch (ch) { - - case 'H': - if (last) { - return -1; - } - goto ACCESS_CONTROL_EXPOSE_H; - - - case 'h': - if (last) { + case 'H': + if (last) { + return -1; + } + goto ACCESS_CONTROL_EXPOSE_H; + case 'h': + if (last) { + return -1; + } + goto ACCESS_CONTROL_EXPOSE_H; + default: return -1; - } - goto ACCESS_CONTROL_EXPOSE_H; - - default: - return -1; } -ACCESS_CONTROL_EXPOSE_H: - NEXT_CHAR(); - switch (ch) { - - case 'E': - if (last) { - return -1; - } - goto ACCESS_CONTROL_EXPOSE_HE; - - - case 'e': - if (last) { +ACCESS_CONTROL_EXPOSE_H: + NEXT_CHAR(); + switch (ch) { + case 'E': + if (last) { + return -1; + } + goto ACCESS_CONTROL_EXPOSE_HE; + case 'e': + if (last) { + return -1; + } + goto ACCESS_CONTROL_EXPOSE_HE; + default: return -1; - } - goto ACCESS_CONTROL_EXPOSE_HE; - - default: - return -1; } ACCESS_CONTROL_EXPOSE_HE: NEXT_CHAR(); switch (ch) { - - case 'A': - if (last) { - return -1; - } - goto ACCESS_CONTROL_EXPOSE_HEA; - - - case 'a': - if (last) { + case 'A': + if (last) { + return -1; + } + goto ACCESS_CONTROL_EXPOSE_HEA; + case 'a': + if (last) { + return -1; + } + goto ACCESS_CONTROL_EXPOSE_HEA; + default: return -1; - } - goto ACCESS_CONTROL_EXPOSE_HEA; - - default: - return -1; } ACCESS_CONTROL_EXPOSE_HEA: NEXT_CHAR(); switch (ch) { - - case 'D': - if (last) { - return -1; - } - goto ACCESS_CONTROL_EXPOSE_HEAD; - - - case 'd': - if (last) { + case 'D': + if (last) { + return -1; + } + goto ACCESS_CONTROL_EXPOSE_HEAD; + case 'd': + if (last) { + return -1; + } + goto ACCESS_CONTROL_EXPOSE_HEAD; + default: return -1; - } - goto ACCESS_CONTROL_EXPOSE_HEAD; - - default: - return -1; } ACCESS_CONTROL_EXPOSE_HEAD: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return -1; - } - goto ACCESS_CONTROL_EXPOSE_HEADE; - - - case 'e': - if (last) { + case 'E': + if (last) { + return -1; + } + goto ACCESS_CONTROL_EXPOSE_HEADE; + case 'e': + if (last) { + return -1; + } + goto ACCESS_CONTROL_EXPOSE_HEADE; + default: return -1; - } - goto ACCESS_CONTROL_EXPOSE_HEADE; - - default: - return -1; } ACCESS_CONTROL_EXPOSE_HEADE: NEXT_CHAR(); switch (ch) { - - case 'R': - if (last) { + case 'R': + if (last) { + return -1; + } + goto ACCESS_CONTROL_EXPOSE_HEADER; + case 'r': + if (last) { + return -1; + } + goto ACCESS_CONTROL_EXPOSE_HEADER; + default: return -1; - } - goto ACCESS_CONTROL_EXPOSE_HEADER; - - - case 'r': - if (last) { - return -1; - } - goto ACCESS_CONTROL_EXPOSE_HEADER; - - default: - return -1; } ACCESS_CONTROL_EXPOSE_HEADER: NEXT_CHAR(); switch (ch) { - - case 'S': - if (last) { - return 9; - } - goto ACCESS_CONTROL_EXPOSE_HEADERS; - - - case 's': - if (last) { - return 9; - } - goto ACCESS_CONTROL_EXPOSE_HEADERS; - - default: - return -1; + case 'S': + if (last) { + return 9; + } + goto ACCESS_CONTROL_EXPOSE_HEADERS; + case 's': + if (last) { + return 9; + } + goto ACCESS_CONTROL_EXPOSE_HEADERS; + default: + return -1; } ACCESS_CONTROL_EXPOSE_HEADERS: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } ACCESS_CONTROL_M: NEXT_CHAR(); switch (ch) { - - case 'A': - if (last) { - return -1; - } - goto ACCESS_CONTROL_MA; - - - case 'a': - if (last) { + case 'A': + if (last) { + return -1; + } + goto ACCESS_CONTROL_MA; + case 'a': + if (last) { + return -1; + } + goto ACCESS_CONTROL_MA; + default: return -1; - } - goto ACCESS_CONTROL_MA; - - default: - return -1; } ACCESS_CONTROL_MA: NEXT_CHAR(); switch (ch) { - - case 'X': - if (last) { + case 'X': + if (last) { + return -1; + } + goto ACCESS_CONTROL_MAX; + case 'x': + if (last) { + return -1; + } + goto ACCESS_CONTROL_MAX; + default: return -1; - } - goto ACCESS_CONTROL_MAX; - - - case 'x': - if (last) { - return -1; - } - goto ACCESS_CONTROL_MAX; - - default: - return -1; } ACCESS_CONTROL_MAX: NEXT_CHAR(); switch (ch) { - - case '-': - if (last) { + case '-': + if (last) { + return -1; + } + goto ACCESS_CONTROL_MAX_; + default: return -1; - } - goto ACCESS_CONTROL_MAX_; - - default: - return -1; } ACCESS_CONTROL_MAX_: NEXT_CHAR(); switch (ch) { - - case 'A': - if (last) { - return -1; - } - goto ACCESS_CONTROL_MAX_A; - - - case 'a': - if (last) { + case 'A': + if (last) { + return -1; + } + goto ACCESS_CONTROL_MAX_A; + case 'a': + if (last) { + return -1; + } + goto ACCESS_CONTROL_MAX_A; + default: return -1; - } - goto ACCESS_CONTROL_MAX_A; - - default: - return -1; } ACCESS_CONTROL_MAX_A: NEXT_CHAR(); switch (ch) { - - case 'G': - if (last) { + case 'G': + if (last) { + return -1; + } + goto ACCESS_CONTROL_MAX_AG; + case 'g': + if (last) { + return -1; + } + goto ACCESS_CONTROL_MAX_AG; + default: return -1; - } - goto ACCESS_CONTROL_MAX_AG; - - - case 'g': - if (last) { - return -1; - } - goto ACCESS_CONTROL_MAX_AG; - - default: - return -1; } ACCESS_CONTROL_MAX_AG: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return 10; - } - goto ACCESS_CONTROL_MAX_AGE; - - - case 'e': - if (last) { - return 10; - } - goto ACCESS_CONTROL_MAX_AGE; - - default: - return -1; + case 'E': + if (last) { + return 10; + } + goto ACCESS_CONTROL_MAX_AGE; + case 'e': + if (last) { + return 10; + } + goto ACCESS_CONTROL_MAX_AGE; + default: + return -1; } ACCESS_CONTROL_MAX_AGE: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } ACCESS_CONTROL_R: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return -1; - } - goto ACCESS_CONTROL_RE; - - - case 'e': - if (last) { + case 'E': + if (last) { + return -1; + } + goto ACCESS_CONTROL_RE; + case 'e': + if (last) { + return -1; + } + goto ACCESS_CONTROL_RE; + default: return -1; - } - goto ACCESS_CONTROL_RE; - - default: - return -1; } ACCESS_CONTROL_RE: NEXT_CHAR(); switch (ch) { - - case 'Q': - if (last) { + case 'Q': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQ; + case 'q': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQ; + default: return -1; - } - goto ACCESS_CONTROL_REQ; - - - case 'q': - if (last) { - return -1; - } - goto ACCESS_CONTROL_REQ; - - default: - return -1; } ACCESS_CONTROL_REQ: NEXT_CHAR(); switch (ch) { - - case 'U': - if (last) { - return -1; - } - goto ACCESS_CONTROL_REQU; - - - case 'u': - if (last) { + case 'U': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQU; + case 'u': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQU; + default: return -1; - } - goto ACCESS_CONTROL_REQU; - - default: - return -1; } ACCESS_CONTROL_REQU: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return -1; - } - goto ACCESS_CONTROL_REQUE; - - - case 'e': - if (last) { + case 'E': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUE; + case 'e': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUE; + default: return -1; - } - goto ACCESS_CONTROL_REQUE; - - default: - return -1; } ACCESS_CONTROL_REQUE: NEXT_CHAR(); switch (ch) { - - case 'S': - if (last) { - return -1; - } - goto ACCESS_CONTROL_REQUES; - - - case 's': - if (last) { + case 'S': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUES; + case 's': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUES; + default: return -1; - } - goto ACCESS_CONTROL_REQUES; - - default: - return -1; } ACCESS_CONTROL_REQUES: NEXT_CHAR(); switch (ch) { - - case 'T': - if (last) { + case 'T': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUEST; + case 't': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUEST; + default: return -1; - } - goto ACCESS_CONTROL_REQUEST; - - - case 't': - if (last) { - return -1; - } - goto ACCESS_CONTROL_REQUEST; - - default: - return -1; } ACCESS_CONTROL_REQUEST: NEXT_CHAR(); switch (ch) { - - case '-': - if (last) { + case '-': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUEST_; + default: return -1; - } - goto ACCESS_CONTROL_REQUEST_; - - default: - return -1; } ACCESS_CONTROL_REQUEST_: NEXT_CHAR(); switch (ch) { - - case 'H': - if (last) { - return -1; - } - goto ACCESS_CONTROL_REQUEST_H; - - - case 'h': - if (last) { - return -1; - } - goto ACCESS_CONTROL_REQUEST_H; - - - case 'M': - if (last) { - return -1; - } - goto ACCESS_CONTROL_REQUEST_M; - - - case 'm': - if (last) { + case 'H': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUEST_H; + case 'h': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUEST_H; + case 'M': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUEST_M; + case 'm': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUEST_M; + default: return -1; - } - goto ACCESS_CONTROL_REQUEST_M; - - default: - return -1; } ACCESS_CONTROL_REQUEST_H: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return -1; - } - goto ACCESS_CONTROL_REQUEST_HE; - - - case 'e': - if (last) { + case 'E': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUEST_HE; + case 'e': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUEST_HE; + default: return -1; - } - goto ACCESS_CONTROL_REQUEST_HE; - - default: - return -1; } ACCESS_CONTROL_REQUEST_HE: NEXT_CHAR(); switch (ch) { - - case 'A': - if (last) { - return -1; - } - goto ACCESS_CONTROL_REQUEST_HEA; - - - case 'a': - if (last) { + case 'A': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUEST_HEA; + case 'a': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUEST_HEA; + default: return -1; - } - goto ACCESS_CONTROL_REQUEST_HEA; - - default: - return -1; } ACCESS_CONTROL_REQUEST_HEA: NEXT_CHAR(); switch (ch) { - - case 'D': - if (last) { + case 'D': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUEST_HEAD; + case 'd': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUEST_HEAD; + default: return -1; - } - goto ACCESS_CONTROL_REQUEST_HEAD; - - - case 'd': - if (last) { - return -1; - } - goto ACCESS_CONTROL_REQUEST_HEAD; - - default: - return -1; } ACCESS_CONTROL_REQUEST_HEAD: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return -1; - } - goto ACCESS_CONTROL_REQUEST_HEADE; - - - case 'e': - if (last) { + case 'E': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUEST_HEADE; + case 'e': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUEST_HEADE; + default: return -1; - } - goto ACCESS_CONTROL_REQUEST_HEADE; - - default: - return -1; } ACCESS_CONTROL_REQUEST_HEADE: NEXT_CHAR(); switch (ch) { - - case 'R': - if (last) { - return -1; - } - goto ACCESS_CONTROL_REQUEST_HEADER; - - - case 'r': - if (last) { + case 'R': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUEST_HEADER; + case 'r': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUEST_HEADER; + default: return -1; - } - goto ACCESS_CONTROL_REQUEST_HEADER; - - default: - return -1; } ACCESS_CONTROL_REQUEST_HEADER: NEXT_CHAR(); switch (ch) { - - case 'S': - if (last) { - return 11; - } - goto ACCESS_CONTROL_REQUEST_HEADERS; - - - case 's': - if (last) { - return 11; - } - goto ACCESS_CONTROL_REQUEST_HEADERS; - - default: - return -1; + case 'S': + if (last) { + return 11; + } + goto ACCESS_CONTROL_REQUEST_HEADERS; + case 's': + if (last) { + return 11; + } + goto ACCESS_CONTROL_REQUEST_HEADERS; + default: + return -1; } ACCESS_CONTROL_REQUEST_HEADERS: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } ACCESS_CONTROL_REQUEST_M: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return -1; - } - goto ACCESS_CONTROL_REQUEST_ME; - - - case 'e': - if (last) { + case 'E': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUEST_ME; + case 'e': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUEST_ME; + default: return -1; - } - goto ACCESS_CONTROL_REQUEST_ME; - - default: - return -1; } ACCESS_CONTROL_REQUEST_ME: NEXT_CHAR(); switch (ch) { - - case 'T': - if (last) { - return -1; - } - goto ACCESS_CONTROL_REQUEST_MET; - - - case 't': - if (last) { + case 'T': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUEST_MET; + case 't': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUEST_MET; + default: return -1; - } - goto ACCESS_CONTROL_REQUEST_MET; - - default: - return -1; } ACCESS_CONTROL_REQUEST_MET: NEXT_CHAR(); switch (ch) { - - case 'H': - if (last) { - return -1; - } - goto ACCESS_CONTROL_REQUEST_METH; - - - case 'h': - if (last) { + case 'H': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUEST_METH; + case 'h': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUEST_METH; + default: return -1; - } - goto ACCESS_CONTROL_REQUEST_METH; - - default: - return -1; } ACCESS_CONTROL_REQUEST_METH: NEXT_CHAR(); switch (ch) { - - case 'O': - if (last) { + case 'O': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUEST_METHO; + case 'o': + if (last) { + return -1; + } + goto ACCESS_CONTROL_REQUEST_METHO; + default: return -1; - } - goto ACCESS_CONTROL_REQUEST_METHO; - - - case 'o': - if (last) { - return -1; - } - goto ACCESS_CONTROL_REQUEST_METHO; - - default: - return -1; } ACCESS_CONTROL_REQUEST_METHO: NEXT_CHAR(); switch (ch) { - - case 'D': - if (last) { - return 12; - } - goto ACCESS_CONTROL_REQUEST_METHOD; - - - case 'd': - if (last) { - return 12; - } - goto ACCESS_CONTROL_REQUEST_METHOD; - - default: - return -1; + case 'D': + if (last) { + return 12; + } + goto ACCESS_CONTROL_REQUEST_METHOD; + case 'd': + if (last) { + return 12; + } + goto ACCESS_CONTROL_REQUEST_METHOD; + default: + return -1; } ACCESS_CONTROL_REQUEST_METHOD: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } AG: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return 13; - } - goto AGE; - - - case 'e': - if (last) { - return 13; - } - goto AGE; - - default: - return -1; + case 'E': + if (last) { + return 13; + } + goto AGE; + case 'e': + if (last) { + return 13; + } + goto AGE; + default: + return -1; } AGE: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } AL: NEXT_CHAR(); switch (ch) { - - case 'L': - if (last) { - return -1; - } - goto ALL; - - - case 'l': - if (last) { + case 'L': + if (last) { + return -1; + } + goto ALL; + case 'l': + if (last) { + return -1; + } + goto ALL; + default: return -1; - } - goto ALL; - - default: - return -1; } ALL: NEXT_CHAR(); switch (ch) { - - case 'O': - if (last) { - return -1; - } - goto ALLO; - - - case 'o': - if (last) { + case 'O': + if (last) { + return -1; + } + goto ALLO; + case 'o': + if (last) { + return -1; + } + goto ALLO; + default: return -1; - } - goto ALLO; - - default: - return -1; } ALLO: NEXT_CHAR(); switch (ch) { - - case 'W': - if (last) { - return 14; - } - goto ALLOW; - - - case 'w': - if (last) { - return 14; - } - goto ALLOW; - - default: - return -1; + case 'W': + if (last) { + return 14; + } + goto ALLOW; + case 'w': + if (last) { + return 14; + } + goto ALLOW; + default: + return -1; } ALLOW: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } AU: NEXT_CHAR(); switch (ch) { - - case 'T': - if (last) { - return -1; - } - goto AUT; - - - case 't': - if (last) { + case 'T': + if (last) { + return -1; + } + goto AUT; + case 't': + if (last) { + return -1; + } + goto AUT; + default: return -1; - } - goto AUT; - - default: - return -1; } AUT: NEXT_CHAR(); switch (ch) { - - case 'H': - if (last) { - return -1; - } - goto AUTH; - - - case 'h': - if (last) { + case 'H': + if (last) { + return -1; + } + goto AUTH; + case 'h': + if (last) { + return -1; + } + goto AUTH; + default: return -1; - } - goto AUTH; - - default: - return -1; } AUTH: NEXT_CHAR(); switch (ch) { - - case 'O': - if (last) { - return -1; - } - goto AUTHO; - - - case 'o': - if (last) { + case 'O': + if (last) { + return -1; + } + goto AUTHO; + case 'o': + if (last) { + return -1; + } + goto AUTHO; + default: return -1; - } - goto AUTHO; - - default: - return -1; } AUTHO: NEXT_CHAR(); switch (ch) { - - case 'R': - if (last) { + case 'R': + if (last) { + return -1; + } + goto AUTHOR; + case 'r': + if (last) { + return -1; + } + goto AUTHOR; + default: return -1; - } - goto AUTHOR; - - - case 'r': - if (last) { - return -1; - } - goto AUTHOR; - - default: - return -1; } AUTHOR: NEXT_CHAR(); switch (ch) { - - case 'I': - if (last) { - return -1; - } - goto AUTHORI; - - - case 'i': - if (last) { + case 'I': + if (last) { + return -1; + } + goto AUTHORI; + case 'i': + if (last) { + return -1; + } + goto AUTHORI; + default: return -1; - } - goto AUTHORI; - - default: - return -1; } AUTHORI: NEXT_CHAR(); switch (ch) { - - case 'Z': - if (last) { - return -1; - } - goto AUTHORIZ; - - - case 'z': - if (last) { + case 'Z': + if (last) { + return -1; + } + goto AUTHORIZ; + case 'z': + if (last) { + return -1; + } + goto AUTHORIZ; + default: return -1; - } - goto AUTHORIZ; - - default: - return -1; } AUTHORIZ: NEXT_CHAR(); switch (ch) { - - case 'A': - if (last) { - return -1; - } - goto AUTHORIZA; - - - case 'a': - if (last) { + case 'A': + if (last) { + return -1; + } + goto AUTHORIZA; + case 'a': + if (last) { + return -1; + } + goto AUTHORIZA; + default: return -1; - } - goto AUTHORIZA; - - default: - return -1; } AUTHORIZA: NEXT_CHAR(); switch (ch) { - - case 'T': - if (last) { + case 'T': + if (last) { + return -1; + } + goto AUTHORIZAT; + case 't': + if (last) { + return -1; + } + goto AUTHORIZAT; + default: return -1; - } - goto AUTHORIZAT; - - - case 't': - if (last) { - return -1; - } - goto AUTHORIZAT; - - default: - return -1; } AUTHORIZAT: NEXT_CHAR(); switch (ch) { - - case 'I': - if (last) { - return -1; - } - goto AUTHORIZATI; - - - case 'i': - if (last) { + case 'I': + if (last) { + return -1; + } + goto AUTHORIZATI; + case 'i': + if (last) { + return -1; + } + goto AUTHORIZATI; + default: return -1; - } - goto AUTHORIZATI; - - default: - return -1; } AUTHORIZATI: NEXT_CHAR(); switch (ch) { - - case 'O': - if (last) { - return -1; - } - goto AUTHORIZATIO; - - - case 'o': - if (last) { + case 'O': + if (last) { + return -1; + } + goto AUTHORIZATIO; + case 'o': + if (last) { + return -1; + } + goto AUTHORIZATIO; + default: return -1; - } - goto AUTHORIZATIO; - - default: - return -1; } AUTHORIZATIO: NEXT_CHAR(); switch (ch) { - - case 'N': - if (last) { - return 15; - } - goto AUTHORIZATION; - - - case 'n': - if (last) { - return 15; - } - goto AUTHORIZATION; - - default: - return -1; + case 'N': + if (last) { + return 15; + } + goto AUTHORIZATION; + case 'n': + if (last) { + return 15; + } + goto AUTHORIZATION; + default: + return -1; } AUTHORIZATION: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } C: NEXT_CHAR(); switch (ch) { - - case 'A': - if (last) { - return -1; - } - goto CA; - - - case 'a': - if (last) { + case 'A': + if (last) { + return -1; + } + goto CA; + case 'a': + if (last) { + return -1; + } + goto CA; + case 'O': + if (last) { + return -1; + } + goto CO; + case 'o': + if (last) { + return -1; + } + goto CO; + default: return -1; - } - goto CA; - - - case 'O': - if (last) { - return -1; - } - goto CO; - - - case 'o': - if (last) { - return -1; - } - goto CO; - - default: - return -1; } CA: NEXT_CHAR(); switch (ch) { - - case 'C': - if (last) { + case 'C': + if (last) { + return -1; + } + goto CAC; + case 'c': + if (last) { + return -1; + } + goto CAC; + default: return -1; - } - goto CAC; - - - case 'c': - if (last) { - return -1; - } - goto CAC; - - default: - return -1; } CAC: NEXT_CHAR(); switch (ch) { - - case 'H': - if (last) { - return -1; - } - goto CACH; - - - case 'h': - if (last) { + case 'H': + if (last) { + return -1; + } + goto CACH; + case 'h': + if (last) { + return -1; + } + goto CACH; + default: return -1; - } - goto CACH; - - default: - return -1; } CACH: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return -1; - } - goto CACHE; - - - case 'e': - if (last) { + case 'E': + if (last) { + return -1; + } + goto CACHE; + case 'e': + if (last) { + return -1; + } + goto CACHE; + default: return -1; - } - goto CACHE; - - default: - return -1; } CACHE: NEXT_CHAR(); switch (ch) { - - case '-': - if (last) { + case '-': + if (last) { + return -1; + } + goto CACHE_; + default: return -1; - } - goto CACHE_; - - default: - return -1; } CACHE_: NEXT_CHAR(); switch (ch) { - - case 'C': - if (last) { - return -1; - } - goto CACHE_C; - - - case 'c': - if (last) { + case 'C': + if (last) { + return -1; + } + goto CACHE_C; + case 'c': + if (last) { + return -1; + } + goto CACHE_C; + default: return -1; - } - goto CACHE_C; - - default: - return -1; } CACHE_C: NEXT_CHAR(); switch (ch) { - - case 'O': - if (last) { - return -1; - } - goto CACHE_CO; - - - case 'o': - if (last) { + case 'O': + if (last) { + return -1; + } + goto CACHE_CO; + case 'o': + if (last) { + return -1; + } + goto CACHE_CO; + default: return -1; - } - goto CACHE_CO; - - default: - return -1; } CACHE_CO: NEXT_CHAR(); switch (ch) { - - case 'N': - if (last) { - return -1; - } - goto CACHE_CON; - - - case 'n': - if (last) { + case 'N': + if (last) { + return -1; + } + goto CACHE_CON; + case 'n': + if (last) { + return -1; + } + goto CACHE_CON; + default: return -1; - } - goto CACHE_CON; - - default: - return -1; } CACHE_CON: NEXT_CHAR(); switch (ch) { - - case 'T': - if (last) { + case 'T': + if (last) { + return -1; + } + goto CACHE_CONT; + case 't': + if (last) { + return -1; + } + goto CACHE_CONT; + default: return -1; - } - goto CACHE_CONT; - - - case 't': - if (last) { - return -1; - } - goto CACHE_CONT; - - default: - return -1; } CACHE_CONT: NEXT_CHAR(); switch (ch) { - - case 'R': - if (last) { - return -1; - } - goto CACHE_CONTR; - - - case 'r': - if (last) { + case 'R': + if (last) { + return -1; + } + goto CACHE_CONTR; + case 'r': + if (last) { + return -1; + } + goto CACHE_CONTR; + default: return -1; - } - goto CACHE_CONTR; - - default: - return -1; } CACHE_CONTR: NEXT_CHAR(); switch (ch) { - - case 'O': - if (last) { - return -1; - } - goto CACHE_CONTRO; - - - case 'o': - if (last) { + case 'O': + if (last) { + return -1; + } + goto CACHE_CONTRO; + case 'o': + if (last) { + return -1; + } + goto CACHE_CONTRO; + default: return -1; - } - goto CACHE_CONTRO; - - default: - return -1; } CACHE_CONTRO: NEXT_CHAR(); switch (ch) { - - case 'L': - if (last) { - return 16; - } - goto CACHE_CONTROL; - - - case 'l': - if (last) { - return 16; - } - goto CACHE_CONTROL; - - default: - return -1; + case 'L': + if (last) { + return 16; + } + goto CACHE_CONTROL; + case 'l': + if (last) { + return 16; + } + goto CACHE_CONTROL; + default: + return -1; } CACHE_CONTROL: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } CO: NEXT_CHAR(); switch (ch) { - - case 'N': - if (last) { - return -1; - } - goto CON; - - - case 'n': - if (last) { + case 'N': + if (last) { + return -1; + } + goto CON; + case 'n': + if (last) { + return -1; + } + goto CON; + case 'O': + if (last) { + return -1; + } + goto COO; + case 'o': + if (last) { + return -1; + } + goto COO; + default: return -1; - } - goto CON; - - - case 'O': - if (last) { - return -1; - } - goto COO; - - - case 'o': - if (last) { - return -1; - } - goto COO; - - default: - return -1; } CON: NEXT_CHAR(); switch (ch) { - - case 'N': - if (last) { - return -1; - } - goto CONN; - - - case 'n': - if (last) { - return -1; - } - goto CONN; - - - case 'T': - if (last) { - return -1; - } - goto CONT; - - - case 't': - if (last) { + case 'N': + if (last) { + return -1; + } + goto CONN; + case 'n': + if (last) { + return -1; + } + goto CONN; + case 'T': + if (last) { + return -1; + } + goto CONT; + case 't': + if (last) { + return -1; + } + goto CONT; + default: return -1; - } - goto CONT; - - default: - return -1; } CONN: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return -1; - } - goto CONNE; - - - case 'e': - if (last) { + case 'E': + if (last) { + return -1; + } + goto CONNE; + case 'e': + if (last) { + return -1; + } + goto CONNE; + default: return -1; - } - goto CONNE; - - default: - return -1; } CONNE: NEXT_CHAR(); switch (ch) { - - case 'C': - if (last) { + case 'C': + if (last) { + return -1; + } + goto CONNEC; + case 'c': + if (last) { + return -1; + } + goto CONNEC; + default: return -1; - } - goto CONNEC; - - - case 'c': - if (last) { - return -1; - } - goto CONNEC; - - default: - return -1; } CONNEC: NEXT_CHAR(); switch (ch) { - - case 'T': - if (last) { - return -1; - } - goto CONNECT; - - - case 't': - if (last) { + case 'T': + if (last) { + return -1; + } + goto CONNECT; + case 't': + if (last) { + return -1; + } + goto CONNECT; + default: return -1; - } - goto CONNECT; - - default: - return -1; } CONNECT: NEXT_CHAR(); switch (ch) { - - case 'I': - if (last) { - return -1; - } - goto CONNECTI; - - - case 'i': - if (last) { + case 'I': + if (last) { + return -1; + } + goto CONNECTI; + case 'i': + if (last) { + return -1; + } + goto CONNECTI; + default: return -1; - } - goto CONNECTI; - - default: - return -1; } CONNECTI: NEXT_CHAR(); switch (ch) { - - case 'O': - if (last) { - return -1; - } - goto CONNECTIO; - - - case 'o': - if (last) { + case 'O': + if (last) { + return -1; + } + goto CONNECTIO; + case 'o': + if (last) { + return -1; + } + goto CONNECTIO; + default: return -1; - } - goto CONNECTIO; - - default: - return -1; } CONNECTIO: NEXT_CHAR(); switch (ch) { - - case 'N': - if (last) { - return 17; - } - goto CONNECTION; - - - case 'n': - if (last) { - return 17; - } - goto CONNECTION; - - default: - return -1; + case 'N': + if (last) { + return 17; + } + goto CONNECTION; + case 'n': + if (last) { + return 17; + } + goto CONNECTION; + default: + return -1; } CONNECTION: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } CONT: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return -1; - } - goto CONTE; - - - case 'e': - if (last) { + case 'E': + if (last) { + return -1; + } + goto CONTE; + case 'e': + if (last) { + return -1; + } + goto CONTE; + default: return -1; - } - goto CONTE; - - default: - return -1; } CONTE: NEXT_CHAR(); switch (ch) { - - case 'N': - if (last) { - return -1; - } - goto CONTEN; - - - case 'n': - if (last) { + case 'N': + if (last) { + return -1; + } + goto CONTEN; + case 'n': + if (last) { + return -1; + } + goto CONTEN; + default: return -1; - } - goto CONTEN; - - default: - return -1; } CONTEN: NEXT_CHAR(); switch (ch) { - - case 'T': - if (last) { + case 'T': + if (last) { + return -1; + } + goto CONTENT; + case 't': + if (last) { + return -1; + } + goto CONTENT; + default: return -1; - } - goto CONTENT; - - - case 't': - if (last) { - return -1; - } - goto CONTENT; - - default: - return -1; } CONTENT: NEXT_CHAR(); switch (ch) { - - case '-': - if (last) { + case '-': + if (last) { + return -1; + } + goto CONTENT_; + default: return -1; - } - goto CONTENT_; - - default: - return -1; } CONTENT_: NEXT_CHAR(); switch (ch) { - - case 'D': - if (last) { - return -1; - } - goto CONTENT_D; - - - case 'd': - if (last) { - return -1; - } - goto CONTENT_D; - - - case 'E': - if (last) { - return -1; - } - goto CONTENT_E; - - - case 'e': - if (last) { - return -1; - } - goto CONTENT_E; - - - case 'L': - if (last) { - return -1; - } - goto CONTENT_L; - - - case 'l': - if (last) { - return -1; - } - goto CONTENT_L; - - - case 'M': - if (last) { - return -1; - } - goto CONTENT_M; - - - case 'm': - if (last) { - return -1; - } - goto CONTENT_M; - - - case 'R': - if (last) { - return -1; - } - goto CONTENT_R; - - - case 'r': - if (last) { - return -1; - } - goto CONTENT_R; - - - case 'T': - if (last) { - return -1; - } - goto CONTENT_T; - - - case 't': - if (last) { + case 'D': + if (last) { + return -1; + } + goto CONTENT_D; + case 'd': + if (last) { + return -1; + } + goto CONTENT_D; + case 'E': + if (last) { + return -1; + } + goto CONTENT_E; + case 'e': + if (last) { + return -1; + } + goto CONTENT_E; + case 'L': + if (last) { + return -1; + } + goto CONTENT_L; + case 'l': + if (last) { + return -1; + } + goto CONTENT_L; + case 'M': + if (last) { + return -1; + } + goto CONTENT_M; + case 'm': + if (last) { + return -1; + } + goto CONTENT_M; + case 'R': + if (last) { + return -1; + } + goto CONTENT_R; + case 'r': + if (last) { + return -1; + } + goto CONTENT_R; + case 'T': + if (last) { + return -1; + } + goto CONTENT_T; + case 't': + if (last) { + return -1; + } + goto CONTENT_T; + default: return -1; - } - goto CONTENT_T; - - default: - return -1; } CONTENT_D: NEXT_CHAR(); switch (ch) { - - case 'I': - if (last) { - return -1; - } - goto CONTENT_DI; - - - case 'i': - if (last) { + case 'I': + if (last) { + return -1; + } + goto CONTENT_DI; + case 'i': + if (last) { + return -1; + } + goto CONTENT_DI; + default: return -1; - } - goto CONTENT_DI; - - default: - return -1; } CONTENT_DI: NEXT_CHAR(); switch (ch) { - - case 'S': - if (last) { - return -1; - } - goto CONTENT_DIS; - - - case 's': - if (last) { + case 'S': + if (last) { + return -1; + } + goto CONTENT_DIS; + case 's': + if (last) { + return -1; + } + goto CONTENT_DIS; + default: return -1; - } - goto CONTENT_DIS; - - default: - return -1; } CONTENT_DIS: NEXT_CHAR(); switch (ch) { - - case 'P': - if (last) { + case 'P': + if (last) { + return -1; + } + goto CONTENT_DISP; + case 'p': + if (last) { + return -1; + } + goto CONTENT_DISP; + default: return -1; - } - goto CONTENT_DISP; - - - case 'p': - if (last) { - return -1; - } - goto CONTENT_DISP; - - default: - return -1; } CONTENT_DISP: NEXT_CHAR(); switch (ch) { - - case 'O': - if (last) { - return -1; - } - goto CONTENT_DISPO; - - - case 'o': - if (last) { + case 'O': + if (last) { + return -1; + } + goto CONTENT_DISPO; + case 'o': + if (last) { + return -1; + } + goto CONTENT_DISPO; + default: return -1; - } - goto CONTENT_DISPO; - - default: - return -1; } CONTENT_DISPO: NEXT_CHAR(); switch (ch) { - - case 'S': - if (last) { - return -1; - } - goto CONTENT_DISPOS; - - - case 's': - if (last) { + case 'S': + if (last) { + return -1; + } + goto CONTENT_DISPOS; + case 's': + if (last) { + return -1; + } + goto CONTENT_DISPOS; + default: return -1; - } - goto CONTENT_DISPOS; - - default: - return -1; } CONTENT_DISPOS: NEXT_CHAR(); switch (ch) { - - case 'I': - if (last) { - return -1; - } - goto CONTENT_DISPOSI; - - - case 'i': - if (last) { + case 'I': + if (last) { + return -1; + } + goto CONTENT_DISPOSI; + case 'i': + if (last) { + return -1; + } + goto CONTENT_DISPOSI; + default: return -1; - } - goto CONTENT_DISPOSI; - - default: - return -1; } CONTENT_DISPOSI: NEXT_CHAR(); switch (ch) { - - case 'T': - if (last) { + case 'T': + if (last) { + return -1; + } + goto CONTENT_DISPOSIT; + case 't': + if (last) { + return -1; + } + goto CONTENT_DISPOSIT; + default: return -1; - } - goto CONTENT_DISPOSIT; - - - case 't': - if (last) { - return -1; - } - goto CONTENT_DISPOSIT; - - default: - return -1; } CONTENT_DISPOSIT: NEXT_CHAR(); switch (ch) { - - case 'I': - if (last) { - return -1; - } - goto CONTENT_DISPOSITI; - - - case 'i': - if (last) { + case 'I': + if (last) { + return -1; + } + goto CONTENT_DISPOSITI; + case 'i': + if (last) { + return -1; + } + goto CONTENT_DISPOSITI; + default: return -1; - } - goto CONTENT_DISPOSITI; - - default: - return -1; } CONTENT_DISPOSITI: NEXT_CHAR(); switch (ch) { - - case 'O': - if (last) { - return -1; - } - goto CONTENT_DISPOSITIO; - - - case 'o': - if (last) { + case 'O': + if (last) { + return -1; + } + goto CONTENT_DISPOSITIO; + case 'o': + if (last) { + return -1; + } + goto CONTENT_DISPOSITIO; + default: return -1; - } - goto CONTENT_DISPOSITIO; - - default: - return -1; } CONTENT_DISPOSITIO: NEXT_CHAR(); switch (ch) { - - case 'N': - if (last) { - return 18; - } - goto CONTENT_DISPOSITION; - - - case 'n': - if (last) { - return 18; - } - goto CONTENT_DISPOSITION; - - default: - return -1; + case 'N': + if (last) { + return 18; + } + goto CONTENT_DISPOSITION; + case 'n': + if (last) { + return 18; + } + goto CONTENT_DISPOSITION; + default: + return -1; } CONTENT_DISPOSITION: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } CONTENT_E: NEXT_CHAR(); switch (ch) { - - case 'N': - if (last) { - return -1; - } - goto CONTENT_EN; - - - case 'n': - if (last) { + case 'N': + if (last) { + return -1; + } + goto CONTENT_EN; + case 'n': + if (last) { + return -1; + } + goto CONTENT_EN; + default: return -1; - } - goto CONTENT_EN; - - default: - return -1; } CONTENT_EN: NEXT_CHAR(); switch (ch) { - - case 'C': - if (last) { - return -1; - } - goto CONTENT_ENC; - - - case 'c': - if (last) { + case 'C': + if (last) { + return -1; + } + goto CONTENT_ENC; + case 'c': + if (last) { + return -1; + } + goto CONTENT_ENC; + default: return -1; - } - goto CONTENT_ENC; - - default: - return -1; } CONTENT_ENC: NEXT_CHAR(); switch (ch) { - - case 'O': - if (last) { - return -1; - } - goto CONTENT_ENCO; - - - case 'o': - if (last) { + case 'O': + if (last) { + return -1; + } + goto CONTENT_ENCO; + case 'o': + if (last) { + return -1; + } + goto CONTENT_ENCO; + default: return -1; - } - goto CONTENT_ENCO; - - default: - return -1; } CONTENT_ENCO: NEXT_CHAR(); switch (ch) { - - case 'D': - if (last) { + case 'D': + if (last) { + return -1; + } + goto CONTENT_ENCOD; + case 'd': + if (last) { + return -1; + } + goto CONTENT_ENCOD; + default: return -1; - } - goto CONTENT_ENCOD; - - - case 'd': - if (last) { - return -1; - } - goto CONTENT_ENCOD; - - default: - return -1; } CONTENT_ENCOD: NEXT_CHAR(); switch (ch) { - - case 'I': - if (last) { - return -1; - } - goto CONTENT_ENCODI; - - - case 'i': - if (last) { + case 'I': + if (last) { + return -1; + } + goto CONTENT_ENCODI; + case 'i': + if (last) { + return -1; + } + goto CONTENT_ENCODI; + default: return -1; - } - goto CONTENT_ENCODI; - - default: - return -1; } CONTENT_ENCODI: NEXT_CHAR(); switch (ch) { - - case 'N': - if (last) { - return -1; - } - goto CONTENT_ENCODIN; - - - case 'n': - if (last) { + case 'N': + if (last) { + return -1; + } + goto CONTENT_ENCODIN; + case 'n': + if (last) { + return -1; + } + goto CONTENT_ENCODIN; + default: return -1; - } - goto CONTENT_ENCODIN; - - default: - return -1; } CONTENT_ENCODIN: NEXT_CHAR(); - switch (ch) { - - case 'G': - if (last) { - return 19; - } - goto CONTENT_ENCODING; - - - case 'g': - if (last) { - return 19; - } - goto CONTENT_ENCODING; - - default: - return -1; - } - -CONTENT_ENCODING: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - -CONTENT_L: - NEXT_CHAR(); - switch (ch) { - - case 'A': - if (last) { - return -1; - } - goto CONTENT_LA; - - - case 'a': - if (last) { - return -1; - } - goto CONTENT_LA; - - - case 'E': - if (last) { - return -1; - } - goto CONTENT_LE; - - - case 'e': - if (last) { + switch (ch) { + case 'G': + if (last) { + return 19; + } + goto CONTENT_ENCODING; + case 'g': + if (last) { + return 19; + } + goto CONTENT_ENCODING; + default: return -1; - } - goto CONTENT_LE; + } +CONTENT_ENCODING: + NEXT_CHAR(); + switch (ch) { - case 'O': - if (last) { + default: return -1; - } - goto CONTENT_LO; - + } - case 'o': - if (last) { +CONTENT_L: + NEXT_CHAR(); + switch (ch) { + case 'A': + if (last) { + return -1; + } + goto CONTENT_LA; + case 'a': + if (last) { + return -1; + } + goto CONTENT_LA; + case 'E': + if (last) { + return -1; + } + goto CONTENT_LE; + case 'e': + if (last) { + return -1; + } + goto CONTENT_LE; + case 'O': + if (last) { + return -1; + } + goto CONTENT_LO; + case 'o': + if (last) { + return -1; + } + goto CONTENT_LO; + default: return -1; - } - goto CONTENT_LO; - - default: - return -1; } CONTENT_LA: NEXT_CHAR(); switch (ch) { - - case 'N': - if (last) { + case 'N': + if (last) { + return -1; + } + goto CONTENT_LAN; + case 'n': + if (last) { + return -1; + } + goto CONTENT_LAN; + default: return -1; - } - goto CONTENT_LAN; - - - case 'n': - if (last) { - return -1; - } - goto CONTENT_LAN; - - default: - return -1; } CONTENT_LAN: NEXT_CHAR(); switch (ch) { - - case 'G': - if (last) { - return -1; - } - goto CONTENT_LANG; - - - case 'g': - if (last) { + case 'G': + if (last) { + return -1; + } + goto CONTENT_LANG; + case 'g': + if (last) { + return -1; + } + goto CONTENT_LANG; + default: return -1; - } - goto CONTENT_LANG; - - default: - return -1; } CONTENT_LANG: NEXT_CHAR(); switch (ch) { - - case 'U': - if (last) { - return -1; - } - goto CONTENT_LANGU; - - - case 'u': - if (last) { + case 'U': + if (last) { + return -1; + } + goto CONTENT_LANGU; + case 'u': + if (last) { + return -1; + } + goto CONTENT_LANGU; + default: return -1; - } - goto CONTENT_LANGU; - - default: - return -1; } CONTENT_LANGU: NEXT_CHAR(); switch (ch) { - - case 'A': - if (last) { - return -1; - } - goto CONTENT_LANGUA; - - - case 'a': - if (last) { + case 'A': + if (last) { + return -1; + } + goto CONTENT_LANGUA; + case 'a': + if (last) { + return -1; + } + goto CONTENT_LANGUA; + default: return -1; - } - goto CONTENT_LANGUA; - - default: - return -1; } CONTENT_LANGUA: NEXT_CHAR(); switch (ch) { - - case 'G': - if (last) { + case 'G': + if (last) { + return -1; + } + goto CONTENT_LANGUAG; + case 'g': + if (last) { + return -1; + } + goto CONTENT_LANGUAG; + default: return -1; - } - goto CONTENT_LANGUAG; - - - case 'g': - if (last) { - return -1; - } - goto CONTENT_LANGUAG; - - default: - return -1; } CONTENT_LANGUAG: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return 20; - } - goto CONTENT_LANGUAGE; - - - case 'e': - if (last) { - return 20; - } - goto CONTENT_LANGUAGE; - - default: - return -1; + case 'E': + if (last) { + return 20; + } + goto CONTENT_LANGUAGE; + case 'e': + if (last) { + return 20; + } + goto CONTENT_LANGUAGE; + default: + return -1; } CONTENT_LANGUAGE: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } CONTENT_LE: NEXT_CHAR(); switch (ch) { - - case 'N': - if (last) { - return -1; - } - goto CONTENT_LEN; - - - case 'n': - if (last) { + case 'N': + if (last) { + return -1; + } + goto CONTENT_LEN; + case 'n': + if (last) { + return -1; + } + goto CONTENT_LEN; + default: return -1; - } - goto CONTENT_LEN; - - default: - return -1; } CONTENT_LEN: NEXT_CHAR(); switch (ch) { - - case 'G': - if (last) { + case 'G': + if (last) { + return -1; + } + goto CONTENT_LENG; + case 'g': + if (last) { + return -1; + } + goto CONTENT_LENG; + default: return -1; - } - goto CONTENT_LENG; - - - case 'g': - if (last) { - return -1; - } - goto CONTENT_LENG; - - default: - return -1; } CONTENT_LENG: NEXT_CHAR(); switch (ch) { - - case 'T': - if (last) { - return -1; - } - goto CONTENT_LENGT; - - - case 't': - if (last) { + case 'T': + if (last) { + return -1; + } + goto CONTENT_LENGT; + case 't': + if (last) { + return -1; + } + goto CONTENT_LENGT; + default: return -1; - } - goto CONTENT_LENGT; - - default: - return -1; } CONTENT_LENGT: NEXT_CHAR(); switch (ch) { - - case 'H': - if (last) { - return 21; - } - goto CONTENT_LENGTH; - - - case 'h': - if (last) { - return 21; - } - goto CONTENT_LENGTH; - - default: - return -1; + case 'H': + if (last) { + return 21; + } + goto CONTENT_LENGTH; + case 'h': + if (last) { + return 21; + } + goto CONTENT_LENGTH; + default: + return -1; } CONTENT_LENGTH: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } CONTENT_LO: NEXT_CHAR(); switch (ch) { - - case 'C': - if (last) { + case 'C': + if (last) { + return -1; + } + goto CONTENT_LOC; + case 'c': + if (last) { + return -1; + } + goto CONTENT_LOC; + default: return -1; - } - goto CONTENT_LOC; - - - case 'c': - if (last) { - return -1; - } - goto CONTENT_LOC; - - default: - return -1; } CONTENT_LOC: NEXT_CHAR(); switch (ch) { - - case 'A': - if (last) { - return -1; - } - goto CONTENT_LOCA; - - - case 'a': - if (last) { + case 'A': + if (last) { + return -1; + } + goto CONTENT_LOCA; + case 'a': + if (last) { + return -1; + } + goto CONTENT_LOCA; + default: return -1; - } - goto CONTENT_LOCA; - - default: - return -1; } CONTENT_LOCA: NEXT_CHAR(); switch (ch) { - - case 'T': - if (last) { - return -1; - } - goto CONTENT_LOCAT; - - - case 't': - if (last) { + case 'T': + if (last) { + return -1; + } + goto CONTENT_LOCAT; + case 't': + if (last) { + return -1; + } + goto CONTENT_LOCAT; + default: return -1; - } - goto CONTENT_LOCAT; - - default: - return -1; } CONTENT_LOCAT: NEXT_CHAR(); switch (ch) { - - case 'I': - if (last) { - return -1; - } - goto CONTENT_LOCATI; - - - case 'i': - if (last) { + case 'I': + if (last) { + return -1; + } + goto CONTENT_LOCATI; + case 'i': + if (last) { + return -1; + } + goto CONTENT_LOCATI; + default: return -1; - } - goto CONTENT_LOCATI; - - default: - return -1; } CONTENT_LOCATI: NEXT_CHAR(); switch (ch) { - - case 'O': - if (last) { + case 'O': + if (last) { + return -1; + } + goto CONTENT_LOCATIO; + case 'o': + if (last) { + return -1; + } + goto CONTENT_LOCATIO; + default: return -1; - } - goto CONTENT_LOCATIO; - - - case 'o': - if (last) { - return -1; - } - goto CONTENT_LOCATIO; - - default: - return -1; } CONTENT_LOCATIO: NEXT_CHAR(); switch (ch) { - - case 'N': - if (last) { - return 22; - } - goto CONTENT_LOCATION; - - - case 'n': - if (last) { - return 22; - } - goto CONTENT_LOCATION; - - default: - return -1; + case 'N': + if (last) { + return 22; + } + goto CONTENT_LOCATION; + case 'n': + if (last) { + return 22; + } + goto CONTENT_LOCATION; + default: + return -1; } CONTENT_LOCATION: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } CONTENT_M: NEXT_CHAR(); switch (ch) { - - case 'D': - if (last) { - return -1; - } - goto CONTENT_MD; - - - case 'd': - if (last) { + case 'D': + if (last) { + return -1; + } + goto CONTENT_MD; + case 'd': + if (last) { + return -1; + } + goto CONTENT_MD; + default: return -1; - } - goto CONTENT_MD; - - default: - return -1; } CONTENT_MD: NEXT_CHAR(); switch (ch) { - - case '5': - if (last) { - return 23; - } - goto CONTENT_MD5; - - default: - return -1; + case '5': + if (last) { + return 23; + } + goto CONTENT_MD5; + default: + return -1; } CONTENT_MD5: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } CONTENT_R: NEXT_CHAR(); switch (ch) { - - case 'A': - if (last) { + case 'A': + if (last) { + return -1; + } + goto CONTENT_RA; + case 'a': + if (last) { + return -1; + } + goto CONTENT_RA; + default: return -1; - } - goto CONTENT_RA; - - - case 'a': - if (last) { - return -1; - } - goto CONTENT_RA; - - default: - return -1; } CONTENT_RA: NEXT_CHAR(); switch (ch) { - - case 'N': - if (last) { - return -1; - } - goto CONTENT_RAN; - - - case 'n': - if (last) { + case 'N': + if (last) { + return -1; + } + goto CONTENT_RAN; + case 'n': + if (last) { + return -1; + } + goto CONTENT_RAN; + default: return -1; - } - goto CONTENT_RAN; - - default: - return -1; } CONTENT_RAN: NEXT_CHAR(); switch (ch) { - - case 'G': - if (last) { - return -1; - } - goto CONTENT_RANG; - - - case 'g': - if (last) { + case 'G': + if (last) { + return -1; + } + goto CONTENT_RANG; + case 'g': + if (last) { + return -1; + } + goto CONTENT_RANG; + default: return -1; - } - goto CONTENT_RANG; - - default: - return -1; } CONTENT_RANG: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return 24; - } - goto CONTENT_RANGE; - - - case 'e': - if (last) { - return 24; - } - goto CONTENT_RANGE; - - default: - return -1; + case 'E': + if (last) { + return 24; + } + goto CONTENT_RANGE; + case 'e': + if (last) { + return 24; + } + goto CONTENT_RANGE; + default: + return -1; } CONTENT_RANGE: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } CONTENT_T: NEXT_CHAR(); switch (ch) { - - case 'R': - if (last) { - return -1; - } - goto CONTENT_TR; - - - case 'r': - if (last) { + case 'R': + if (last) { + return -1; + } + goto CONTENT_TR; + case 'r': + if (last) { + return -1; + } + goto CONTENT_TR; + case 'Y': + if (last) { + return -1; + } + goto CONTENT_TY; + case 'y': + if (last) { + return -1; + } + goto CONTENT_TY; + default: return -1; - } - goto CONTENT_TR; - - - case 'Y': - if (last) { - return -1; - } - goto CONTENT_TY; - - - case 'y': - if (last) { - return -1; - } - goto CONTENT_TY; - - default: - return -1; } CONTENT_TR: NEXT_CHAR(); switch (ch) { - - case 'A': - if (last) { + case 'A': + if (last) { + return -1; + } + goto CONTENT_TRA; + case 'a': + if (last) { + return -1; + } + goto CONTENT_TRA; + default: return -1; - } - goto CONTENT_TRA; - - - case 'a': - if (last) { - return -1; - } - goto CONTENT_TRA; - - default: - return -1; } CONTENT_TRA: NEXT_CHAR(); switch (ch) { - - case 'N': - if (last) { - return -1; - } - goto CONTENT_TRAN; - - - case 'n': - if (last) { + case 'N': + if (last) { + return -1; + } + goto CONTENT_TRAN; + case 'n': + if (last) { + return -1; + } + goto CONTENT_TRAN; + default: return -1; - } - goto CONTENT_TRAN; - - default: - return -1; } CONTENT_TRAN: NEXT_CHAR(); switch (ch) { - - case 'S': - if (last) { - return -1; - } - goto CONTENT_TRANS; - - - case 's': - if (last) { + case 'S': + if (last) { + return -1; + } + goto CONTENT_TRANS; + case 's': + if (last) { + return -1; + } + goto CONTENT_TRANS; + default: return -1; - } - goto CONTENT_TRANS; - - default: - return -1; } CONTENT_TRANS: NEXT_CHAR(); switch (ch) { - - case 'F': - if (last) { - return -1; - } - goto CONTENT_TRANSF; - - - case 'f': - if (last) { + case 'F': + if (last) { + return -1; + } + goto CONTENT_TRANSF; + case 'f': + if (last) { + return -1; + } + goto CONTENT_TRANSF; + default: return -1; - } - goto CONTENT_TRANSF; - - default: - return -1; } CONTENT_TRANSF: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { + case 'E': + if (last) { + return -1; + } + goto CONTENT_TRANSFE; + case 'e': + if (last) { + return -1; + } + goto CONTENT_TRANSFE; + default: return -1; - } - goto CONTENT_TRANSFE; - - - case 'e': - if (last) { - return -1; - } - goto CONTENT_TRANSFE; - - default: - return -1; } CONTENT_TRANSFE: NEXT_CHAR(); switch (ch) { - - case 'R': - if (last) { - return -1; - } - goto CONTENT_TRANSFER; - - - case 'r': - if (last) { + case 'R': + if (last) { + return -1; + } + goto CONTENT_TRANSFER; + case 'r': + if (last) { + return -1; + } + goto CONTENT_TRANSFER; + default: return -1; - } - goto CONTENT_TRANSFER; - - default: - return -1; } CONTENT_TRANSFER: NEXT_CHAR(); switch (ch) { - - case '-': - if (last) { + case '-': + if (last) { + return -1; + } + goto CONTENT_TRANSFER_; + default: return -1; - } - goto CONTENT_TRANSFER_; - - default: - return -1; } CONTENT_TRANSFER_: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { + case 'E': + if (last) { + return -1; + } + goto CONTENT_TRANSFER_E; + case 'e': + if (last) { + return -1; + } + goto CONTENT_TRANSFER_E; + default: return -1; - } - goto CONTENT_TRANSFER_E; - - - case 'e': - if (last) { - return -1; - } - goto CONTENT_TRANSFER_E; - - default: - return -1; } CONTENT_TRANSFER_E: NEXT_CHAR(); switch (ch) { - - case 'N': - if (last) { - return -1; - } - goto CONTENT_TRANSFER_EN; - - - case 'n': - if (last) { + case 'N': + if (last) { + return -1; + } + goto CONTENT_TRANSFER_EN; + case 'n': + if (last) { + return -1; + } + goto CONTENT_TRANSFER_EN; + default: return -1; - } - goto CONTENT_TRANSFER_EN; - - default: - return -1; } CONTENT_TRANSFER_EN: NEXT_CHAR(); switch (ch) { - - case 'C': - if (last) { - return -1; - } - goto CONTENT_TRANSFER_ENC; - - - case 'c': - if (last) { + case 'C': + if (last) { + return -1; + } + goto CONTENT_TRANSFER_ENC; + case 'c': + if (last) { + return -1; + } + goto CONTENT_TRANSFER_ENC; + default: return -1; - } - goto CONTENT_TRANSFER_ENC; - - default: - return -1; } CONTENT_TRANSFER_ENC: NEXT_CHAR(); switch (ch) { - - case 'O': - if (last) { - return -1; - } - goto CONTENT_TRANSFER_ENCO; - - - case 'o': - if (last) { + case 'O': + if (last) { + return -1; + } + goto CONTENT_TRANSFER_ENCO; + case 'o': + if (last) { + return -1; + } + goto CONTENT_TRANSFER_ENCO; + default: return -1; - } - goto CONTENT_TRANSFER_ENCO; - - default: - return -1; } CONTENT_TRANSFER_ENCO: NEXT_CHAR(); switch (ch) { - - case 'D': - if (last) { + case 'D': + if (last) { + return -1; + } + goto CONTENT_TRANSFER_ENCOD; + case 'd': + if (last) { + return -1; + } + goto CONTENT_TRANSFER_ENCOD; + default: return -1; - } - goto CONTENT_TRANSFER_ENCOD; - - - case 'd': - if (last) { - return -1; - } - goto CONTENT_TRANSFER_ENCOD; - - default: - return -1; } CONTENT_TRANSFER_ENCOD: NEXT_CHAR(); switch (ch) { - - case 'I': - if (last) { - return -1; - } - goto CONTENT_TRANSFER_ENCODI; - - - case 'i': - if (last) { + case 'I': + if (last) { + return -1; + } + goto CONTENT_TRANSFER_ENCODI; + case 'i': + if (last) { + return -1; + } + goto CONTENT_TRANSFER_ENCODI; + default: return -1; - } - goto CONTENT_TRANSFER_ENCODI; - - default: - return -1; } CONTENT_TRANSFER_ENCODI: NEXT_CHAR(); switch (ch) { - - case 'N': - if (last) { - return -1; - } - goto CONTENT_TRANSFER_ENCODIN; - - - case 'n': - if (last) { + case 'N': + if (last) { + return -1; + } + goto CONTENT_TRANSFER_ENCODIN; + case 'n': + if (last) { + return -1; + } + goto CONTENT_TRANSFER_ENCODIN; + default: return -1; - } - goto CONTENT_TRANSFER_ENCODIN; - - default: - return -1; } CONTENT_TRANSFER_ENCODIN: NEXT_CHAR(); switch (ch) { - - case 'G': - if (last) { - return 25; - } - goto CONTENT_TRANSFER_ENCODING; - - - case 'g': - if (last) { - return 25; - } - goto CONTENT_TRANSFER_ENCODING; - - default: - return -1; + case 'G': + if (last) { + return 25; + } + goto CONTENT_TRANSFER_ENCODING; + case 'g': + if (last) { + return 25; + } + goto CONTENT_TRANSFER_ENCODING; + default: + return -1; } CONTENT_TRANSFER_ENCODING: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } CONTENT_TY: NEXT_CHAR(); switch (ch) { - - case 'P': - if (last) { - return -1; - } - goto CONTENT_TYP; - - - case 'p': - if (last) { + case 'P': + if (last) { + return -1; + } + goto CONTENT_TYP; + case 'p': + if (last) { + return -1; + } + goto CONTENT_TYP; + default: return -1; - } - goto CONTENT_TYP; - - default: - return -1; } CONTENT_TYP: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return 26; - } - goto CONTENT_TYPE; - - - case 'e': - if (last) { - return 26; - } - goto CONTENT_TYPE; - - default: - return -1; + case 'E': + if (last) { + return 26; + } + goto CONTENT_TYPE; + case 'e': + if (last) { + return 26; + } + goto CONTENT_TYPE; + default: + return -1; } CONTENT_TYPE: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } COO: NEXT_CHAR(); switch (ch) { - - case 'K': - if (last) { + case 'K': + if (last) { + return -1; + } + goto COOK; + case 'k': + if (last) { + return -1; + } + goto COOK; + default: return -1; - } - goto COOK; - - - case 'k': - if (last) { - return -1; - } - goto COOK; - - default: - return -1; } COOK: NEXT_CHAR(); switch (ch) { - - case 'I': - if (last) { - return -1; - } - goto COOKI; - - - case 'i': - if (last) { + case 'I': + if (last) { + return -1; + } + goto COOKI; + case 'i': + if (last) { + return -1; + } + goto COOKI; + default: return -1; - } - goto COOKI; - - default: - return -1; } COOKI: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return 27; - } - goto COOKIE; - - - case 'e': - if (last) { - return 27; - } - goto COOKIE; - - default: - return -1; + case 'E': + if (last) { + return 27; + } + goto COOKIE; + case 'e': + if (last) { + return 27; + } + goto COOKIE; + default: + return -1; } COOKIE: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } D: NEXT_CHAR(); switch (ch) { - - case 'A': - if (last) { - return -1; - } - goto DA; - - - case 'a': - if (last) { - return -1; - } - goto DA; - - - case 'E': - if (last) { - return -1; - } - goto DE; - - - case 'e': - if (last) { - return -1; - } - goto DE; - - - case 'I': - if (last) { + case 'A': + if (last) { + return -1; + } + goto DA; + case 'a': + if (last) { + return -1; + } + goto DA; + case 'E': + if (last) { + return -1; + } + goto DE; + case 'e': + if (last) { + return -1; + } + goto DE; + case 'I': + if (last) { + return -1; + } + goto DI; + case 'i': + if (last) { + return -1; + } + goto DI; + default: return -1; - } - goto DI; - - - case 'i': - if (last) { - return -1; - } - goto DI; - - default: - return -1; } DA: NEXT_CHAR(); switch (ch) { - - case 'T': - if (last) { - return -1; - } - goto DAT; - - - case 't': - if (last) { + case 'T': + if (last) { + return -1; + } + goto DAT; + case 't': + if (last) { + return -1; + } + goto DAT; + default: return -1; - } - goto DAT; - - default: - return -1; } DAT: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return 28; - } - goto DATE; - - - case 'e': - if (last) { - return 28; - } - goto DATE; - - default: - return -1; + case 'E': + if (last) { + return 28; + } + goto DATE; + case 'e': + if (last) { + return 28; + } + goto DATE; + default: + return -1; } DATE: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } DE: NEXT_CHAR(); switch (ch) { - - case 'S': - if (last) { + case 'S': + if (last) { + return -1; + } + goto DES; + case 's': + if (last) { + return -1; + } + goto DES; + default: return -1; - } - goto DES; - - - case 's': - if (last) { - return -1; - } - goto DES; - - default: - return -1; } DES: NEXT_CHAR(); switch (ch) { - - case 'T': - if (last) { - return -1; - } - goto DEST; - - - case 't': - if (last) { + case 'T': + if (last) { + return -1; + } + goto DEST; + case 't': + if (last) { + return -1; + } + goto DEST; + default: return -1; - } - goto DEST; - - default: - return -1; } DEST: NEXT_CHAR(); switch (ch) { - - case 'I': - if (last) { - return -1; - } - goto DESTI; - - - case 'i': - if (last) { + case 'I': + if (last) { + return -1; + } + goto DESTI; + case 'i': + if (last) { + return -1; + } + goto DESTI; + default: return -1; - } - goto DESTI; - - default: - return -1; } DESTI: NEXT_CHAR(); switch (ch) { - - case 'N': - if (last) { - return -1; - } - goto DESTIN; - - - case 'n': - if (last) { + case 'N': + if (last) { + return -1; + } + goto DESTIN; + case 'n': + if (last) { + return -1; + } + goto DESTIN; + default: return -1; - } - goto DESTIN; - - default: - return -1; } DESTIN: NEXT_CHAR(); switch (ch) { - - case 'A': - if (last) { + case 'A': + if (last) { + return -1; + } + goto DESTINA; + case 'a': + if (last) { + return -1; + } + goto DESTINA; + default: return -1; - } - goto DESTINA; - - - case 'a': - if (last) { - return -1; - } - goto DESTINA; - - default: - return -1; } DESTINA: NEXT_CHAR(); switch (ch) { - - case 'T': - if (last) { - return -1; - } - goto DESTINAT; - - - case 't': - if (last) { + case 'T': + if (last) { + return -1; + } + goto DESTINAT; + case 't': + if (last) { + return -1; + } + goto DESTINAT; + default: return -1; - } - goto DESTINAT; - - default: - return -1; } DESTINAT: NEXT_CHAR(); switch (ch) { - - case 'I': - if (last) { - return -1; - } - goto DESTINATI; - - - case 'i': - if (last) { + case 'I': + if (last) { + return -1; + } + goto DESTINATI; + case 'i': + if (last) { + return -1; + } + goto DESTINATI; + default: return -1; - } - goto DESTINATI; - - default: - return -1; } DESTINATI: NEXT_CHAR(); switch (ch) { - - case 'O': - if (last) { - return -1; - } - goto DESTINATIO; - - - case 'o': - if (last) { + case 'O': + if (last) { + return -1; + } + goto DESTINATIO; + case 'o': + if (last) { + return -1; + } + goto DESTINATIO; + default: return -1; - } - goto DESTINATIO; - - default: - return -1; } DESTINATIO: NEXT_CHAR(); switch (ch) { - - case 'N': - if (last) { - return 29; - } - goto DESTINATION; - - - case 'n': - if (last) { - return 29; - } - goto DESTINATION; - - default: - return -1; + case 'N': + if (last) { + return 29; + } + goto DESTINATION; + case 'n': + if (last) { + return 29; + } + goto DESTINATION; + default: + return -1; } DESTINATION: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } DI: NEXT_CHAR(); switch (ch) { - - case 'G': - if (last) { - return -1; - } - goto DIG; - - - case 'g': - if (last) { + case 'G': + if (last) { + return -1; + } + goto DIG; + case 'g': + if (last) { + return -1; + } + goto DIG; + default: return -1; - } - goto DIG; - - default: - return -1; } DIG: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return -1; - } - goto DIGE; - - - case 'e': - if (last) { + case 'E': + if (last) { + return -1; + } + goto DIGE; + case 'e': + if (last) { + return -1; + } + goto DIGE; + default: return -1; - } - goto DIGE; - - default: - return -1; } DIGE: NEXT_CHAR(); switch (ch) { - - case 'S': - if (last) { + case 'S': + if (last) { + return -1; + } + goto DIGES; + case 's': + if (last) { + return -1; + } + goto DIGES; + default: return -1; - } - goto DIGES; - - - case 's': - if (last) { - return -1; - } - goto DIGES; - - default: - return -1; } DIGES: NEXT_CHAR(); switch (ch) { - - case 'T': - if (last) { - return 30; - } - goto DIGEST; - - - case 't': - if (last) { - return 30; - } - goto DIGEST; - - default: - return -1; + case 'T': + if (last) { + return 30; + } + goto DIGEST; + case 't': + if (last) { + return 30; + } + goto DIGEST; + default: + return -1; } DIGEST: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } E: NEXT_CHAR(); switch (ch) { - - case 'T': - if (last) { - return -1; - } - goto ET; - - - case 't': - if (last) { - return -1; - } - goto ET; - - - case 'X': - if (last) { - return -1; - } - goto EX; - - - case 'x': - if (last) { + case 'T': + if (last) { + return -1; + } + goto ET; + case 't': + if (last) { + return -1; + } + goto ET; + case 'X': + if (last) { + return -1; + } + goto EX; + case 'x': + if (last) { + return -1; + } + goto EX; + default: return -1; - } - goto EX; - - default: - return -1; } ET: NEXT_CHAR(); switch (ch) { - - case 'A': - if (last) { - return -1; - } - goto ETA; - - - case 'a': - if (last) { + case 'A': + if (last) { + return -1; + } + goto ETA; + case 'a': + if (last) { + return -1; + } + goto ETA; + default: return -1; - } - goto ETA; - - default: - return -1; } ETA: NEXT_CHAR(); switch (ch) { - - case 'G': - if (last) { - return 31; - } - goto ETAG; - - - case 'g': - if (last) { - return 31; - } - goto ETAG; - - default: - return -1; + case 'G': + if (last) { + return 31; + } + goto ETAG; + case 'g': + if (last) { + return 31; + } + goto ETAG; + default: + return -1; } ETAG: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } EX: NEXT_CHAR(); switch (ch) { - - case 'P': - if (last) { - return -1; - } - goto EXP; - - - case 'p': - if (last) { + case 'P': + if (last) { + return -1; + } + goto EXP; + case 'p': + if (last) { + return -1; + } + goto EXP; + default: return -1; - } - goto EXP; - - default: - return -1; } EXP: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return -1; - } - goto EXPE; - - - case 'e': - if (last) { - return -1; - } - goto EXPE; - - - case 'I': - if (last) { + case 'E': + if (last) { + return -1; + } + goto EXPE; + case 'e': + if (last) { + return -1; + } + goto EXPE; + case 'I': + if (last) { + return -1; + } + goto EXPI; + case 'i': + if (last) { + return -1; + } + goto EXPI; + default: return -1; - } - goto EXPI; - - - case 'i': - if (last) { - return -1; - } - goto EXPI; - - default: - return -1; } EXPE: NEXT_CHAR(); switch (ch) { - - case 'C': - if (last) { - return -1; - } - goto EXPEC; - - - case 'c': - if (last) { + case 'C': + if (last) { + return -1; + } + goto EXPEC; + case 'c': + if (last) { + return -1; + } + goto EXPEC; + default: return -1; - } - goto EXPEC; - - default: - return -1; } EXPEC: NEXT_CHAR(); switch (ch) { - - case 'T': - if (last) { - return 32; - } - goto EXPECT; - - - case 't': - if (last) { - return 32; - } - goto EXPECT; - - default: - return -1; + case 'T': + if (last) { + return 32; + } + goto EXPECT; + case 't': + if (last) { + return 32; + } + goto EXPECT; + default: + return -1; } EXPECT: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } EXPI: NEXT_CHAR(); switch (ch) { - - case 'R': - if (last) { + case 'R': + if (last) { + return -1; + } + goto EXPIR; + case 'r': + if (last) { + return -1; + } + goto EXPIR; + default: return -1; - } - goto EXPIR; - - - case 'r': - if (last) { - return -1; - } - goto EXPIR; - - default: - return -1; } EXPIR: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return -1; - } - goto EXPIRE; - - - case 'e': - if (last) { + case 'E': + if (last) { + return -1; + } + goto EXPIRE; + case 'e': + if (last) { + return -1; + } + goto EXPIRE; + default: return -1; - } - goto EXPIRE; - - default: - return -1; } EXPIRE: NEXT_CHAR(); switch (ch) { - - case 'S': - if (last) { - return 33; - } - goto EXPIRES; - - - case 's': - if (last) { - return 33; - } - goto EXPIRES; - - default: - return -1; + case 'S': + if (last) { + return 33; + } + goto EXPIRES; + case 's': + if (last) { + return 33; + } + goto EXPIRES; + default: + return -1; } EXPIRES: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } F: NEXT_CHAR(); switch (ch) { - - case 'O': - if (last) { - return -1; - } - goto FO; - - - case 'o': - if (last) { - return -1; - } - goto FO; - - - case 'R': - if (last) { - return -1; - } - goto FR; - - - case 'r': - if (last) { + case 'O': + if (last) { + return -1; + } + goto FO; + case 'o': + if (last) { + return -1; + } + goto FO; + case 'R': + if (last) { + return -1; + } + goto FR; + case 'r': + if (last) { + return -1; + } + goto FR; + default: return -1; - } - goto FR; - - default: - return -1; } FO: NEXT_CHAR(); switch (ch) { - - case 'R': - if (last) { - return -1; - } - goto FOR; - - - case 'r': - if (last) { + case 'R': + if (last) { + return -1; + } + goto FOR; + case 'r': + if (last) { + return -1; + } + goto FOR; + default: return -1; - } - goto FOR; - - default: - return -1; } FOR: NEXT_CHAR(); switch (ch) { - - case 'W': - if (last) { + case 'W': + if (last) { + return -1; + } + goto FORW; + case 'w': + if (last) { + return -1; + } + goto FORW; + default: return -1; - } - goto FORW; - - - case 'w': - if (last) { - return -1; - } - goto FORW; - - default: - return -1; } FORW: NEXT_CHAR(); switch (ch) { - - case 'A': - if (last) { - return -1; - } - goto FORWA; - - - case 'a': - if (last) { + case 'A': + if (last) { + return -1; + } + goto FORWA; + case 'a': + if (last) { + return -1; + } + goto FORWA; + default: return -1; - } - goto FORWA; - - default: - return -1; } FORWA: NEXT_CHAR(); switch (ch) { - - case 'R': - if (last) { - return -1; - } - goto FORWAR; - - - case 'r': - if (last) { + case 'R': + if (last) { + return -1; + } + goto FORWAR; + case 'r': + if (last) { + return -1; + } + goto FORWAR; + default: return -1; - } - goto FORWAR; - - default: - return -1; } FORWAR: NEXT_CHAR(); switch (ch) { - - case 'D': - if (last) { - return -1; - } - goto FORWARD; - - - case 'd': - if (last) { + case 'D': + if (last) { + return -1; + } + goto FORWARD; + case 'd': + if (last) { + return -1; + } + goto FORWARD; + default: return -1; - } - goto FORWARD; - - default: - return -1; } FORWARD: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { + case 'E': + if (last) { + return -1; + } + goto FORWARDE; + case 'e': + if (last) { + return -1; + } + goto FORWARDE; + default: return -1; - } - goto FORWARDE; - - - case 'e': - if (last) { - return -1; - } - goto FORWARDE; - - default: - return -1; } FORWARDE: NEXT_CHAR(); switch (ch) { - - case 'D': - if (last) { - return 34; - } - goto FORWARDED; - - - case 'd': - if (last) { - return 34; - } - goto FORWARDED; - - default: - return -1; + case 'D': + if (last) { + return 34; + } + goto FORWARDED; + case 'd': + if (last) { + return 34; + } + goto FORWARDED; + default: + return -1; } FORWARDED: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } FR: NEXT_CHAR(); switch (ch) { - - case 'O': - if (last) { - return -1; - } - goto FRO; - - - case 'o': - if (last) { + case 'O': + if (last) { + return -1; + } + goto FRO; + case 'o': + if (last) { + return -1; + } + goto FRO; + default: return -1; - } - goto FRO; - - default: - return -1; } FRO: NEXT_CHAR(); switch (ch) { - - case 'M': - if (last) { - return 35; - } - goto FROM; - - - case 'm': - if (last) { - return 35; - } - goto FROM; - - default: - return -1; + case 'M': + if (last) { + return 35; + } + goto FROM; + case 'm': + if (last) { + return 35; + } + goto FROM; + default: + return -1; } FROM: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } H: NEXT_CHAR(); switch (ch) { - - case 'O': - if (last) { - return -1; - } - goto HO; - - - case 'o': - if (last) { + case 'O': + if (last) { + return -1; + } + goto HO; + case 'o': + if (last) { + return -1; + } + goto HO; + default: return -1; - } - goto HO; - - default: - return -1; } HO: NEXT_CHAR(); switch (ch) { - - case 'S': - if (last) { - return -1; - } - goto HOS; - - - case 's': - if (last) { + case 'S': + if (last) { + return -1; + } + goto HOS; + case 's': + if (last) { + return -1; + } + goto HOS; + default: return -1; - } - goto HOS; - - default: - return -1; } HOS: NEXT_CHAR(); switch (ch) { - - case 'T': - if (last) { - return 36; - } - goto HOST; - - - case 't': - if (last) { - return 36; - } - goto HOST; - - default: - return -1; + case 'T': + if (last) { + return 36; + } + goto HOST; + case 't': + if (last) { + return 36; + } + goto HOST; + default: + return -1; } HOST: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } I: NEXT_CHAR(); switch (ch) { - - case 'F': - if (last) { - return -1; - } - goto IF; - - - case 'f': - if (last) { + case 'F': + if (last) { + return -1; + } + goto IF; + case 'f': + if (last) { + return -1; + } + goto IF; + default: return -1; - } - goto IF; - - default: - return -1; } IF: NEXT_CHAR(); switch (ch) { - - case '-': - if (last) { + case '-': + if (last) { + return -1; + } + goto IF_; + default: return -1; - } - goto IF_; - - default: - return -1; } IF_: NEXT_CHAR(); switch (ch) { - - case 'M': - if (last) { - return -1; - } - goto IF_M; - - - case 'm': - if (last) { - return -1; - } - goto IF_M; - - - case 'N': - if (last) { - return -1; - } - goto IF_N; - - - case 'n': - if (last) { - return -1; - } - goto IF_N; - - - case 'R': - if (last) { - return -1; - } - goto IF_R; - - - case 'r': - if (last) { - return -1; - } - goto IF_R; - - - case 'U': - if (last) { - return -1; - } - goto IF_U; - - - case 'u': - if (last) { - return -1; - } - goto IF_U; - - default: - return -1; - } - -IF_M: - NEXT_CHAR(); - switch (ch) { - - case 'A': - if (last) { - return -1; - } - goto IF_MA; - - - case 'a': - if (last) { - return -1; - } - goto IF_MA; - - - case 'O': - if (last) { + case 'M': + if (last) { + return -1; + } + goto IF_M; + case 'm': + if (last) { + return -1; + } + goto IF_M; + case 'N': + if (last) { + return -1; + } + goto IF_N; + case 'n': + if (last) { + return -1; + } + goto IF_N; + case 'R': + if (last) { + return -1; + } + goto IF_R; + case 'r': + if (last) { + return -1; + } + goto IF_R; + case 'U': + if (last) { + return -1; + } + goto IF_U; + case 'u': + if (last) { + return -1; + } + goto IF_U; + default: return -1; - } - goto IF_MO; - + } - case 'o': - if (last) { +IF_M: + NEXT_CHAR(); + switch (ch) { + case 'A': + if (last) { + return -1; + } + goto IF_MA; + case 'a': + if (last) { + return -1; + } + goto IF_MA; + case 'O': + if (last) { + return -1; + } + goto IF_MO; + case 'o': + if (last) { + return -1; + } + goto IF_MO; + default: return -1; - } - goto IF_MO; - - default: - return -1; } IF_MA: NEXT_CHAR(); switch (ch) { - - case 'T': - if (last) { - return -1; - } - goto IF_MAT; - - - case 't': - if (last) { + case 'T': + if (last) { + return -1; + } + goto IF_MAT; + case 't': + if (last) { + return -1; + } + goto IF_MAT; + default: return -1; - } - goto IF_MAT; - - default: - return -1; } IF_MAT: NEXT_CHAR(); switch (ch) { - - case 'C': - if (last) { + case 'C': + if (last) { + return -1; + } + goto IF_MATC; + case 'c': + if (last) { + return -1; + } + goto IF_MATC; + default: return -1; - } - goto IF_MATC; - - - case 'c': - if (last) { - return -1; - } - goto IF_MATC; - - default: - return -1; } IF_MATC: NEXT_CHAR(); switch (ch) { - - case 'H': - if (last) { - return 37; - } - goto IF_MATCH; - - - case 'h': - if (last) { - return 37; - } - goto IF_MATCH; - - default: - return -1; + case 'H': + if (last) { + return 37; + } + goto IF_MATCH; + case 'h': + if (last) { + return 37; + } + goto IF_MATCH; + default: + return -1; } IF_MATCH: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } IF_MO: NEXT_CHAR(); switch (ch) { - - case 'D': - if (last) { - return -1; - } - goto IF_MOD; - - - case 'd': - if (last) { + case 'D': + if (last) { + return -1; + } + goto IF_MOD; + case 'd': + if (last) { + return -1; + } + goto IF_MOD; + default: return -1; - } - goto IF_MOD; - - default: - return -1; } IF_MOD: NEXT_CHAR(); switch (ch) { - - case 'I': - if (last) { + case 'I': + if (last) { + return -1; + } + goto IF_MODI; + case 'i': + if (last) { + return -1; + } + goto IF_MODI; + default: return -1; - } - goto IF_MODI; - - - case 'i': - if (last) { - return -1; - } - goto IF_MODI; - - default: - return -1; } IF_MODI: NEXT_CHAR(); switch (ch) { - - case 'F': - if (last) { - return -1; - } - goto IF_MODIF; - - - case 'f': - if (last) { + case 'F': + if (last) { + return -1; + } + goto IF_MODIF; + case 'f': + if (last) { + return -1; + } + goto IF_MODIF; + default: return -1; - } - goto IF_MODIF; - - default: - return -1; } IF_MODIF: NEXT_CHAR(); switch (ch) { - - case 'I': - if (last) { - return -1; - } - goto IF_MODIFI; - - - case 'i': - if (last) { + case 'I': + if (last) { + return -1; + } + goto IF_MODIFI; + case 'i': + if (last) { + return -1; + } + goto IF_MODIFI; + default: return -1; - } - goto IF_MODIFI; - - default: - return -1; } IF_MODIFI: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return -1; - } - goto IF_MODIFIE; - - - case 'e': - if (last) { + case 'E': + if (last) { + return -1; + } + goto IF_MODIFIE; + case 'e': + if (last) { + return -1; + } + goto IF_MODIFIE; + default: return -1; - } - goto IF_MODIFIE; - - default: - return -1; } IF_MODIFIE: NEXT_CHAR(); switch (ch) { - - case 'D': - if (last) { + case 'D': + if (last) { + return -1; + } + goto IF_MODIFIED; + case 'd': + if (last) { + return -1; + } + goto IF_MODIFIED; + default: return -1; - } - goto IF_MODIFIED; - - - case 'd': - if (last) { - return -1; - } - goto IF_MODIFIED; - - default: - return -1; } IF_MODIFIED: NEXT_CHAR(); switch (ch) { - - case '-': - if (last) { + case '-': + if (last) { + return -1; + } + goto IF_MODIFIED_; + default: return -1; - } - goto IF_MODIFIED_; - - default: - return -1; } IF_MODIFIED_: NEXT_CHAR(); switch (ch) { - - case 'S': - if (last) { - return -1; - } - goto IF_MODIFIED_S; - - - case 's': - if (last) { + case 'S': + if (last) { + return -1; + } + goto IF_MODIFIED_S; + case 's': + if (last) { + return -1; + } + goto IF_MODIFIED_S; + default: return -1; - } - goto IF_MODIFIED_S; - - default: - return -1; } IF_MODIFIED_S: NEXT_CHAR(); switch (ch) { - - case 'I': - if (last) { + case 'I': + if (last) { + return -1; + } + goto IF_MODIFIED_SI; + case 'i': + if (last) { + return -1; + } + goto IF_MODIFIED_SI; + default: return -1; - } - goto IF_MODIFIED_SI; - - - case 'i': - if (last) { - return -1; - } - goto IF_MODIFIED_SI; - - default: - return -1; } IF_MODIFIED_SI: NEXT_CHAR(); switch (ch) { - - case 'N': - if (last) { - return -1; - } - goto IF_MODIFIED_SIN; - - - case 'n': - if (last) { + case 'N': + if (last) { + return -1; + } + goto IF_MODIFIED_SIN; + case 'n': + if (last) { + return -1; + } + goto IF_MODIFIED_SIN; + default: return -1; - } - goto IF_MODIFIED_SIN; - - default: - return -1; } IF_MODIFIED_SIN: NEXT_CHAR(); switch (ch) { - - case 'C': - if (last) { - return -1; - } - goto IF_MODIFIED_SINC; - - - case 'c': - if (last) { + case 'C': + if (last) { + return -1; + } + goto IF_MODIFIED_SINC; + case 'c': + if (last) { + return -1; + } + goto IF_MODIFIED_SINC; + default: return -1; - } - goto IF_MODIFIED_SINC; - - default: - return -1; } IF_MODIFIED_SINC: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return 38; - } - goto IF_MODIFIED_SINCE; - - - case 'e': - if (last) { - return 38; - } - goto IF_MODIFIED_SINCE; - - default: - return -1; + case 'E': + if (last) { + return 38; + } + goto IF_MODIFIED_SINCE; + case 'e': + if (last) { + return 38; + } + goto IF_MODIFIED_SINCE; + default: + return -1; } IF_MODIFIED_SINCE: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } IF_N: NEXT_CHAR(); switch (ch) { - - case 'O': - if (last) { - return -1; - } - goto IF_NO; - - - case 'o': - if (last) { + case 'O': + if (last) { + return -1; + } + goto IF_NO; + case 'o': + if (last) { + return -1; + } + goto IF_NO; + default: return -1; - } - goto IF_NO; - - default: - return -1; } IF_NO: NEXT_CHAR(); switch (ch) { - - case 'N': - if (last) { - return -1; - } - goto IF_NON; - - - case 'n': - if (last) { + case 'N': + if (last) { + return -1; + } + goto IF_NON; + case 'n': + if (last) { + return -1; + } + goto IF_NON; + default: return -1; - } - goto IF_NON; - - default: - return -1; } IF_NON: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return -1; - } - goto IF_NONE; - - - case 'e': - if (last) { + case 'E': + if (last) { + return -1; + } + goto IF_NONE; + case 'e': + if (last) { + return -1; + } + goto IF_NONE; + default: return -1; - } - goto IF_NONE; - - default: - return -1; } IF_NONE: NEXT_CHAR(); switch (ch) { - - case '-': - if (last) { + case '-': + if (last) { + return -1; + } + goto IF_NONE_; + default: return -1; - } - goto IF_NONE_; - - default: - return -1; } IF_NONE_: NEXT_CHAR(); switch (ch) { - - case 'M': - if (last) { - return -1; - } - goto IF_NONE_M; - - - case 'm': - if (last) { + case 'M': + if (last) { + return -1; + } + goto IF_NONE_M; + case 'm': + if (last) { + return -1; + } + goto IF_NONE_M; + default: return -1; - } - goto IF_NONE_M; - - default: - return -1; } IF_NONE_M: NEXT_CHAR(); switch (ch) { - - case 'A': - if (last) { - return -1; - } - goto IF_NONE_MA; - - - case 'a': - if (last) { + case 'A': + if (last) { + return -1; + } + goto IF_NONE_MA; + case 'a': + if (last) { + return -1; + } + goto IF_NONE_MA; + default: return -1; - } - goto IF_NONE_MA; - - default: - return -1; } IF_NONE_MA: NEXT_CHAR(); switch (ch) { - - case 'T': - if (last) { + case 'T': + if (last) { + return -1; + } + goto IF_NONE_MAT; + case 't': + if (last) { + return -1; + } + goto IF_NONE_MAT; + default: return -1; - } - goto IF_NONE_MAT; - - - case 't': - if (last) { - return -1; - } - goto IF_NONE_MAT; - - default: - return -1; } IF_NONE_MAT: NEXT_CHAR(); switch (ch) { - - case 'C': - if (last) { - return -1; - } - goto IF_NONE_MATC; - - - case 'c': - if (last) { + case 'C': + if (last) { + return -1; + } + goto IF_NONE_MATC; + case 'c': + if (last) { + return -1; + } + goto IF_NONE_MATC; + default: return -1; - } - goto IF_NONE_MATC; - - default: - return -1; } IF_NONE_MATC: NEXT_CHAR(); switch (ch) { - - case 'H': - if (last) { - return 39; - } - goto IF_NONE_MATCH; - - - case 'h': - if (last) { - return 39; - } - goto IF_NONE_MATCH; - - default: - return -1; + case 'H': + if (last) { + return 39; + } + goto IF_NONE_MATCH; + case 'h': + if (last) { + return 39; + } + goto IF_NONE_MATCH; + default: + return -1; } IF_NONE_MATCH: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } IF_R: NEXT_CHAR(); switch (ch) { - - case 'A': - if (last) { + case 'A': + if (last) { + return -1; + } + goto IF_RA; + case 'a': + if (last) { + return -1; + } + goto IF_RA; + default: return -1; - } - goto IF_RA; - - - case 'a': - if (last) { - return -1; - } - goto IF_RA; - - default: - return -1; } IF_RA: NEXT_CHAR(); switch (ch) { - - case 'N': - if (last) { - return -1; - } - goto IF_RAN; - - - case 'n': - if (last) { + case 'N': + if (last) { + return -1; + } + goto IF_RAN; + case 'n': + if (last) { + return -1; + } + goto IF_RAN; + default: return -1; - } - goto IF_RAN; - - default: - return -1; } IF_RAN: NEXT_CHAR(); switch (ch) { - - case 'G': - if (last) { - return -1; - } - goto IF_RANG; - - - case 'g': - if (last) { + case 'G': + if (last) { + return -1; + } + goto IF_RANG; + case 'g': + if (last) { + return -1; + } + goto IF_RANG; + default: return -1; - } - goto IF_RANG; - - default: - return -1; } IF_RANG: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return 40; - } - goto IF_RANGE; - - - case 'e': - if (last) { - return 40; - } - goto IF_RANGE; - - default: - return -1; + case 'E': + if (last) { + return 40; + } + goto IF_RANGE; + case 'e': + if (last) { + return 40; + } + goto IF_RANGE; + default: + return -1; } IF_RANGE: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } IF_U: NEXT_CHAR(); switch (ch) { - - case 'N': - if (last) { - return -1; - } - goto IF_UN; - - - case 'n': - if (last) { + case 'N': + if (last) { + return -1; + } + goto IF_UN; + case 'n': + if (last) { + return -1; + } + goto IF_UN; + default: return -1; - } - goto IF_UN; - - default: - return -1; } IF_UN: NEXT_CHAR(); switch (ch) { - - case 'M': - if (last) { - return -1; - } - goto IF_UNM; - - - case 'm': - if (last) { + case 'M': + if (last) { + return -1; + } + goto IF_UNM; + case 'm': + if (last) { + return -1; + } + goto IF_UNM; + default: return -1; - } - goto IF_UNM; - - default: - return -1; } IF_UNM: NEXT_CHAR(); switch (ch) { - - case 'O': - if (last) { - return -1; - } - goto IF_UNMO; - - - case 'o': - if (last) { + case 'O': + if (last) { + return -1; + } + goto IF_UNMO; + case 'o': + if (last) { + return -1; + } + goto IF_UNMO; + default: return -1; - } - goto IF_UNMO; - - default: - return -1; } IF_UNMO: NEXT_CHAR(); switch (ch) { - - case 'D': - if (last) { + case 'D': + if (last) { + return -1; + } + goto IF_UNMOD; + case 'd': + if (last) { + return -1; + } + goto IF_UNMOD; + default: return -1; - } - goto IF_UNMOD; - - - case 'd': - if (last) { - return -1; - } - goto IF_UNMOD; - - default: - return -1; } IF_UNMOD: NEXT_CHAR(); switch (ch) { - - case 'I': - if (last) { - return -1; - } - goto IF_UNMODI; - - - case 'i': - if (last) { + case 'I': + if (last) { + return -1; + } + goto IF_UNMODI; + case 'i': + if (last) { + return -1; + } + goto IF_UNMODI; + default: return -1; - } - goto IF_UNMODI; - - default: - return -1; } IF_UNMODI: NEXT_CHAR(); switch (ch) { - - case 'F': - if (last) { - return -1; - } - goto IF_UNMODIF; - - - case 'f': - if (last) { + case 'F': + if (last) { + return -1; + } + goto IF_UNMODIF; + case 'f': + if (last) { + return -1; + } + goto IF_UNMODIF; + default: return -1; - } - goto IF_UNMODIF; - - default: - return -1; } IF_UNMODIF: NEXT_CHAR(); switch (ch) { - - case 'I': - if (last) { - return -1; - } - goto IF_UNMODIFI; - - - case 'i': - if (last) { + case 'I': + if (last) { + return -1; + } + goto IF_UNMODIFI; + case 'i': + if (last) { + return -1; + } + goto IF_UNMODIFI; + default: return -1; - } - goto IF_UNMODIFI; - - default: - return -1; } IF_UNMODIFI: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { + case 'E': + if (last) { + return -1; + } + goto IF_UNMODIFIE; + case 'e': + if (last) { + return -1; + } + goto IF_UNMODIFIE; + default: return -1; - } - goto IF_UNMODIFIE; - - - case 'e': - if (last) { - return -1; - } - goto IF_UNMODIFIE; - - default: - return -1; } IF_UNMODIFIE: NEXT_CHAR(); switch (ch) { - - case 'D': - if (last) { - return -1; - } - goto IF_UNMODIFIED; - - - case 'd': - if (last) { + case 'D': + if (last) { + return -1; + } + goto IF_UNMODIFIED; + case 'd': + if (last) { + return -1; + } + goto IF_UNMODIFIED; + default: return -1; - } - goto IF_UNMODIFIED; - - default: - return -1; } IF_UNMODIFIED: NEXT_CHAR(); switch (ch) { - - case '-': - if (last) { + case '-': + if (last) { + return -1; + } + goto IF_UNMODIFIED_; + default: return -1; - } - goto IF_UNMODIFIED_; - - default: - return -1; } IF_UNMODIFIED_: NEXT_CHAR(); switch (ch) { - - case 'S': - if (last) { + case 'S': + if (last) { + return -1; + } + goto IF_UNMODIFIED_S; + case 's': + if (last) { + return -1; + } + goto IF_UNMODIFIED_S; + default: return -1; - } - goto IF_UNMODIFIED_S; - - - case 's': - if (last) { - return -1; - } - goto IF_UNMODIFIED_S; - - default: - return -1; } IF_UNMODIFIED_S: NEXT_CHAR(); switch (ch) { - - case 'I': - if (last) { - return -1; - } - goto IF_UNMODIFIED_SI; - - - case 'i': - if (last) { + case 'I': + if (last) { + return -1; + } + goto IF_UNMODIFIED_SI; + case 'i': + if (last) { + return -1; + } + goto IF_UNMODIFIED_SI; + default: return -1; - } - goto IF_UNMODIFIED_SI; - - default: - return -1; } IF_UNMODIFIED_SI: NEXT_CHAR(); switch (ch) { - - case 'N': - if (last) { - return -1; - } - goto IF_UNMODIFIED_SIN; - - - case 'n': - if (last) { + case 'N': + if (last) { + return -1; + } + goto IF_UNMODIFIED_SIN; + case 'n': + if (last) { + return -1; + } + goto IF_UNMODIFIED_SIN; + default: return -1; - } - goto IF_UNMODIFIED_SIN; - - default: - return -1; } IF_UNMODIFIED_SIN: NEXT_CHAR(); switch (ch) { - - case 'C': - if (last) { - return -1; - } - goto IF_UNMODIFIED_SINC; - - - case 'c': - if (last) { + case 'C': + if (last) { + return -1; + } + goto IF_UNMODIFIED_SINC; + case 'c': + if (last) { + return -1; + } + goto IF_UNMODIFIED_SINC; + default: return -1; - } - goto IF_UNMODIFIED_SINC; - - default: - return -1; } IF_UNMODIFIED_SINC: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return 41; - } - goto IF_UNMODIFIED_SINCE; - - - case 'e': - if (last) { - return 41; - } - goto IF_UNMODIFIED_SINCE; - - default: - return -1; + case 'E': + if (last) { + return 41; + } + goto IF_UNMODIFIED_SINCE; + case 'e': + if (last) { + return 41; + } + goto IF_UNMODIFIED_SINCE; + default: + return -1; } IF_UNMODIFIED_SINCE: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } K: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return -1; - } - goto KE; - - - case 'e': - if (last) { + case 'E': + if (last) { + return -1; + } + goto KE; + case 'e': + if (last) { + return -1; + } + goto KE; + default: return -1; - } - goto KE; - - default: - return -1; } KE: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return -1; - } - goto KEE; - - - case 'e': - if (last) { + case 'E': + if (last) { + return -1; + } + goto KEE; + case 'e': + if (last) { + return -1; + } + goto KEE; + default: return -1; - } - goto KEE; - - default: - return -1; } KEE: NEXT_CHAR(); switch (ch) { - - case 'P': - if (last) { + case 'P': + if (last) { + return -1; + } + goto KEEP; + case 'p': + if (last) { + return -1; + } + goto KEEP; + default: return -1; - } - goto KEEP; - - - case 'p': - if (last) { - return -1; - } - goto KEEP; - - default: - return -1; } KEEP: NEXT_CHAR(); switch (ch) { - - case '-': - if (last) { + case '-': + if (last) { + return -1; + } + goto KEEP_; + default: return -1; - } - goto KEEP_; - - default: - return -1; } KEEP_: NEXT_CHAR(); switch (ch) { - - case 'A': - if (last) { - return -1; - } - goto KEEP_A; - - - case 'a': - if (last) { + case 'A': + if (last) { + return -1; + } + goto KEEP_A; + case 'a': + if (last) { + return -1; + } + goto KEEP_A; + default: return -1; - } - goto KEEP_A; - - default: - return -1; } KEEP_A: NEXT_CHAR(); switch (ch) { - - case 'L': - if (last) { + case 'L': + if (last) { + return -1; + } + goto KEEP_AL; + case 'l': + if (last) { + return -1; + } + goto KEEP_AL; + default: return -1; - } - goto KEEP_AL; - - - case 'l': - if (last) { - return -1; - } - goto KEEP_AL; - - default: - return -1; } KEEP_AL: NEXT_CHAR(); switch (ch) { - - case 'I': - if (last) { - return -1; - } - goto KEEP_ALI; - - - case 'i': - if (last) { + case 'I': + if (last) { + return -1; + } + goto KEEP_ALI; + case 'i': + if (last) { + return -1; + } + goto KEEP_ALI; + default: return -1; - } - goto KEEP_ALI; - - default: - return -1; } -KEEP_ALI: - NEXT_CHAR(); - switch (ch) { - - case 'V': - if (last) { - return -1; - } - goto KEEP_ALIV; - - - case 'v': - if (last) { +KEEP_ALI: + NEXT_CHAR(); + switch (ch) { + case 'V': + if (last) { + return -1; + } + goto KEEP_ALIV; + case 'v': + if (last) { + return -1; + } + goto KEEP_ALIV; + default: return -1; - } - goto KEEP_ALIV; - - default: - return -1; } KEEP_ALIV: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return 42; - } - goto KEEP_ALIVE; - - - case 'e': - if (last) { - return 42; - } - goto KEEP_ALIVE; - - default: - return -1; + case 'E': + if (last) { + return 42; + } + goto KEEP_ALIVE; + case 'e': + if (last) { + return 42; + } + goto KEEP_ALIVE; + default: + return -1; } KEEP_ALIVE: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } L: NEXT_CHAR(); switch (ch) { - - case 'A': - if (last) { - return -1; - } - goto LA; - - - case 'a': - if (last) { - return -1; - } - goto LA; - - - case 'I': - if (last) { - return -1; - } - goto LI; - - - case 'i': - if (last) { - return -1; - } - goto LI; - - - case 'O': - if (last) { - return -1; - } - goto LO; - - - case 'o': - if (last) { + case 'A': + if (last) { + return -1; + } + goto LA; + case 'a': + if (last) { + return -1; + } + goto LA; + case 'I': + if (last) { + return -1; + } + goto LI; + case 'i': + if (last) { + return -1; + } + goto LI; + case 'O': + if (last) { + return -1; + } + goto LO; + case 'o': + if (last) { + return -1; + } + goto LO; + default: return -1; - } - goto LO; - - default: - return -1; } LA: NEXT_CHAR(); switch (ch) { - - case 'S': - if (last) { + case 'S': + if (last) { + return -1; + } + goto LAS; + case 's': + if (last) { + return -1; + } + goto LAS; + default: return -1; - } - goto LAS; - - - case 's': - if (last) { - return -1; - } - goto LAS; - - default: - return -1; } LAS: NEXT_CHAR(); switch (ch) { - - case 'T': - if (last) { - return -1; - } - goto LAST; - - - case 't': - if (last) { + case 'T': + if (last) { + return -1; + } + goto LAST; + case 't': + if (last) { + return -1; + } + goto LAST; + default: return -1; - } - goto LAST; - - default: - return -1; } LAST: NEXT_CHAR(); switch (ch) { - - case '-': - if (last) { + case '-': + if (last) { + return -1; + } + goto LAST_; + default: return -1; - } - goto LAST_; - - default: - return -1; } LAST_: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return -1; - } - goto LAST_E; - - - case 'e': - if (last) { - return -1; - } - goto LAST_E; - - - case 'M': - if (last) { - return -1; - } - goto LAST_M; - - - case 'm': - if (last) { + case 'E': + if (last) { + return -1; + } + goto LAST_E; + case 'e': + if (last) { + return -1; + } + goto LAST_E; + case 'M': + if (last) { + return -1; + } + goto LAST_M; + case 'm': + if (last) { + return -1; + } + goto LAST_M; + default: return -1; - } - goto LAST_M; - - default: - return -1; } LAST_E: NEXT_CHAR(); switch (ch) { - - case 'V': - if (last) { - return -1; - } - goto LAST_EV; - - - case 'v': - if (last) { + case 'V': + if (last) { + return -1; + } + goto LAST_EV; + case 'v': + if (last) { + return -1; + } + goto LAST_EV; + default: return -1; - } - goto LAST_EV; - - default: - return -1; } LAST_EV: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { + case 'E': + if (last) { + return -1; + } + goto LAST_EVE; + case 'e': + if (last) { + return -1; + } + goto LAST_EVE; + default: return -1; - } - goto LAST_EVE; - - - case 'e': - if (last) { - return -1; - } - goto LAST_EVE; - - default: - return -1; } LAST_EVE: NEXT_CHAR(); switch (ch) { - - case 'N': - if (last) { - return -1; - } - goto LAST_EVEN; - - - case 'n': - if (last) { + case 'N': + if (last) { + return -1; + } + goto LAST_EVEN; + case 'n': + if (last) { + return -1; + } + goto LAST_EVEN; + default: return -1; - } - goto LAST_EVEN; - - default: - return -1; } LAST_EVEN: NEXT_CHAR(); switch (ch) { - - case 'T': - if (last) { - return -1; - } - goto LAST_EVENT; - - - case 't': - if (last) { + case 'T': + if (last) { + return -1; + } + goto LAST_EVENT; + case 't': + if (last) { + return -1; + } + goto LAST_EVENT; + default: return -1; - } - goto LAST_EVENT; - - default: - return -1; } LAST_EVENT: NEXT_CHAR(); switch (ch) { - - case '-': - if (last) { + case '-': + if (last) { + return -1; + } + goto LAST_EVENT_; + default: return -1; - } - goto LAST_EVENT_; - - default: - return -1; } LAST_EVENT_: NEXT_CHAR(); switch (ch) { - - case 'I': - if (last) { - return -1; - } - goto LAST_EVENT_I; - - - case 'i': - if (last) { + case 'I': + if (last) { + return -1; + } + goto LAST_EVENT_I; + case 'i': + if (last) { + return -1; + } + goto LAST_EVENT_I; + default: return -1; - } - goto LAST_EVENT_I; - - default: - return -1; } LAST_EVENT_I: NEXT_CHAR(); switch (ch) { - - case 'D': - if (last) { - return 43; - } - goto LAST_EVENT_ID; - - - case 'd': - if (last) { - return 43; - } - goto LAST_EVENT_ID; - - default: - return -1; + case 'D': + if (last) { + return 43; + } + goto LAST_EVENT_ID; + case 'd': + if (last) { + return 43; + } + goto LAST_EVENT_ID; + default: + return -1; } LAST_EVENT_ID: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } LAST_M: NEXT_CHAR(); switch (ch) { - - case 'O': - if (last) { + case 'O': + if (last) { + return -1; + } + goto LAST_MO; + case 'o': + if (last) { + return -1; + } + goto LAST_MO; + default: return -1; - } - goto LAST_MO; - - - case 'o': - if (last) { - return -1; - } - goto LAST_MO; - - default: - return -1; } LAST_MO: NEXT_CHAR(); switch (ch) { - - case 'D': - if (last) { - return -1; - } - goto LAST_MOD; - - - case 'd': - if (last) { + case 'D': + if (last) { + return -1; + } + goto LAST_MOD; + case 'd': + if (last) { + return -1; + } + goto LAST_MOD; + default: return -1; - } - goto LAST_MOD; - - default: - return -1; } LAST_MOD: NEXT_CHAR(); switch (ch) { - - case 'I': - if (last) { - return -1; - } - goto LAST_MODI; - - - case 'i': - if (last) { + case 'I': + if (last) { + return -1; + } + goto LAST_MODI; + case 'i': + if (last) { + return -1; + } + goto LAST_MODI; + default: return -1; - } - goto LAST_MODI; - - default: - return -1; } LAST_MODI: NEXT_CHAR(); switch (ch) { - - case 'F': - if (last) { - return -1; - } - goto LAST_MODIF; - - - case 'f': - if (last) { + case 'F': + if (last) { + return -1; + } + goto LAST_MODIF; + case 'f': + if (last) { + return -1; + } + goto LAST_MODIF; + default: return -1; - } - goto LAST_MODIF; - - default: - return -1; } LAST_MODIF: NEXT_CHAR(); switch (ch) { - - case 'I': - if (last) { + case 'I': + if (last) { + return -1; + } + goto LAST_MODIFI; + case 'i': + if (last) { + return -1; + } + goto LAST_MODIFI; + default: return -1; - } - goto LAST_MODIFI; - - - case 'i': - if (last) { - return -1; - } - goto LAST_MODIFI; - - default: - return -1; } LAST_MODIFI: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return -1; - } - goto LAST_MODIFIE; - - - case 'e': - if (last) { + case 'E': + if (last) { + return -1; + } + goto LAST_MODIFIE; + case 'e': + if (last) { + return -1; + } + goto LAST_MODIFIE; + default: return -1; - } - goto LAST_MODIFIE; - - default: - return -1; } LAST_MODIFIE: NEXT_CHAR(); switch (ch) { - - case 'D': - if (last) { - return 44; - } - goto LAST_MODIFIED; - - - case 'd': - if (last) { - return 44; - } - goto LAST_MODIFIED; - - default: - return -1; + case 'D': + if (last) { + return 44; + } + goto LAST_MODIFIED; + case 'd': + if (last) { + return 44; + } + goto LAST_MODIFIED; + default: + return -1; } LAST_MODIFIED: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } LI: NEXT_CHAR(); switch (ch) { - - case 'N': - if (last) { + case 'N': + if (last) { + return -1; + } + goto LIN; + case 'n': + if (last) { + return -1; + } + goto LIN; + default: return -1; - } - goto LIN; - - - case 'n': - if (last) { - return -1; - } - goto LIN; - - default: - return -1; } LIN: NEXT_CHAR(); switch (ch) { - - case 'K': - if (last) { - return 45; - } - goto LINK; - - - case 'k': - if (last) { - return 45; - } - goto LINK; - - default: - return -1; + case 'K': + if (last) { + return 45; + } + goto LINK; + case 'k': + if (last) { + return 45; + } + goto LINK; + default: + return -1; } LINK: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } LO: NEXT_CHAR(); switch (ch) { - - case 'C': - if (last) { - return -1; - } - goto LOC; - - - case 'c': - if (last) { + case 'C': + if (last) { + return -1; + } + goto LOC; + case 'c': + if (last) { + return -1; + } + goto LOC; + default: return -1; - } - goto LOC; - - default: - return -1; } LOC: NEXT_CHAR(); switch (ch) { - - case 'A': - if (last) { + case 'A': + if (last) { + return -1; + } + goto LOCA; + case 'a': + if (last) { + return -1; + } + goto LOCA; + default: return -1; - } - goto LOCA; - - - case 'a': - if (last) { - return -1; - } - goto LOCA; - - default: - return -1; } LOCA: NEXT_CHAR(); switch (ch) { - - case 'T': - if (last) { - return -1; - } - goto LOCAT; - - - case 't': - if (last) { + case 'T': + if (last) { + return -1; + } + goto LOCAT; + case 't': + if (last) { + return -1; + } + goto LOCAT; + default: return -1; - } - goto LOCAT; - - default: - return -1; } LOCAT: NEXT_CHAR(); switch (ch) { - - case 'I': - if (last) { - return -1; - } - goto LOCATI; - - - case 'i': - if (last) { + case 'I': + if (last) { + return -1; + } + goto LOCATI; + case 'i': + if (last) { + return -1; + } + goto LOCATI; + default: return -1; - } - goto LOCATI; - - default: - return -1; } LOCATI: NEXT_CHAR(); switch (ch) { - - case 'O': - if (last) { - return -1; - } - goto LOCATIO; - - - case 'o': - if (last) { + case 'O': + if (last) { + return -1; + } + goto LOCATIO; + case 'o': + if (last) { + return -1; + } + goto LOCATIO; + default: return -1; - } - goto LOCATIO; - - default: - return -1; } LOCATIO: NEXT_CHAR(); switch (ch) { - - case 'N': - if (last) { - return 46; - } - goto LOCATION; - - - case 'n': - if (last) { - return 46; - } - goto LOCATION; - - default: - return -1; + case 'N': + if (last) { + return 46; + } + goto LOCATION; + case 'n': + if (last) { + return 46; + } + goto LOCATION; + default: + return -1; } LOCATION: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } M: NEXT_CHAR(); switch (ch) { - - case 'A': - if (last) { - return -1; - } - goto MA; - - - case 'a': - if (last) { + case 'A': + if (last) { + return -1; + } + goto MA; + case 'a': + if (last) { + return -1; + } + goto MA; + default: return -1; - } - goto MA; - - default: - return -1; } MA: NEXT_CHAR(); switch (ch) { - - case 'X': - if (last) { - return -1; - } - goto MAX; - - - case 'x': - if (last) { + case 'X': + if (last) { + return -1; + } + goto MAX; + case 'x': + if (last) { + return -1; + } + goto MAX; + default: return -1; - } - goto MAX; - - default: - return -1; } MAX: NEXT_CHAR(); switch (ch) { - - case '-': - if (last) { + case '-': + if (last) { + return -1; + } + goto MAX_; + default: return -1; - } - goto MAX_; - - default: - return -1; } MAX_: NEXT_CHAR(); switch (ch) { - - case 'F': - if (last) { - return -1; - } - goto MAX_F; - - - case 'f': - if (last) { + case 'F': + if (last) { + return -1; + } + goto MAX_F; + case 'f': + if (last) { + return -1; + } + goto MAX_F; + default: return -1; - } - goto MAX_F; - - default: - return -1; } MAX_F: NEXT_CHAR(); switch (ch) { - - case 'O': - if (last) { - return -1; - } - goto MAX_FO; - - - case 'o': - if (last) { + case 'O': + if (last) { + return -1; + } + goto MAX_FO; + case 'o': + if (last) { + return -1; + } + goto MAX_FO; + default: return -1; - } - goto MAX_FO; - - default: - return -1; } MAX_FO: NEXT_CHAR(); switch (ch) { - - case 'R': - if (last) { + case 'R': + if (last) { + return -1; + } + goto MAX_FOR; + case 'r': + if (last) { + return -1; + } + goto MAX_FOR; + default: return -1; - } - goto MAX_FOR; - - - case 'r': - if (last) { - return -1; - } - goto MAX_FOR; - - default: - return -1; } MAX_FOR: NEXT_CHAR(); switch (ch) { - - case 'W': - if (last) { - return -1; - } - goto MAX_FORW; - - - case 'w': - if (last) { + case 'W': + if (last) { + return -1; + } + goto MAX_FORW; + case 'w': + if (last) { + return -1; + } + goto MAX_FORW; + default: return -1; - } - goto MAX_FORW; - - default: - return -1; } MAX_FORW: NEXT_CHAR(); switch (ch) { - - case 'A': - if (last) { - return -1; - } - goto MAX_FORWA; - - - case 'a': - if (last) { + case 'A': + if (last) { + return -1; + } + goto MAX_FORWA; + case 'a': + if (last) { + return -1; + } + goto MAX_FORWA; + default: return -1; - } - goto MAX_FORWA; - - default: - return -1; } MAX_FORWA: NEXT_CHAR(); switch (ch) { - - case 'R': - if (last) { - return -1; - } - goto MAX_FORWAR; - - - case 'r': - if (last) { + case 'R': + if (last) { + return -1; + } + goto MAX_FORWAR; + case 'r': + if (last) { + return -1; + } + goto MAX_FORWAR; + default: return -1; - } - goto MAX_FORWAR; - - default: - return -1; } MAX_FORWAR: NEXT_CHAR(); switch (ch) { - - case 'D': - if (last) { + case 'D': + if (last) { + return -1; + } + goto MAX_FORWARD; + case 'd': + if (last) { + return -1; + } + goto MAX_FORWARD; + default: return -1; - } - goto MAX_FORWARD; - - - case 'd': - if (last) { - return -1; - } - goto MAX_FORWARD; - - default: - return -1; } MAX_FORWARD: NEXT_CHAR(); switch (ch) { - - case 'S': - if (last) { - return 47; - } - goto MAX_FORWARDS; - - - case 's': - if (last) { - return 47; - } - goto MAX_FORWARDS; - - default: - return -1; + case 'S': + if (last) { + return 47; + } + goto MAX_FORWARDS; + case 's': + if (last) { + return 47; + } + goto MAX_FORWARDS; + default: + return -1; } MAX_FORWARDS: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } O: NEXT_CHAR(); switch (ch) { - - case 'R': - if (last) { - return -1; - } - goto OR; - - - case 'r': - if (last) { + case 'R': + if (last) { + return -1; + } + goto OR; + case 'r': + if (last) { + return -1; + } + goto OR; + default: return -1; - } - goto OR; - - default: - return -1; } OR: NEXT_CHAR(); switch (ch) { - - case 'I': - if (last) { + case 'I': + if (last) { + return -1; + } + goto ORI; + case 'i': + if (last) { + return -1; + } + goto ORI; + default: return -1; - } - goto ORI; - - - case 'i': - if (last) { - return -1; - } - goto ORI; - - default: - return -1; } ORI: NEXT_CHAR(); switch (ch) { - - case 'G': - if (last) { - return -1; - } - goto ORIG; - - - case 'g': - if (last) { + case 'G': + if (last) { + return -1; + } + goto ORIG; + case 'g': + if (last) { + return -1; + } + goto ORIG; + default: return -1; - } - goto ORIG; - - default: - return -1; } ORIG: NEXT_CHAR(); switch (ch) { - - case 'I': - if (last) { - return -1; - } - goto ORIGI; - - - case 'i': - if (last) { + case 'I': + if (last) { + return -1; + } + goto ORIGI; + case 'i': + if (last) { + return -1; + } + goto ORIGI; + default: return -1; - } - goto ORIGI; - - default: - return -1; } ORIGI: NEXT_CHAR(); switch (ch) { - - case 'N': - if (last) { - return 48; - } - goto ORIGIN; - - - case 'n': - if (last) { - return 48; - } - goto ORIGIN; - - default: - return -1; + case 'N': + if (last) { + return 48; + } + goto ORIGIN; + case 'n': + if (last) { + return 48; + } + goto ORIGIN; + default: + return -1; } ORIGIN: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } P: NEXT_CHAR(); switch (ch) { - - case 'R': - if (last) { - return -1; - } - goto PR; - - - case 'r': - if (last) { + case 'R': + if (last) { + return -1; + } + goto PR; + case 'r': + if (last) { + return -1; + } + goto PR; + default: return -1; - } - goto PR; - - default: - return -1; } PR: NEXT_CHAR(); - switch (ch) { - - case 'A': - if (last) { - return -1; - } - goto PRA; - - - case 'a': - if (last) { - return -1; - } - goto PRA; - - - case 'O': - if (last) { - return -1; - } - goto PRO; - - - case 'o': - if (last) { + switch (ch) { + case 'A': + if (last) { + return -1; + } + goto PRA; + case 'a': + if (last) { + return -1; + } + goto PRA; + case 'O': + if (last) { + return -1; + } + goto PRO; + case 'o': + if (last) { + return -1; + } + goto PRO; + default: return -1; - } - goto PRO; - - default: - return -1; } PRA: NEXT_CHAR(); switch (ch) { - - case 'G': - if (last) { - return -1; - } - goto PRAG; - - - case 'g': - if (last) { + case 'G': + if (last) { + return -1; + } + goto PRAG; + case 'g': + if (last) { + return -1; + } + goto PRAG; + default: return -1; - } - goto PRAG; - - default: - return -1; } PRAG: NEXT_CHAR(); switch (ch) { - - case 'M': - if (last) { + case 'M': + if (last) { + return -1; + } + goto PRAGM; + case 'm': + if (last) { + return -1; + } + goto PRAGM; + default: return -1; - } - goto PRAGM; - - - case 'm': - if (last) { - return -1; - } - goto PRAGM; - - default: - return -1; } PRAGM: NEXT_CHAR(); switch (ch) { - - case 'A': - if (last) { - return 49; - } - goto PRAGMA; - - - case 'a': - if (last) { - return 49; - } - goto PRAGMA; - - default: - return -1; + case 'A': + if (last) { + return 49; + } + goto PRAGMA; + case 'a': + if (last) { + return 49; + } + goto PRAGMA; + default: + return -1; } PRAGMA: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } PRO: NEXT_CHAR(); switch (ch) { - - case 'X': - if (last) { - return -1; - } - goto PROX; - - - case 'x': - if (last) { + case 'X': + if (last) { + return -1; + } + goto PROX; + case 'x': + if (last) { + return -1; + } + goto PROX; + default: return -1; - } - goto PROX; - - default: - return -1; } PROX: NEXT_CHAR(); switch (ch) { - - case 'Y': - if (last) { + case 'Y': + if (last) { + return -1; + } + goto PROXY; + case 'y': + if (last) { + return -1; + } + goto PROXY; + default: return -1; - } - goto PROXY; - - - case 'y': - if (last) { - return -1; - } - goto PROXY; - - default: - return -1; } PROXY: NEXT_CHAR(); switch (ch) { - - case '_': - if (last) { - return -1; - } - goto PROXY_; - - - case '-': - if (last) { + case '_': + if (last) { + return -1; + } + goto PROXY_; + case '-': + if (last) { + return -1; + } + goto PROXY_; + default: return -1; - } - goto PROXY_; - - default: - return -1; } PROXY_: NEXT_CHAR(); switch (ch) { - - case 'A': - if (last) { - return -1; - } - goto PROXY_A; - - - case 'a': - if (last) { + case 'A': + if (last) { + return -1; + } + goto PROXY_A; + case 'a': + if (last) { + return -1; + } + goto PROXY_A; + default: return -1; - } - goto PROXY_A; - - default: - return -1; } PROXY_A: NEXT_CHAR(); switch (ch) { - - case 'U': - if (last) { - return -1; - } - goto PROXY_AU; - - - case 'u': - if (last) { + case 'U': + if (last) { + return -1; + } + goto PROXY_AU; + case 'u': + if (last) { + return -1; + } + goto PROXY_AU; + default: return -1; - } - goto PROXY_AU; - - default: - return -1; } PROXY_AU: NEXT_CHAR(); switch (ch) { - - case 'T': - if (last) { + case 'T': + if (last) { + return -1; + } + goto PROXY_AUT; + case 't': + if (last) { + return -1; + } + goto PROXY_AUT; + default: return -1; - } - goto PROXY_AUT; - - - case 't': - if (last) { - return -1; - } - goto PROXY_AUT; - - default: - return -1; } PROXY_AUT: NEXT_CHAR(); switch (ch) { - - case 'H': - if (last) { - return -1; - } - goto PROXY_AUTH; - - - case 'h': - if (last) { + case 'H': + if (last) { + return -1; + } + goto PROXY_AUTH; + case 'h': + if (last) { + return -1; + } + goto PROXY_AUTH; + default: return -1; - } - goto PROXY_AUTH; - - default: - return -1; } PROXY_AUTH: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return -1; - } - goto PROXY_AUTHE; - - - case 'e': - if (last) { + case 'E': + if (last) { + return -1; + } + goto PROXY_AUTHE; + case 'e': + if (last) { + return -1; + } + goto PROXY_AUTHE; + default: return -1; - } - goto PROXY_AUTHE; - - default: - return -1; } PROXY_AUTHE: NEXT_CHAR(); switch (ch) { - - case 'N': - if (last) { - return -1; - } - goto PROXY_AUTHEN; - - - case 'n': - if (last) { + case 'N': + if (last) { + return -1; + } + goto PROXY_AUTHEN; + case 'n': + if (last) { + return -1; + } + goto PROXY_AUTHEN; + default: return -1; - } - goto PROXY_AUTHEN; - - default: - return -1; } PROXY_AUTHEN: NEXT_CHAR(); switch (ch) { - - case 'T': - if (last) { + case 'T': + if (last) { + return -1; + } + goto PROXY_AUTHENT; + case 't': + if (last) { + return -1; + } + goto PROXY_AUTHENT; + default: return -1; - } - goto PROXY_AUTHENT; - - - case 't': - if (last) { - return -1; - } - goto PROXY_AUTHENT; - - default: - return -1; } PROXY_AUTHENT: NEXT_CHAR(); switch (ch) { - - case 'I': - if (last) { - return -1; - } - goto PROXY_AUTHENTI; - - - case 'i': - if (last) { + case 'I': + if (last) { + return -1; + } + goto PROXY_AUTHENTI; + case 'i': + if (last) { + return -1; + } + goto PROXY_AUTHENTI; + default: return -1; - } - goto PROXY_AUTHENTI; - - default: - return -1; } PROXY_AUTHENTI: NEXT_CHAR(); switch (ch) { - - case 'C': - if (last) { - return -1; - } - goto PROXY_AUTHENTIC; - - - case 'c': - if (last) { + case 'C': + if (last) { + return -1; + } + goto PROXY_AUTHENTIC; + case 'c': + if (last) { + return -1; + } + goto PROXY_AUTHENTIC; + default: return -1; - } - goto PROXY_AUTHENTIC; - - default: - return -1; } PROXY_AUTHENTIC: NEXT_CHAR(); switch (ch) { - - case 'A': - if (last) { - return -1; - } - goto PROXY_AUTHENTICA; - - - case 'a': - if (last) { + case 'A': + if (last) { + return -1; + } + goto PROXY_AUTHENTICA; + case 'a': + if (last) { + return -1; + } + goto PROXY_AUTHENTICA; + default: return -1; - } - goto PROXY_AUTHENTICA; - - default: - return -1; } PROXY_AUTHENTICA: NEXT_CHAR(); switch (ch) { - - case 'T': - if (last) { + case 'T': + if (last) { + return -1; + } + goto PROXY_AUTHENTICAT; + case 't': + if (last) { + return -1; + } + goto PROXY_AUTHENTICAT; + default: return -1; - } - goto PROXY_AUTHENTICAT; - - - case 't': - if (last) { - return -1; - } - goto PROXY_AUTHENTICAT; - - default: - return -1; } PROXY_AUTHENTICAT: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return 50; - } - goto PROXY_AUTHENTICATE; - - - case 'e': - if (last) { - return 50; - } - goto PROXY_AUTHENTICATE; - - default: - return -1; + case 'E': + if (last) { + return 50; + } + goto PROXY_AUTHENTICATE; + case 'e': + if (last) { + return 50; + } + goto PROXY_AUTHENTICATE; + default: + return -1; } PROXY_AUTHENTICATE: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } R: NEXT_CHAR(); switch (ch) { - - case 'A': - if (last) { - return -1; - } - goto RA; - - - case 'a': - if (last) { - return -1; - } - goto RA; - - - case 'E': - if (last) { - return -1; - } - goto RE; - - - case 'e': - if (last) { + case 'A': + if (last) { + return -1; + } + goto RA; + case 'a': + if (last) { + return -1; + } + goto RA; + case 'E': + if (last) { + return -1; + } + goto RE; + case 'e': + if (last) { + return -1; + } + goto RE; + default: return -1; - } - goto RE; - - default: - return -1; } RA: NEXT_CHAR(); switch (ch) { - - case 'N': - if (last) { - return -1; - } - goto RAN; - - - case 'n': - if (last) { + case 'N': + if (last) { + return -1; + } + goto RAN; + case 'n': + if (last) { + return -1; + } + goto RAN; + default: return -1; - } - goto RAN; - - default: - return -1; } RAN: NEXT_CHAR(); switch (ch) { - - case 'G': - if (last) { - return -1; - } - goto RANG; - - - case 'g': - if (last) { + case 'G': + if (last) { + return -1; + } + goto RANG; + case 'g': + if (last) { + return -1; + } + goto RANG; + default: return -1; - } - goto RANG; - - default: - return -1; } RANG: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return 52; - } - goto RANGE; - - - case 'e': - if (last) { - return 52; - } - goto RANGE; - - default: - return -1; + case 'E': + if (last) { + return 52; + } + goto RANGE; + case 'e': + if (last) { + return 52; + } + goto RANGE; + default: + return -1; } RANGE: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } RE: NEXT_CHAR(); switch (ch) { - - case 'F': - if (last) { - return -1; - } - goto REF; - - - case 'f': - if (last) { - return -1; - } - goto REF; - - - case 'T': - if (last) { + case 'F': + if (last) { + return -1; + } + goto REF; + case 'f': + if (last) { + return -1; + } + goto REF; + case 'T': + if (last) { + return -1; + } + goto RET; + case 't': + if (last) { + return -1; + } + goto RET; + default: return -1; - } - goto RET; - - - case 't': - if (last) { - return -1; - } - goto RET; - - default: - return -1; } REF: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return -1; - } - goto REFE; - - - case 'e': - if (last) { + case 'E': + if (last) { + return -1; + } + goto REFE; + case 'e': + if (last) { + return -1; + } + goto REFE; + default: return -1; - } - goto REFE; - - default: - return -1; } REFE: NEXT_CHAR(); switch (ch) { - - case 'R': - if (last) { - return -1; - } - goto REFER; - - - case 'r': - if (last) { + case 'R': + if (last) { + return -1; + } + goto REFER; + case 'r': + if (last) { + return -1; + } + goto REFER; + default: return -1; - } - goto REFER; - - default: - return -1; } REFER: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return -1; - } - goto REFERE; - - - case 'e': - if (last) { + case 'E': + if (last) { + return -1; + } + goto REFERE; + case 'e': + if (last) { + return -1; + } + goto REFERE; + default: return -1; - } - goto REFERE; - - default: - return -1; } REFERE: NEXT_CHAR(); switch (ch) { - - case 'R': - if (last) { - return 53; - } - goto REFERER; - - - case 'r': - if (last) { - return 53; - } - goto REFERER; - - default: - return -1; + case 'R': + if (last) { + return 53; + } + goto REFERER; + case 'r': + if (last) { + return 53; + } + goto REFERER; + default: + return -1; } REFERER: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } RET: NEXT_CHAR(); switch (ch) { - - case 'R': - if (last) { - return -1; - } - goto RETR; - - - case 'r': - if (last) { + case 'R': + if (last) { + return -1; + } + goto RETR; + case 'r': + if (last) { + return -1; + } + goto RETR; + default: return -1; - } - goto RETR; - - default: - return -1; } RETR: NEXT_CHAR(); switch (ch) { - - case 'Y': - if (last) { - return -1; - } - goto RETRY; - - - case 'y': - if (last) { + case 'Y': + if (last) { + return -1; + } + goto RETRY; + case 'y': + if (last) { + return -1; + } + goto RETRY; + default: return -1; - } - goto RETRY; - - default: - return -1; } RETRY: NEXT_CHAR(); switch (ch) { - - case '-': - if (last) { + case '-': + if (last) { + return -1; + } + goto RETRY_; + default: return -1; - } - goto RETRY_; - - default: - return -1; } RETRY_: NEXT_CHAR(); switch (ch) { - - case 'A': - if (last) { - return -1; - } - goto RETRY_A; - - - case 'a': - if (last) { + case 'A': + if (last) { + return -1; + } + goto RETRY_A; + case 'a': + if (last) { + return -1; + } + goto RETRY_A; + default: return -1; - } - goto RETRY_A; - - default: - return -1; } RETRY_A: NEXT_CHAR(); switch (ch) { - - case 'F': - if (last) { - return -1; - } - goto RETRY_AF; - - - case 'f': - if (last) { + case 'F': + if (last) { + return -1; + } + goto RETRY_AF; + case 'f': + if (last) { + return -1; + } + goto RETRY_AF; + default: return -1; - } - goto RETRY_AF; - - default: - return -1; } RETRY_AF: NEXT_CHAR(); switch (ch) { - - case 'T': - if (last) { + case 'T': + if (last) { + return -1; + } + goto RETRY_AFT; + case 't': + if (last) { + return -1; + } + goto RETRY_AFT; + default: return -1; - } - goto RETRY_AFT; - - - case 't': - if (last) { - return -1; - } - goto RETRY_AFT; - - default: - return -1; } RETRY_AFT: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return -1; - } - goto RETRY_AFTE; - - - case 'e': - if (last) { + case 'E': + if (last) { + return -1; + } + goto RETRY_AFTE; + case 'e': + if (last) { + return -1; + } + goto RETRY_AFTE; + default: return -1; - } - goto RETRY_AFTE; - - default: - return -1; } RETRY_AFTE: NEXT_CHAR(); switch (ch) { - - case 'R': - if (last) { - return 54; - } - goto RETRY_AFTER; - - - case 'r': - if (last) { - return 54; - } - goto RETRY_AFTER; - - default: - return -1; + case 'R': + if (last) { + return 54; + } + goto RETRY_AFTER; + case 'r': + if (last) { + return 54; + } + goto RETRY_AFTER; + default: + return -1; } RETRY_AFTER: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } S: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { + case 'E': + if (last) { + return -1; + } + goto SE; + case 'e': + if (last) { + return -1; + } + goto SE; + default: return -1; - } - goto SE; - - - case 'e': - if (last) { - return -1; - } - goto SE; - - default: - return -1; } SE: NEXT_CHAR(); switch (ch) { - - case 'C': - if (last) { - return -1; - } - goto SEC; - - - case 'c': - if (last) { - return -1; - } - goto SEC; - - - case 'R': - if (last) { - return -1; - } - goto SER; - - - case 'r': - if (last) { - return -1; - } - goto SER; - - - case 'T': - if (last) { - return -1; - } - goto SET; - - - case 't': - if (last) { + case 'C': + if (last) { + return -1; + } + goto SEC; + case 'c': + if (last) { + return -1; + } + goto SEC; + case 'R': + if (last) { + return -1; + } + goto SER; + case 'r': + if (last) { + return -1; + } + goto SER; + case 'T': + if (last) { + return -1; + } + goto SET; + case 't': + if (last) { + return -1; + } + goto SET; + default: return -1; - } - goto SET; - - default: - return -1; } SEC: NEXT_CHAR(); switch (ch) { - - case '-': - if (last) { + case '-': + if (last) { + return -1; + } + goto SEC_; + default: return -1; - } - goto SEC_; - - default: - return -1; } SEC_: NEXT_CHAR(); switch (ch) { - - case 'W': - if (last) { + case 'W': + if (last) { + return -1; + } + goto SEC_W; + case 'w': + if (last) { + return -1; + } + goto SEC_W; + default: return -1; - } - goto SEC_W; - - - case 'w': - if (last) { - return -1; - } - goto SEC_W; - - default: - return -1; } SEC_W: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return -1; - } - goto SEC_WE; - - - case 'e': - if (last) { + case 'E': + if (last) { + return -1; + } + goto SEC_WE; + case 'e': + if (last) { + return -1; + } + goto SEC_WE; + default: return -1; - } - goto SEC_WE; - - default: - return -1; } SEC_WE: NEXT_CHAR(); switch (ch) { - - case 'B': - if (last) { - return -1; - } - goto SEC_WEB; - - - case 'b': - if (last) { + case 'B': + if (last) { + return -1; + } + goto SEC_WEB; + case 'b': + if (last) { + return -1; + } + goto SEC_WEB; + default: return -1; - } - goto SEC_WEB; - - default: - return -1; } SEC_WEB: NEXT_CHAR(); switch (ch) { - - case 'S': - if (last) { - return -1; - } - goto SEC_WEBS; - - - case 's': - if (last) { + case 'S': + if (last) { + return -1; + } + goto SEC_WEBS; + case 's': + if (last) { + return -1; + } + goto SEC_WEBS; + default: return -1; - } - goto SEC_WEBS; - - default: - return -1; } SEC_WEBS: NEXT_CHAR(); switch (ch) { - - case 'O': - if (last) { + case 'O': + if (last) { + return -1; + } + goto SEC_WEBSO; + case 'o': + if (last) { + return -1; + } + goto SEC_WEBSO; + default: return -1; - } - goto SEC_WEBSO; - - - case 'o': - if (last) { - return -1; - } - goto SEC_WEBSO; - - default: - return -1; } SEC_WEBSO: NEXT_CHAR(); switch (ch) { - - case 'C': - if (last) { - return -1; - } - goto SEC_WEBSOC; - - - case 'c': - if (last) { + case 'C': + if (last) { + return -1; + } + goto SEC_WEBSOC; + case 'c': + if (last) { + return -1; + } + goto SEC_WEBSOC; + default: return -1; - } - goto SEC_WEBSOC; - - default: - return -1; } SEC_WEBSOC: NEXT_CHAR(); switch (ch) { - - case 'K': - if (last) { - return -1; - } - goto SEC_WEBSOCK; - - - case 'k': - if (last) { + case 'K': + if (last) { + return -1; + } + goto SEC_WEBSOCK; + case 'k': + if (last) { + return -1; + } + goto SEC_WEBSOCK; + default: return -1; - } - goto SEC_WEBSOCK; - - default: - return -1; } SEC_WEBSOCK: - NEXT_CHAR(); - switch (ch) { - - case 'E': - if (last) { - return -1; - } - goto SEC_WEBSOCKE; - - - case 'e': - if (last) { + NEXT_CHAR(); + switch (ch) { + case 'E': + if (last) { + return -1; + } + goto SEC_WEBSOCKE; + case 'e': + if (last) { + return -1; + } + goto SEC_WEBSOCKE; + default: return -1; - } - goto SEC_WEBSOCKE; - - default: - return -1; } SEC_WEBSOCKE: NEXT_CHAR(); switch (ch) { - - case 'T': - if (last) { + case 'T': + if (last) { + return -1; + } + goto SEC_WEBSOCKET; + case 't': + if (last) { + return -1; + } + goto SEC_WEBSOCKET; + default: return -1; - } - goto SEC_WEBSOCKET; - - - case 't': - if (last) { - return -1; - } - goto SEC_WEBSOCKET; - - default: - return -1; } SEC_WEBSOCKET: NEXT_CHAR(); switch (ch) { - - case '-': - if (last) { + case '-': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_; + default: return -1; - } - goto SEC_WEBSOCKET_; - - default: - return -1; } SEC_WEBSOCKET_: NEXT_CHAR(); switch (ch) { - - case 'A': - if (last) { - return -1; - } - goto SEC_WEBSOCKET_A; - - - case 'a': - if (last) { - return -1; - } - goto SEC_WEBSOCKET_A; - - - case 'E': - if (last) { - return -1; - } - goto SEC_WEBSOCKET_E; - - - case 'e': - if (last) { - return -1; - } - goto SEC_WEBSOCKET_E; - - - case 'K': - if (last) { - return -1; - } - goto SEC_WEBSOCKET_K; - - - case 'k': - if (last) { - return -1; - } - goto SEC_WEBSOCKET_K; - - - case 'P': - if (last) { - return -1; - } - goto SEC_WEBSOCKET_P; - - - case 'p': - if (last) { + case 'A': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_A; + case 'a': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_A; + case 'E': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_E; + case 'e': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_E; + case 'K': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_K; + case 'k': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_K; + case 'P': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_P; + case 'p': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_P; + case 'V': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_V; + case 'v': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_V; + default: return -1; - } - goto SEC_WEBSOCKET_P; - - - case 'V': - if (last) { - return -1; - } - goto SEC_WEBSOCKET_V; - - - case 'v': - if (last) { - return -1; - } - goto SEC_WEBSOCKET_V; - - default: - return -1; } SEC_WEBSOCKET_A: NEXT_CHAR(); switch (ch) { - - case 'C': - if (last) { + case 'C': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_AC; + case 'c': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_AC; + default: return -1; - } - goto SEC_WEBSOCKET_AC; - - - case 'c': - if (last) { - return -1; - } - goto SEC_WEBSOCKET_AC; - - default: - return -1; } SEC_WEBSOCKET_AC: NEXT_CHAR(); switch (ch) { - - case 'C': - if (last) { - return -1; - } - goto SEC_WEBSOCKET_ACC; - - - case 'c': - if (last) { + case 'C': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_ACC; + case 'c': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_ACC; + default: return -1; - } - goto SEC_WEBSOCKET_ACC; - - default: - return -1; } SEC_WEBSOCKET_ACC: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return -1; - } - goto SEC_WEBSOCKET_ACCE; - - - case 'e': - if (last) { + case 'E': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_ACCE; + case 'e': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_ACCE; + default: return -1; - } - goto SEC_WEBSOCKET_ACCE; - - default: - return -1; } SEC_WEBSOCKET_ACCE: NEXT_CHAR(); switch (ch) { - - case 'P': - if (last) { - return -1; - } - goto SEC_WEBSOCKET_ACCEP; - - - case 'p': - if (last) { + case 'P': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_ACCEP; + case 'p': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_ACCEP; + default: return -1; - } - goto SEC_WEBSOCKET_ACCEP; - - default: - return -1; } SEC_WEBSOCKET_ACCEP: NEXT_CHAR(); switch (ch) { - - case 'T': - if (last) { - return 55; - } - goto SEC_WEBSOCKET_ACCEPT; - - - case 't': - if (last) { - return 55; - } - goto SEC_WEBSOCKET_ACCEPT; - - default: - return -1; + case 'T': + if (last) { + return 55; + } + goto SEC_WEBSOCKET_ACCEPT; + case 't': + if (last) { + return 55; + } + goto SEC_WEBSOCKET_ACCEPT; + default: + return -1; } SEC_WEBSOCKET_ACCEPT: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } SEC_WEBSOCKET_E: NEXT_CHAR(); switch (ch) { - - case 'X': - if (last) { - return -1; - } - goto SEC_WEBSOCKET_EX; - - - case 'x': - if (last) { + case 'X': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_EX; + case 'x': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_EX; + default: return -1; - } - goto SEC_WEBSOCKET_EX; - - default: - return -1; } SEC_WEBSOCKET_EX: NEXT_CHAR(); switch (ch) { - - case 'T': - if (last) { - return -1; - } - goto SEC_WEBSOCKET_EXT; - - - case 't': - if (last) { + case 'T': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_EXT; + case 't': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_EXT; + default: return -1; - } - goto SEC_WEBSOCKET_EXT; - - default: - return -1; } SEC_WEBSOCKET_EXT: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { + case 'E': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_EXTE; + case 'e': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_EXTE; + default: return -1; - } - goto SEC_WEBSOCKET_EXTE; - - - case 'e': - if (last) { - return -1; - } - goto SEC_WEBSOCKET_EXTE; - - default: - return -1; } SEC_WEBSOCKET_EXTE: NEXT_CHAR(); switch (ch) { - - case 'N': - if (last) { - return -1; - } - goto SEC_WEBSOCKET_EXTEN; - - - case 'n': - if (last) { + case 'N': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_EXTEN; + case 'n': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_EXTEN; + default: return -1; - } - goto SEC_WEBSOCKET_EXTEN; - - default: - return -1; } SEC_WEBSOCKET_EXTEN: NEXT_CHAR(); switch (ch) { - - case 'S': - if (last) { - return -1; - } - goto SEC_WEBSOCKET_EXTENS; - - - case 's': - if (last) { + case 'S': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_EXTENS; + case 's': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_EXTENS; + default: return -1; - } - goto SEC_WEBSOCKET_EXTENS; - - default: - return -1; } SEC_WEBSOCKET_EXTENS: NEXT_CHAR(); switch (ch) { - - case 'I': - if (last) { - return -1; - } - goto SEC_WEBSOCKET_EXTENSI; - - - case 'i': - if (last) { + case 'I': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_EXTENSI; + case 'i': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_EXTENSI; + default: return -1; - } - goto SEC_WEBSOCKET_EXTENSI; - - default: - return -1; } SEC_WEBSOCKET_EXTENSI: NEXT_CHAR(); switch (ch) { - - case 'O': - if (last) { + case 'O': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_EXTENSIO; + case 'o': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_EXTENSIO; + default: return -1; - } - goto SEC_WEBSOCKET_EXTENSIO; - - - case 'o': - if (last) { - return -1; - } - goto SEC_WEBSOCKET_EXTENSIO; - - default: - return -1; } SEC_WEBSOCKET_EXTENSIO: NEXT_CHAR(); switch (ch) { - - case 'N': - if (last) { - return -1; - } - goto SEC_WEBSOCKET_EXTENSION; - - - case 'n': - if (last) { + case 'N': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_EXTENSION; + case 'n': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_EXTENSION; + default: return -1; - } - goto SEC_WEBSOCKET_EXTENSION; - - default: - return -1; } SEC_WEBSOCKET_EXTENSION: NEXT_CHAR(); switch (ch) { - - case 'S': - if (last) { - return 56; - } - goto SEC_WEBSOCKET_EXTENSIONS; - - - case 's': - if (last) { - return 56; - } - goto SEC_WEBSOCKET_EXTENSIONS; - - default: - return -1; + case 'S': + if (last) { + return 56; + } + goto SEC_WEBSOCKET_EXTENSIONS; + case 's': + if (last) { + return 56; + } + goto SEC_WEBSOCKET_EXTENSIONS; + default: + return -1; } SEC_WEBSOCKET_EXTENSIONS: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } SEC_WEBSOCKET_K: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { + case 'E': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_KE; + case 'e': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_KE; + default: return -1; - } - goto SEC_WEBSOCKET_KE; - - - case 'e': - if (last) { - return -1; - } - goto SEC_WEBSOCKET_KE; - - default: - return -1; } SEC_WEBSOCKET_KE: NEXT_CHAR(); switch (ch) { - - case 'Y': - if (last) { - return 57; - } - goto SEC_WEBSOCKET_KEY; - - - case 'y': - if (last) { - return 57; - } - goto SEC_WEBSOCKET_KEY; - - default: - return -1; + case 'Y': + if (last) { + return 57; + } + goto SEC_WEBSOCKET_KEY; + case 'y': + if (last) { + return 57; + } + goto SEC_WEBSOCKET_KEY; + default: + return -1; } SEC_WEBSOCKET_KEY: NEXT_CHAR(); switch (ch) { - - case '1': - if (last) { - return 58; - } - goto SEC_WEBSOCKET_KEY1; - - default: - return -1; + case '1': + if (last) { + return 58; + } + goto SEC_WEBSOCKET_KEY1; + default: + return -1; } SEC_WEBSOCKET_KEY1: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } SEC_WEBSOCKET_P: NEXT_CHAR(); switch (ch) { - - case 'R': - if (last) { - return -1; - } - goto SEC_WEBSOCKET_PR; - - - case 'r': - if (last) { + case 'R': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_PR; + case 'r': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_PR; + default: return -1; - } - goto SEC_WEBSOCKET_PR; - - default: - return -1; } SEC_WEBSOCKET_PR: NEXT_CHAR(); switch (ch) { - - case 'O': - if (last) { - return -1; - } - goto SEC_WEBSOCKET_PRO; - - - case 'o': - if (last) { + case 'O': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_PRO; + case 'o': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_PRO; + default: return -1; - } - goto SEC_WEBSOCKET_PRO; - - default: - return -1; } SEC_WEBSOCKET_PRO: NEXT_CHAR(); switch (ch) { - - case 'T': - if (last) { + case 'T': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_PROT; + case 't': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_PROT; + default: return -1; - } - goto SEC_WEBSOCKET_PROT; - - - case 't': - if (last) { - return -1; - } - goto SEC_WEBSOCKET_PROT; - - default: - return -1; } SEC_WEBSOCKET_PROT: NEXT_CHAR(); switch (ch) { - - case 'O': - if (last) { - return -1; - } - goto SEC_WEBSOCKET_PROTO; - - - case 'o': - if (last) { + case 'O': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_PROTO; + case 'o': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_PROTO; + default: return -1; - } - goto SEC_WEBSOCKET_PROTO; - - default: - return -1; } SEC_WEBSOCKET_PROTO: NEXT_CHAR(); switch (ch) { - - case 'C': - if (last) { - return -1; - } - goto SEC_WEBSOCKET_PROTOC; - - - case 'c': - if (last) { + case 'C': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_PROTOC; + case 'c': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_PROTOC; + default: return -1; - } - goto SEC_WEBSOCKET_PROTOC; - - default: - return -1; } SEC_WEBSOCKET_PROTOC: NEXT_CHAR(); switch (ch) { - - case 'O': - if (last) { - return -1; - } - goto SEC_WEBSOCKET_PROTOCO; - - - case 'o': - if (last) { + case 'O': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_PROTOCO; + case 'o': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_PROTOCO; + default: return -1; - } - goto SEC_WEBSOCKET_PROTOCO; - - default: - return -1; } SEC_WEBSOCKET_PROTOCO: NEXT_CHAR(); switch (ch) { - - case 'L': - if (last) { - return 59; - } - goto SEC_WEBSOCKET_PROTOCOL; - - - case 'l': - if (last) { - return 59; - } - goto SEC_WEBSOCKET_PROTOCOL; - - default: - return -1; + case 'L': + if (last) { + return 59; + } + goto SEC_WEBSOCKET_PROTOCOL; + case 'l': + if (last) { + return 59; + } + goto SEC_WEBSOCKET_PROTOCOL; + default: + return -1; } SEC_WEBSOCKET_PROTOCOL: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } SEC_WEBSOCKET_V: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return -1; - } - goto SEC_WEBSOCKET_VE; - - - case 'e': - if (last) { + case 'E': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_VE; + case 'e': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_VE; + default: return -1; - } - goto SEC_WEBSOCKET_VE; - - default: - return -1; } SEC_WEBSOCKET_VE: NEXT_CHAR(); switch (ch) { - - case 'R': - if (last) { - return -1; - } - goto SEC_WEBSOCKET_VER; - - - case 'r': - if (last) { + case 'R': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_VER; + case 'r': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_VER; + default: return -1; - } - goto SEC_WEBSOCKET_VER; - - default: - return -1; } SEC_WEBSOCKET_VER: NEXT_CHAR(); switch (ch) { - - case 'S': - if (last) { + case 'S': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_VERS; + case 's': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_VERS; + default: return -1; - } - goto SEC_WEBSOCKET_VERS; - - - case 's': - if (last) { - return -1; - } - goto SEC_WEBSOCKET_VERS; - - default: - return -1; } SEC_WEBSOCKET_VERS: NEXT_CHAR(); switch (ch) { - - case 'I': - if (last) { - return -1; - } - goto SEC_WEBSOCKET_VERSI; - - - case 'i': - if (last) { + case 'I': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_VERSI; + case 'i': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_VERSI; + default: return -1; - } - goto SEC_WEBSOCKET_VERSI; - - default: - return -1; } SEC_WEBSOCKET_VERSI: NEXT_CHAR(); switch (ch) { - - case 'O': - if (last) { - return -1; - } - goto SEC_WEBSOCKET_VERSIO; - - - case 'o': - if (last) { + case 'O': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_VERSIO; + case 'o': + if (last) { + return -1; + } + goto SEC_WEBSOCKET_VERSIO; + default: return -1; - } - goto SEC_WEBSOCKET_VERSIO; - - default: - return -1; } SEC_WEBSOCKET_VERSIO: NEXT_CHAR(); switch (ch) { - - case 'N': - if (last) { - return 60; - } - goto SEC_WEBSOCKET_VERSION; - - - case 'n': - if (last) { - return 60; - } - goto SEC_WEBSOCKET_VERSION; - - default: - return -1; + case 'N': + if (last) { + return 60; + } + goto SEC_WEBSOCKET_VERSION; + case 'n': + if (last) { + return 60; + } + goto SEC_WEBSOCKET_VERSION; + default: + return -1; } SEC_WEBSOCKET_VERSION: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } SER: NEXT_CHAR(); switch (ch) { - - case 'V': - if (last) { - return -1; - } - goto SERV; - - - case 'v': - if (last) { + case 'V': + if (last) { + return -1; + } + goto SERV; + case 'v': + if (last) { + return -1; + } + goto SERV; + default: return -1; - } - goto SERV; - - default: - return -1; } SERV: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return -1; - } - goto SERVE; - - - case 'e': - if (last) { + case 'E': + if (last) { + return -1; + } + goto SERVE; + case 'e': + if (last) { + return -1; + } + goto SERVE; + default: return -1; - } - goto SERVE; - - default: - return -1; } SERVE: NEXT_CHAR(); switch (ch) { - - case 'R': - if (last) { - return 61; - } - goto SERVER; - - - case 'r': - if (last) { - return 61; - } - goto SERVER; - - default: - return -1; + case 'R': + if (last) { + return 61; + } + goto SERVER; + case 'r': + if (last) { + return 61; + } + goto SERVER; + default: + return -1; } SERVER: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } SET: NEXT_CHAR(); switch (ch) { - - case '-': - if (last) { + case '-': + if (last) { + return -1; + } + goto SET_; + default: return -1; - } - goto SET_; - - default: - return -1; } SET_: NEXT_CHAR(); switch (ch) { - - case 'C': - if (last) { - return -1; - } - goto SET_C; - - - case 'c': - if (last) { + case 'C': + if (last) { + return -1; + } + goto SET_C; + case 'c': + if (last) { + return -1; + } + goto SET_C; + default: return -1; - } - goto SET_C; - - default: - return -1; } SET_C: NEXT_CHAR(); switch (ch) { - - case 'O': - if (last) { + case 'O': + if (last) { + return -1; + } + goto SET_CO; + case 'o': + if (last) { + return -1; + } + goto SET_CO; + default: return -1; - } - goto SET_CO; - - - case 'o': - if (last) { - return -1; - } - goto SET_CO; - - default: - return -1; } SET_CO: NEXT_CHAR(); switch (ch) { - - case 'O': - if (last) { - return -1; - } - goto SET_COO; - - - case 'o': - if (last) { + case 'O': + if (last) { + return -1; + } + goto SET_COO; + case 'o': + if (last) { + return -1; + } + goto SET_COO; + default: return -1; - } - goto SET_COO; - - default: - return -1; } SET_COO: NEXT_CHAR(); switch (ch) { - - case 'K': - if (last) { - return -1; - } - goto SET_COOK; - - - case 'k': - if (last) { + case 'K': + if (last) { + return -1; + } + goto SET_COOK; + case 'k': + if (last) { + return -1; + } + goto SET_COOK; + default: return -1; - } - goto SET_COOK; - - default: - return -1; } SET_COOK: NEXT_CHAR(); switch (ch) { - - case 'I': - if (last) { - return -1; - } - goto SET_COOKI; - - - case 'i': - if (last) { + case 'I': + if (last) { + return -1; + } + goto SET_COOKI; + case 'i': + if (last) { + return -1; + } + goto SET_COOKI; + default: return -1; - } - goto SET_COOKI; - - default: - return -1; } SET_COOKI: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return 62; - } - goto SET_COOKIE; - - - case 'e': - if (last) { - return 62; - } - goto SET_COOKIE; - - default: - return -1; + case 'E': + if (last) { + return 62; + } + goto SET_COOKIE; + case 'e': + if (last) { + return 62; + } + goto SET_COOKIE; + default: + return -1; } SET_COOKIE: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } T: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return 63; - } - goto TE; - - - case 'e': - if (last) { - return 63; - } - goto TE; - - - case 'R': - if (last) { - return -1; - } - goto TR; - - - case 'r': - if (last) { + case 'E': + if (last) { + return 63; + } + goto TE; + case 'e': + if (last) { + return 63; + } + goto TE; + case 'R': + if (last) { + return -1; + } + goto TR; + case 'r': + if (last) { + return -1; + } + goto TR; + default: return -1; - } - goto TR; - - default: - return -1; } TE: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } TR: NEXT_CHAR(); - switch (ch) { - - case 'A': - if (last) { - return -1; - } - goto TRA; - - - case 'a': - if (last) { + switch (ch) { + case 'A': + if (last) { + return -1; + } + goto TRA; + case 'a': + if (last) { + return -1; + } + goto TRA; + default: return -1; - } - goto TRA; - - default: - return -1; } TRA: NEXT_CHAR(); switch (ch) { - - case 'I': - if (last) { - return -1; - } - goto TRAI; - - - case 'i': - if (last) { - return -1; - } - goto TRAI; - - - case 'N': - if (last) { - return -1; - } - goto TRAN; - - - case 'n': - if (last) { + case 'I': + if (last) { + return -1; + } + goto TRAI; + case 'i': + if (last) { + return -1; + } + goto TRAI; + case 'N': + if (last) { + return -1; + } + goto TRAN; + case 'n': + if (last) { + return -1; + } + goto TRAN; + default: return -1; - } - goto TRAN; - - default: - return -1; } TRAI: NEXT_CHAR(); switch (ch) { - - case 'L': - if (last) { - return -1; - } - goto TRAIL; - - - case 'l': - if (last) { + case 'L': + if (last) { + return -1; + } + goto TRAIL; + case 'l': + if (last) { + return -1; + } + goto TRAIL; + default: return -1; - } - goto TRAIL; - - default: - return -1; } TRAIL: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return -1; - } - goto TRAILE; - - - case 'e': - if (last) { + case 'E': + if (last) { + return -1; + } + goto TRAILE; + case 'e': + if (last) { + return -1; + } + goto TRAILE; + default: return -1; - } - goto TRAILE; - - default: - return -1; } TRAILE: NEXT_CHAR(); switch (ch) { - - case 'R': - if (last) { - return 64; - } - goto TRAILER; - - - case 'r': - if (last) { - return 64; - } - goto TRAILER; - - default: - return -1; + case 'R': + if (last) { + return 64; + } + goto TRAILER; + case 'r': + if (last) { + return 64; + } + goto TRAILER; + default: + return -1; } TRAILER: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } TRAN: NEXT_CHAR(); switch (ch) { - - case 'S': - if (last) { - return -1; - } - goto TRANS; - - - case 's': - if (last) { + case 'S': + if (last) { + return -1; + } + goto TRANS; + case 's': + if (last) { + return -1; + } + goto TRANS; + default: return -1; - } - goto TRANS; - - default: - return -1; } TRANS: NEXT_CHAR(); switch (ch) { - - case 'F': - if (last) { - return -1; - } - goto TRANSF; - - - case 'f': - if (last) { + case 'F': + if (last) { + return -1; + } + goto TRANSF; + case 'f': + if (last) { + return -1; + } + goto TRANSF; + default: return -1; - } - goto TRANSF; - - default: - return -1; } TRANSF: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { + case 'E': + if (last) { + return -1; + } + goto TRANSFE; + case 'e': + if (last) { + return -1; + } + goto TRANSFE; + default: return -1; - } - goto TRANSFE; - - - case 'e': - if (last) { - return -1; - } - goto TRANSFE; - - default: - return -1; } TRANSFE: NEXT_CHAR(); switch (ch) { - - case 'R': - if (last) { - return -1; - } - goto TRANSFER; - - - case 'r': - if (last) { + case 'R': + if (last) { + return -1; + } + goto TRANSFER; + case 'r': + if (last) { + return -1; + } + goto TRANSFER; + default: return -1; - } - goto TRANSFER; - - default: - return -1; } TRANSFER: NEXT_CHAR(); switch (ch) { - - case '-': - if (last) { + case '-': + if (last) { + return -1; + } + goto TRANSFER_; + default: return -1; - } - goto TRANSFER_; - - default: - return -1; } TRANSFER_: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { + case 'E': + if (last) { + return -1; + } + goto TRANSFER_E; + case 'e': + if (last) { + return -1; + } + goto TRANSFER_E; + default: return -1; - } - goto TRANSFER_E; - - - case 'e': - if (last) { - return -1; - } - goto TRANSFER_E; - - default: - return -1; } TRANSFER_E: NEXT_CHAR(); switch (ch) { - - case 'N': - if (last) { - return -1; - } - goto TRANSFER_EN; - - - case 'n': - if (last) { + case 'N': + if (last) { + return -1; + } + goto TRANSFER_EN; + case 'n': + if (last) { + return -1; + } + goto TRANSFER_EN; + default: return -1; - } - goto TRANSFER_EN; - - default: - return -1; } TRANSFER_EN: NEXT_CHAR(); switch (ch) { - - case 'C': - if (last) { - return -1; - } - goto TRANSFER_ENC; - - - case 'c': - if (last) { + case 'C': + if (last) { + return -1; + } + goto TRANSFER_ENC; + case 'c': + if (last) { + return -1; + } + goto TRANSFER_ENC; + default: return -1; - } - goto TRANSFER_ENC; - - default: - return -1; } TRANSFER_ENC: NEXT_CHAR(); switch (ch) { - - case 'O': - if (last) { - return -1; - } - goto TRANSFER_ENCO; - - - case 'o': - if (last) { + case 'O': + if (last) { + return -1; + } + goto TRANSFER_ENCO; + case 'o': + if (last) { + return -1; + } + goto TRANSFER_ENCO; + default: return -1; - } - goto TRANSFER_ENCO; - - default: - return -1; } TRANSFER_ENCO: NEXT_CHAR(); switch (ch) { - - case 'D': - if (last) { + case 'D': + if (last) { + return -1; + } + goto TRANSFER_ENCOD; + case 'd': + if (last) { + return -1; + } + goto TRANSFER_ENCOD; + default: return -1; - } - goto TRANSFER_ENCOD; - - - case 'd': - if (last) { - return -1; - } - goto TRANSFER_ENCOD; - - default: - return -1; } TRANSFER_ENCOD: NEXT_CHAR(); switch (ch) { - - case 'I': - if (last) { - return -1; - } - goto TRANSFER_ENCODI; - - - case 'i': - if (last) { + case 'I': + if (last) { + return -1; + } + goto TRANSFER_ENCODI; + case 'i': + if (last) { + return -1; + } + goto TRANSFER_ENCODI; + default: return -1; - } - goto TRANSFER_ENCODI; - - default: - return -1; } TRANSFER_ENCODI: NEXT_CHAR(); switch (ch) { - - case 'N': - if (last) { - return -1; - } - goto TRANSFER_ENCODIN; - - - case 'n': - if (last) { + case 'N': + if (last) { + return -1; + } + goto TRANSFER_ENCODIN; + case 'n': + if (last) { + return -1; + } + goto TRANSFER_ENCODIN; + default: return -1; - } - goto TRANSFER_ENCODIN; - - default: - return -1; } TRANSFER_ENCODIN: NEXT_CHAR(); switch (ch) { - - case 'G': - if (last) { - return 65; - } - goto TRANSFER_ENCODING; - - - case 'g': - if (last) { - return 65; - } - goto TRANSFER_ENCODING; - - default: - return -1; + case 'G': + if (last) { + return 65; + } + goto TRANSFER_ENCODING; + case 'g': + if (last) { + return 65; + } + goto TRANSFER_ENCODING; + default: + return -1; } TRANSFER_ENCODING: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } U: NEXT_CHAR(); switch (ch) { - - case 'P': - if (last) { - return -1; - } - goto UP; - - - case 'p': - if (last) { + case 'P': + if (last) { + return -1; + } + goto UP; + case 'p': + if (last) { + return -1; + } + goto UP; + case 'R': + if (last) { + return -1; + } + goto UR; + case 'r': + if (last) { + return -1; + } + goto UR; + case 'S': + if (last) { + return -1; + } + goto US; + case 's': + if (last) { + return -1; + } + goto US; + default: return -1; - } - goto UP; - - - case 'R': - if (last) { - return -1; - } - goto UR; - - - case 'r': - if (last) { - return -1; - } - goto UR; - - - case 'S': - if (last) { - return -1; - } - goto US; - - - case 's': - if (last) { - return -1; - } - goto US; - - default: - return -1; } UP: NEXT_CHAR(); switch (ch) { - - case 'G': - if (last) { - return -1; - } - goto UPG; - - - case 'g': - if (last) { + case 'G': + if (last) { + return -1; + } + goto UPG; + case 'g': + if (last) { + return -1; + } + goto UPG; + default: return -1; - } - goto UPG; - - default: - return -1; } UPG: NEXT_CHAR(); switch (ch) { - - case 'R': - if (last) { - return -1; - } - goto UPGR; - - - case 'r': - if (last) { + case 'R': + if (last) { + return -1; + } + goto UPGR; + case 'r': + if (last) { + return -1; + } + goto UPGR; + default: return -1; - } - goto UPGR; - - default: - return -1; } UPGR: NEXT_CHAR(); switch (ch) { - - case 'A': - if (last) { + case 'A': + if (last) { + return -1; + } + goto UPGRA; + case 'a': + if (last) { + return -1; + } + goto UPGRA; + default: return -1; - } - goto UPGRA; - - - case 'a': - if (last) { - return -1; - } - goto UPGRA; - - default: - return -1; } UPGRA: NEXT_CHAR(); switch (ch) { - - case 'D': - if (last) { - return -1; - } - goto UPGRAD; - - - case 'd': - if (last) { + case 'D': + if (last) { + return -1; + } + goto UPGRAD; + case 'd': + if (last) { + return -1; + } + goto UPGRAD; + default: return -1; - } - goto UPGRAD; - - default: - return -1; } UPGRAD: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return 66; - } - goto UPGRADE; - - - case 'e': - if (last) { - return 66; - } - goto UPGRADE; - - default: - return -1; + case 'E': + if (last) { + return 66; + } + goto UPGRADE; + case 'e': + if (last) { + return 66; + } + goto UPGRADE; + default: + return -1; } UPGRADE: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } UR: NEXT_CHAR(); switch (ch) { - - case 'I': - if (last) { - return 67; - } - goto URI; - - - case 'i': - if (last) { - return 67; - } - goto URI; - - default: - return -1; + case 'I': + if (last) { + return 67; + } + goto URI; + case 'i': + if (last) { + return 67; + } + goto URI; + default: + return -1; } URI: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } US: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return -1; - } - goto USE; - - - case 'e': - if (last) { + case 'E': + if (last) { + return -1; + } + goto USE; + case 'e': + if (last) { + return -1; + } + goto USE; + default: return -1; - } - goto USE; - - default: - return -1; } USE: NEXT_CHAR(); switch (ch) { - - case 'R': - if (last) { - return -1; - } - goto USER; - - - case 'r': - if (last) { + case 'R': + if (last) { + return -1; + } + goto USER; + case 'r': + if (last) { + return -1; + } + goto USER; + default: return -1; - } - goto USER; - - default: - return -1; } USER: NEXT_CHAR(); switch (ch) { - - case '-': - if (last) { + case '-': + if (last) { + return -1; + } + goto USER_; + default: return -1; - } - goto USER_; - - default: - return -1; } USER_: NEXT_CHAR(); switch (ch) { - - case 'A': - if (last) { - return -1; - } - goto USER_A; - - - case 'a': - if (last) { + case 'A': + if (last) { + return -1; + } + goto USER_A; + case 'a': + if (last) { + return -1; + } + goto USER_A; + default: return -1; - } - goto USER_A; - - default: - return -1; } USER_A: NEXT_CHAR(); switch (ch) { - - case 'G': - if (last) { - return -1; - } - goto USER_AG; - - - case 'g': - if (last) { + case 'G': + if (last) { + return -1; + } + goto USER_AG; + case 'g': + if (last) { + return -1; + } + goto USER_AG; + default: return -1; - } - goto USER_AG; - - default: - return -1; } USER_AG: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { + case 'E': + if (last) { + return -1; + } + goto USER_AGE; + case 'e': + if (last) { + return -1; + } + goto USER_AGE; + default: return -1; - } - goto USER_AGE; - - - case 'e': - if (last) { - return -1; - } - goto USER_AGE; - - default: - return -1; } USER_AGE: NEXT_CHAR(); switch (ch) { - - case 'N': - if (last) { - return -1; - } - goto USER_AGEN; - - - case 'n': - if (last) { + case 'N': + if (last) { + return -1; + } + goto USER_AGEN; + case 'n': + if (last) { + return -1; + } + goto USER_AGEN; + default: return -1; - } - goto USER_AGEN; - - default: - return -1; } USER_AGEN: NEXT_CHAR(); switch (ch) { - - case 'T': - if (last) { - return 68; - } - goto USER_AGENT; - - - case 't': - if (last) { - return 68; - } - goto USER_AGENT; - - default: - return -1; + case 'T': + if (last) { + return 68; + } + goto USER_AGENT; + case 't': + if (last) { + return 68; + } + goto USER_AGENT; + default: + return -1; } USER_AGENT: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } V: NEXT_CHAR(); switch (ch) { - - case 'A': - if (last) { - return -1; - } - goto VA; - - - case 'a': - if (last) { - return -1; - } - goto VA; - - - case 'I': - if (last) { - return -1; - } - goto VI; - - - case 'i': - if (last) { + case 'A': + if (last) { + return -1; + } + goto VA; + case 'a': + if (last) { + return -1; + } + goto VA; + case 'I': + if (last) { + return -1; + } + goto VI; + case 'i': + if (last) { + return -1; + } + goto VI; + default: return -1; - } - goto VI; - - default: - return -1; } VA: NEXT_CHAR(); switch (ch) { - - case 'R': - if (last) { - return -1; - } - goto VAR; - - - case 'r': - if (last) { + case 'R': + if (last) { + return -1; + } + goto VAR; + case 'r': + if (last) { + return -1; + } + goto VAR; + default: return -1; - } - goto VAR; - - default: - return -1; } VAR: NEXT_CHAR(); switch (ch) { - - case 'Y': - if (last) { - return 69; - } - goto VARY; - - - case 'y': - if (last) { - return 69; - } - goto VARY; - - default: - return -1; + case 'Y': + if (last) { + return 69; + } + goto VARY; + case 'y': + if (last) { + return 69; + } + goto VARY; + default: + return -1; } VARY: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } VI: NEXT_CHAR(); switch (ch) { - - case 'A': - if (last) { - return 70; - } - goto VIA; - - - case 'a': - if (last) { - return 70; - } - goto VIA; - - default: - return -1; + case 'A': + if (last) { + return 70; + } + goto VIA; + case 'a': + if (last) { + return 70; + } + goto VIA; + default: + return -1; } VIA: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } W: NEXT_CHAR(); switch (ch) { - - case 'A': - if (last) { + case 'A': + if (last) { + return -1; + } + goto WA; + case 'a': + if (last) { + return -1; + } + goto WA; + case 'E': + if (last) { + return -1; + } + goto WE; + case 'e': + if (last) { + return -1; + } + goto WE; + case 'W': + if (last) { + return -1; + } + goto WW; + case 'w': + if (last) { + return -1; + } + goto WW; + default: return -1; - } - goto WA; - - - case 'a': - if (last) { - return -1; - } - goto WA; - - - case 'E': - if (last) { - return -1; - } - goto WE; - - - case 'e': - if (last) { - return -1; - } - goto WE; - - - case 'W': - if (last) { - return -1; - } - goto WW; - - - case 'w': - if (last) { - return -1; - } - goto WW; - - default: - return -1; } WA: NEXT_CHAR(); switch (ch) { - - case 'N': - if (last) { - return -1; - } - goto WAN; - - - case 'n': - if (last) { - return -1; - } - goto WAN; - - - case 'R': - if (last) { - return -1; - } - goto WAR; - - - case 'r': - if (last) { + case 'N': + if (last) { + return -1; + } + goto WAN; + case 'n': + if (last) { + return -1; + } + goto WAN; + case 'R': + if (last) { + return -1; + } + goto WAR; + case 'r': + if (last) { + return -1; + } + goto WAR; + default: return -1; - } - goto WAR; - - default: - return -1; } WAN: NEXT_CHAR(); switch (ch) { - - case 'T': - if (last) { + case 'T': + if (last) { + return -1; + } + goto WANT; + case 't': + if (last) { + return -1; + } + goto WANT; + default: return -1; - } - goto WANT; - - - case 't': - if (last) { - return -1; - } - goto WANT; - - default: - return -1; } WANT: NEXT_CHAR(); switch (ch) { - - case '-': - if (last) { + case '-': + if (last) { + return -1; + } + goto WANT_; + default: return -1; - } - goto WANT_; - - default: - return -1; } WANT_: NEXT_CHAR(); switch (ch) { - - case 'D': - if (last) { - return -1; - } - goto WANT_D; - - - case 'd': - if (last) { + case 'D': + if (last) { + return -1; + } + goto WANT_D; + case 'd': + if (last) { + return -1; + } + goto WANT_D; + default: return -1; - } - goto WANT_D; - - default: - return -1; } WANT_D: NEXT_CHAR(); switch (ch) { - - case 'I': - if (last) { + case 'I': + if (last) { + return -1; + } + goto WANT_DI; + case 'i': + if (last) { + return -1; + } + goto WANT_DI; + default: return -1; - } - goto WANT_DI; - - - case 'i': - if (last) { - return -1; - } - goto WANT_DI; - - default: - return -1; } WANT_DI: NEXT_CHAR(); switch (ch) { - - case 'G': - if (last) { - return -1; - } - goto WANT_DIG; - - - case 'g': - if (last) { + case 'G': + if (last) { + return -1; + } + goto WANT_DIG; + case 'g': + if (last) { + return -1; + } + goto WANT_DIG; + default: return -1; - } - goto WANT_DIG; - - default: - return -1; } WANT_DIG: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return -1; - } - goto WANT_DIGE; - - - case 'e': - if (last) { + case 'E': + if (last) { + return -1; + } + goto WANT_DIGE; + case 'e': + if (last) { + return -1; + } + goto WANT_DIGE; + default: return -1; - } - goto WANT_DIGE; - - default: - return -1; } WANT_DIGE: NEXT_CHAR(); switch (ch) { - - case 'S': - if (last) { - return -1; - } - goto WANT_DIGES; - - - case 's': - if (last) { + case 'S': + if (last) { + return -1; + } + goto WANT_DIGES; + case 's': + if (last) { + return -1; + } + goto WANT_DIGES; + default: return -1; - } - goto WANT_DIGES; - - default: - return -1; } WANT_DIGES: NEXT_CHAR(); switch (ch) { - - case 'T': - if (last) { - return 71; - } - goto WANT_DIGEST; - - - case 't': - if (last) { - return 71; - } - goto WANT_DIGEST; - - default: - return -1; + case 'T': + if (last) { + return 71; + } + goto WANT_DIGEST; + case 't': + if (last) { + return 71; + } + goto WANT_DIGEST; + default: + return -1; } WANT_DIGEST: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } WAR: NEXT_CHAR(); switch (ch) { - - case 'N': - if (last) { - return -1; - } - goto WARN; - - - case 'n': - if (last) { + case 'N': + if (last) { + return -1; + } + goto WARN; + case 'n': + if (last) { + return -1; + } + goto WARN; + default: return -1; - } - goto WARN; - - default: - return -1; } WARN: NEXT_CHAR(); switch (ch) { - - case 'I': - if (last) { - return -1; - } - goto WARNI; - - - case 'i': - if (last) { + case 'I': + if (last) { + return -1; + } + goto WARNI; + case 'i': + if (last) { + return -1; + } + goto WARNI; + default: return -1; - } - goto WARNI; - - default: - return -1; } WARNI: NEXT_CHAR(); switch (ch) { - - case 'N': - if (last) { + case 'N': + if (last) { + return -1; + } + goto WARNIN; + case 'n': + if (last) { + return -1; + } + goto WARNIN; + default: return -1; - } - goto WARNIN; - - - case 'n': - if (last) { - return -1; - } - goto WARNIN; - - default: - return -1; } WARNIN: NEXT_CHAR(); switch (ch) { - - case 'G': - if (last) { - return 72; - } - goto WARNING; - - - case 'g': - if (last) { - return 72; - } - goto WARNING; - - default: - return -1; + case 'G': + if (last) { + return 72; + } + goto WARNING; + case 'g': + if (last) { + return 72; + } + goto WARNING; + default: + return -1; } WARNING: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } WE: NEXT_CHAR(); switch (ch) { - - case 'B': - if (last) { - return -1; - } - goto WEB; - - - case 'b': - if (last) { + case 'B': + if (last) { + return -1; + } + goto WEB; + case 'b': + if (last) { + return -1; + } + goto WEB; + default: return -1; - } - goto WEB; - - default: - return -1; } WEB: NEXT_CHAR(); switch (ch) { - - case 'S': - if (last) { + case 'S': + if (last) { + return -1; + } + goto WEBS; + case 's': + if (last) { + return -1; + } + goto WEBS; + default: return -1; - } - goto WEBS; - - - case 's': - if (last) { - return -1; - } - goto WEBS; - - default: - return -1; } WEBS: NEXT_CHAR(); switch (ch) { - - case 'O': - if (last) { - return -1; - } - goto WEBSO; - - - case 'o': - if (last) { + case 'O': + if (last) { + return -1; + } + goto WEBSO; + case 'o': + if (last) { + return -1; + } + goto WEBSO; + default: return -1; - } - goto WEBSO; - - default: - return -1; } WEBSO: NEXT_CHAR(); switch (ch) { - - case 'C': - if (last) { - return -1; - } - goto WEBSOC; - - - case 'c': - if (last) { + case 'C': + if (last) { + return -1; + } + goto WEBSOC; + case 'c': + if (last) { + return -1; + } + goto WEBSOC; + default: return -1; - } - goto WEBSOC; - - default: - return -1; } WEBSOC: NEXT_CHAR(); switch (ch) { - - case 'K': - if (last) { - return -1; - } - goto WEBSOCK; - - - case 'k': - if (last) { + case 'K': + if (last) { + return -1; + } + goto WEBSOCK; + case 'k': + if (last) { + return -1; + } + goto WEBSOCK; + default: return -1; - } - goto WEBSOCK; - - default: - return -1; } WEBSOCK: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { + case 'E': + if (last) { + return -1; + } + goto WEBSOCKE; + case 'e': + if (last) { + return -1; + } + goto WEBSOCKE; + default: return -1; - } - goto WEBSOCKE; - - - case 'e': - if (last) { - return -1; - } - goto WEBSOCKE; - - default: - return -1; } WEBSOCKE: NEXT_CHAR(); switch (ch) { - - case 'T': - if (last) { - return 73; - } - goto WEBSOCKET; - - - case 't': - if (last) { - return 73; - } - goto WEBSOCKET; - - default: - return -1; + case 'T': + if (last) { + return 73; + } + goto WEBSOCKET; + case 't': + if (last) { + return 73; + } + goto WEBSOCKET; + default: + return -1; } WEBSOCKET: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } WW: NEXT_CHAR(); switch (ch) { - - case 'W': - if (last) { - return -1; - } - goto WWW; - - - case 'w': - if (last) { + case 'W': + if (last) { + return -1; + } + goto WWW; + case 'w': + if (last) { + return -1; + } + goto WWW; + default: return -1; - } - goto WWW; - - default: - return -1; } WWW: NEXT_CHAR(); switch (ch) { - - case '-': - if (last) { + case '-': + if (last) { + return -1; + } + goto WWW_; + default: return -1; - } - goto WWW_; - - default: - return -1; } WWW_: NEXT_CHAR(); switch (ch) { - - case 'A': - if (last) { - return -1; - } - goto WWW_A; - - - case 'a': - if (last) { + case 'A': + if (last) { + return -1; + } + goto WWW_A; + case 'a': + if (last) { + return -1; + } + goto WWW_A; + default: return -1; - } - goto WWW_A; - - default: - return -1; } WWW_A: NEXT_CHAR(); switch (ch) { - - case 'U': - if (last) { - return -1; - } - goto WWW_AU; - - - case 'u': - if (last) { + case 'U': + if (last) { + return -1; + } + goto WWW_AU; + case 'u': + if (last) { + return -1; + } + goto WWW_AU; + default: return -1; - } - goto WWW_AU; - - default: - return -1; } WWW_AU: NEXT_CHAR(); switch (ch) { - - case 'T': - if (last) { + case 'T': + if (last) { + return -1; + } + goto WWW_AUT; + case 't': + if (last) { + return -1; + } + goto WWW_AUT; + default: return -1; - } - goto WWW_AUT; - - - case 't': - if (last) { - return -1; - } - goto WWW_AUT; - - default: - return -1; } WWW_AUT: NEXT_CHAR(); switch (ch) { - - case 'H': - if (last) { - return -1; - } - goto WWW_AUTH; - - - case 'h': - if (last) { + case 'H': + if (last) { + return -1; + } + goto WWW_AUTH; + case 'h': + if (last) { + return -1; + } + goto WWW_AUTH; + default: return -1; - } - goto WWW_AUTH; - - default: - return -1; } WWW_AUTH: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return -1; - } - goto WWW_AUTHE; - - - case 'e': - if (last) { + case 'E': + if (last) { + return -1; + } + goto WWW_AUTHE; + case 'e': + if (last) { + return -1; + } + goto WWW_AUTHE; + default: return -1; - } - goto WWW_AUTHE; - - default: - return -1; } WWW_AUTHE: NEXT_CHAR(); switch (ch) { - - case 'N': - if (last) { - return -1; - } - goto WWW_AUTHEN; - - - case 'n': - if (last) { + case 'N': + if (last) { + return -1; + } + goto WWW_AUTHEN; + case 'n': + if (last) { + return -1; + } + goto WWW_AUTHEN; + default: return -1; - } - goto WWW_AUTHEN; - - default: - return -1; } WWW_AUTHEN: NEXT_CHAR(); switch (ch) { - - case 'T': - if (last) { + case 'T': + if (last) { + return -1; + } + goto WWW_AUTHENT; + case 't': + if (last) { + return -1; + } + goto WWW_AUTHENT; + default: return -1; - } - goto WWW_AUTHENT; - - - case 't': - if (last) { - return -1; - } - goto WWW_AUTHENT; - - default: - return -1; } WWW_AUTHENT: NEXT_CHAR(); switch (ch) { - - case 'I': - if (last) { - return -1; - } - goto WWW_AUTHENTI; - - - case 'i': - if (last) { + case 'I': + if (last) { + return -1; + } + goto WWW_AUTHENTI; + case 'i': + if (last) { + return -1; + } + goto WWW_AUTHENTI; + default: return -1; - } - goto WWW_AUTHENTI; - - default: - return -1; } WWW_AUTHENTI: NEXT_CHAR(); switch (ch) { - - case 'C': - if (last) { - return -1; - } - goto WWW_AUTHENTIC; - - - case 'c': - if (last) { + case 'C': + if (last) { + return -1; + } + goto WWW_AUTHENTIC; + case 'c': + if (last) { + return -1; + } + goto WWW_AUTHENTIC; + default: return -1; - } - goto WWW_AUTHENTIC; - - default: - return -1; } WWW_AUTHENTIC: NEXT_CHAR(); switch (ch) { - - case 'A': - if (last) { - return -1; - } - goto WWW_AUTHENTICA; - - - case 'a': - if (last) { + case 'A': + if (last) { + return -1; + } + goto WWW_AUTHENTICA; + case 'a': + if (last) { + return -1; + } + goto WWW_AUTHENTICA; + default: return -1; - } - goto WWW_AUTHENTICA; - - default: - return -1; } WWW_AUTHENTICA: NEXT_CHAR(); switch (ch) { - - case 'T': - if (last) { + case 'T': + if (last) { + return -1; + } + goto WWW_AUTHENTICAT; + case 't': + if (last) { + return -1; + } + goto WWW_AUTHENTICAT; + default: return -1; - } - goto WWW_AUTHENTICAT; - - - case 't': - if (last) { - return -1; - } - goto WWW_AUTHENTICAT; - - default: - return -1; } WWW_AUTHENTICAT: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { - return 74; - } - goto WWW_AUTHENTICATE; - - - case 'e': - if (last) { - return 74; - } - goto WWW_AUTHENTICATE; - - default: - return -1; + case 'E': + if (last) { + return 74; + } + goto WWW_AUTHENTICATE; + case 'e': + if (last) { + return 74; + } + goto WWW_AUTHENTICATE; + default: + return -1; } WWW_AUTHENTICATE: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } X: NEXT_CHAR(); switch (ch) { - - case '-': - if (last) { + case '-': + if (last) { + return -1; + } + goto X_; + default: return -1; - } - goto X_; - - default: - return -1; } X_: NEXT_CHAR(); switch (ch) { - - case 'F': - if (last) { - return -1; - } - goto X_F; - - - case 'f': - if (last) { + case 'F': + if (last) { + return -1; + } + goto X_F; + case 'f': + if (last) { + return -1; + } + goto X_F; + default: return -1; - } - goto X_F; - - default: - return -1; } X_F: NEXT_CHAR(); switch (ch) { - - case 'O': - if (last) { - return -1; - } - goto X_FO; - - - case 'o': - if (last) { + case 'O': + if (last) { + return -1; + } + goto X_FO; + case 'o': + if (last) { + return -1; + } + goto X_FO; + default: return -1; - } - goto X_FO; - - default: - return -1; } X_FO: NEXT_CHAR(); switch (ch) { - - case 'R': - if (last) { - return -1; - } - goto X_FOR; - - - case 'r': - if (last) { + case 'R': + if (last) { + return -1; + } + goto X_FOR; + case 'r': + if (last) { + return -1; + } + goto X_FOR; + default: return -1; - } - goto X_FOR; - - default: - return -1; } X_FOR: NEXT_CHAR(); switch (ch) { - - case 'W': - if (last) { + case 'W': + if (last) { + return -1; + } + goto X_FORW; + case 'w': + if (last) { + return -1; + } + goto X_FORW; + default: return -1; - } - goto X_FORW; - - - case 'w': - if (last) { - return -1; - } - goto X_FORW; - - default: - return -1; } X_FORW: NEXT_CHAR(); switch (ch) { - - case 'A': - if (last) { - return -1; - } - goto X_FORWA; - - - case 'a': - if (last) { + case 'A': + if (last) { + return -1; + } + goto X_FORWA; + case 'a': + if (last) { + return -1; + } + goto X_FORWA; + default: return -1; - } - goto X_FORWA; - - default: - return -1; } X_FORWA: NEXT_CHAR(); switch (ch) { - - case 'R': - if (last) { - return -1; - } - goto X_FORWAR; - - - case 'r': - if (last) { + case 'R': + if (last) { + return -1; + } + goto X_FORWAR; + case 'r': + if (last) { + return -1; + } + goto X_FORWAR; + default: return -1; - } - goto X_FORWAR; - - default: - return -1; } X_FORWAR: NEXT_CHAR(); switch (ch) { - - case 'D': - if (last) { - return -1; - } - goto X_FORWARD; - - - case 'd': - if (last) { + case 'D': + if (last) { + return -1; + } + goto X_FORWARD; + case 'd': + if (last) { + return -1; + } + goto X_FORWARD; + default: return -1; - } - goto X_FORWARD; - - default: - return -1; } X_FORWARD: NEXT_CHAR(); switch (ch) { - - case 'E': - if (last) { + case 'E': + if (last) { + return -1; + } + goto X_FORWARDE; + case 'e': + if (last) { + return -1; + } + goto X_FORWARDE; + default: return -1; - } - goto X_FORWARDE; - - - case 'e': - if (last) { - return -1; - } - goto X_FORWARDE; - - default: - return -1; } X_FORWARDE: NEXT_CHAR(); switch (ch) { - - case 'D': - if (last) { - return -1; - } - goto X_FORWARDED; - - - case 'd': - if (last) { + case 'D': + if (last) { + return -1; + } + goto X_FORWARDED; + case 'd': + if (last) { + return -1; + } + goto X_FORWARDED; + default: return -1; - } - goto X_FORWARDED; - - default: - return -1; } X_FORWARDED: NEXT_CHAR(); switch (ch) { - - case '-': - if (last) { + case '-': + if (last) { + return -1; + } + goto X_FORWARDED_; + default: return -1; - } - goto X_FORWARDED_; - - default: - return -1; } X_FORWARDED_: NEXT_CHAR(); switch (ch) { - - case 'F': - if (last) { + case 'F': + if (last) { + return -1; + } + goto X_FORWARDED_F; + case 'f': + if (last) { + return -1; + } + goto X_FORWARDED_F; + case 'H': + if (last) { + return -1; + } + goto X_FORWARDED_H; + case 'h': + if (last) { + return -1; + } + goto X_FORWARDED_H; + case 'P': + if (last) { + return -1; + } + goto X_FORWARDED_P; + case 'p': + if (last) { + return -1; + } + goto X_FORWARDED_P; + default: return -1; - } - goto X_FORWARDED_F; - - - case 'f': - if (last) { - return -1; - } - goto X_FORWARDED_F; - - - case 'H': - if (last) { - return -1; - } - goto X_FORWARDED_H; - - - case 'h': - if (last) { - return -1; - } - goto X_FORWARDED_H; - - - case 'P': - if (last) { - return -1; - } - goto X_FORWARDED_P; - - - case 'p': - if (last) { - return -1; - } - goto X_FORWARDED_P; - - default: - return -1; } X_FORWARDED_F: NEXT_CHAR(); switch (ch) { - - case 'O': - if (last) { - return -1; - } - goto X_FORWARDED_FO; - - - case 'o': - if (last) { + case 'O': + if (last) { + return -1; + } + goto X_FORWARDED_FO; + case 'o': + if (last) { + return -1; + } + goto X_FORWARDED_FO; + default: return -1; - } - goto X_FORWARDED_FO; - - default: - return -1; } X_FORWARDED_FO: NEXT_CHAR(); switch (ch) { - - case 'R': - if (last) { - return 75; - } - goto X_FORWARDED_FOR; - - - case 'r': - if (last) { - return 75; - } - goto X_FORWARDED_FOR; - - default: - return -1; + case 'R': + if (last) { + return 75; + } + goto X_FORWARDED_FOR; + case 'r': + if (last) { + return 75; + } + goto X_FORWARDED_FOR; + default: + return -1; } X_FORWARDED_FOR: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } X_FORWARDED_H: NEXT_CHAR(); switch (ch) { - - case 'O': - if (last) { + case 'O': + if (last) { + return -1; + } + goto X_FORWARDED_HO; + case 'o': + if (last) { + return -1; + } + goto X_FORWARDED_HO; + default: return -1; - } - goto X_FORWARDED_HO; - - - case 'o': - if (last) { - return -1; - } - goto X_FORWARDED_HO; - - default: - return -1; } X_FORWARDED_HO: NEXT_CHAR(); switch (ch) { - - case 'S': - if (last) { - return -1; - } - goto X_FORWARDED_HOS; - - - case 's': - if (last) { + case 'S': + if (last) { + return -1; + } + goto X_FORWARDED_HOS; + case 's': + if (last) { + return -1; + } + goto X_FORWARDED_HOS; + default: return -1; - } - goto X_FORWARDED_HOS; - - default: - return -1; } X_FORWARDED_HOS: NEXT_CHAR(); switch (ch) { - - case 'T': - if (last) { - return 76; - } - goto X_FORWARDED_HOST; - - - case 't': - if (last) { - return 76; - } - goto X_FORWARDED_HOST; - - default: - return -1; + case 'T': + if (last) { + return 76; + } + goto X_FORWARDED_HOST; + case 't': + if (last) { + return 76; + } + goto X_FORWARDED_HOST; + default: + return -1; } X_FORWARDED_HOST: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } X_FORWARDED_P: NEXT_CHAR(); switch (ch) { - - case 'R': - if (last) { + case 'R': + if (last) { + return -1; + } + goto X_FORWARDED_PR; + case 'r': + if (last) { + return -1; + } + goto X_FORWARDED_PR; + default: return -1; - } - goto X_FORWARDED_PR; - - - case 'r': - if (last) { - return -1; - } - goto X_FORWARDED_PR; - - default: - return -1; } X_FORWARDED_PR: NEXT_CHAR(); switch (ch) { - - case 'O': - if (last) { - return -1; - } - goto X_FORWARDED_PRO; - - - case 'o': - if (last) { + case 'O': + if (last) { + return -1; + } + goto X_FORWARDED_PRO; + case 'o': + if (last) { + return -1; + } + goto X_FORWARDED_PRO; + default: return -1; - } - goto X_FORWARDED_PRO; - - default: - return -1; } X_FORWARDED_PRO: NEXT_CHAR(); switch (ch) { - - case 'T': - if (last) { - return -1; - } - goto X_FORWARDED_PROT; - - - case 't': - if (last) { + case 'T': + if (last) { + return -1; + } + goto X_FORWARDED_PROT; + case 't': + if (last) { + return -1; + } + goto X_FORWARDED_PROT; + default: return -1; - } - goto X_FORWARDED_PROT; - - default: - return -1; } X_FORWARDED_PROT: NEXT_CHAR(); switch (ch) { - - case 'O': - if (last) { - return 77; - } - goto X_FORWARDED_PROTO; - - - case 'o': - if (last) { - return 77; - } - goto X_FORWARDED_PROTO; - - default: - return -1; + case 'O': + if (last) { + return 77; + } + goto X_FORWARDED_PROTO; + case 'o': + if (last) { + return 77; + } + goto X_FORWARDED_PROTO; + default: + return -1; } X_FORWARDED_PROTO: NEXT_CHAR(); switch (ch) { - default: - return -1; + default: + return -1; } missing: diff --git a/tools/gen.py b/tools/gen.py index 1f55b9f7d51..0ce0ee22ebf 100755 --- a/tools/gen.py +++ b/tools/gen.py @@ -60,18 +60,17 @@ def build(headers): NEXT_CHAR(); switch (ch) {{ {cases} - default: - return -1; + default: + return -1; }} """ -CASE = """ - case '{char}': - if (last) {{ - return {index}; - }} - goto {next}; -""" +CASE = """\ + case '{char}': + if (last) {{ + return {index}; + }} + goto {next};""" FOOTER = """ missing: From eba32bbb607aa3a45f3f4e19ff2f198c01bca1fa Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Fri, 22 Jun 2018 10:49:21 +0300 Subject: [PATCH 20/22] Improve code generator --- aiohttp/_find_header.c | 678 +++++------------------------------------ aiohttp/_headers.pxi | 2 +- aiohttp/hdrs.py | 4 + tools/gen.py | 19 +- 4 files changed, 99 insertions(+), 604 deletions(-) diff --git a/aiohttp/_find_header.c b/aiohttp/_find_header.c index 63b15a5f6c3..c40041fb11e 100644 --- a/aiohttp/_find_header.c +++ b/aiohttp/_find_header.c @@ -1,3 +1,5 @@ +/* The file is autogenerated from aiohtt/hdrs.py +Run ./tools/gen.py to update it after the origin changing. */ #include "_find_header.h" @@ -504,15 +506,8 @@ find_header(const char *str, int size) default: return -1; } - ACCEPT_CHARSET: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; ACCEPT_E: NEXT_CHAR(); switch (ch) { @@ -631,15 +626,8 @@ find_header(const char *str, int size) default: return -1; } - ACCEPT_ENCODING: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; ACCEPT_L: NEXT_CHAR(); switch (ch) { @@ -758,15 +746,8 @@ find_header(const char *str, int size) default: return -1; } - ACCEPT_LANGUAGE: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; ACCEPT_R: NEXT_CHAR(); switch (ch) { @@ -851,15 +832,8 @@ find_header(const char *str, int size) default: return -1; } - ACCEPT_RANGES: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; ACCES: NEXT_CHAR(); switch (ch) { @@ -1363,15 +1337,8 @@ find_header(const char *str, int size) default: return -1; } - ACCESS_CONTROL_ALLOW_CREDENTIALS: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; ACCESS_CONTROL_ALLOW_H: NEXT_CHAR(); switch (ch) { @@ -1473,15 +1440,8 @@ find_header(const char *str, int size) default: return -1; } - ACCESS_CONTROL_ALLOW_HEADERS: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; ACCESS_CONTROL_ALLOW_M: NEXT_CHAR(); switch (ch) { @@ -1583,15 +1543,8 @@ find_header(const char *str, int size) default: return -1; } - ACCESS_CONTROL_ALLOW_METHODS: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; ACCESS_CONTROL_ALLOW_O: NEXT_CHAR(); switch (ch) { @@ -1676,15 +1629,8 @@ find_header(const char *str, int size) default: return -1; } - ACCESS_CONTROL_ALLOW_ORIGIN: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; ACCESS_CONTROL_E: NEXT_CHAR(); switch (ch) { @@ -1900,15 +1846,8 @@ find_header(const char *str, int size) default: return -1; } - ACCESS_CONTROL_EXPOSE_HEADERS: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; ACCESS_CONTROL_M: NEXT_CHAR(); switch (ch) { @@ -2005,15 +1944,8 @@ find_header(const char *str, int size) default: return -1; } - ACCESS_CONTROL_MAX_AGE: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; ACCESS_CONTROL_R: NEXT_CHAR(); switch (ch) { @@ -2256,15 +2188,8 @@ find_header(const char *str, int size) default: return -1; } - ACCESS_CONTROL_REQUEST_HEADERS: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; ACCESS_CONTROL_REQUEST_M: NEXT_CHAR(); switch (ch) { @@ -2349,15 +2274,8 @@ find_header(const char *str, int size) default: return -1; } - ACCESS_CONTROL_REQUEST_METHOD: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; AG: NEXT_CHAR(); switch (ch) { @@ -2374,15 +2292,8 @@ find_header(const char *str, int size) default: return -1; } - AGE: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; AL: NEXT_CHAR(); switch (ch) { @@ -2433,15 +2344,8 @@ find_header(const char *str, int size) default: return -1; } - ALLOW: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; AU: NEXT_CHAR(); switch (ch) { @@ -2628,15 +2532,8 @@ find_header(const char *str, int size) default: return -1; } - AUTHORIZATION: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; C: NEXT_CHAR(); switch (ch) { @@ -2845,15 +2742,8 @@ find_header(const char *str, int size) default: return -1; } - CACHE_CONTROL: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; CO: NEXT_CHAR(); switch (ch) { @@ -3009,15 +2899,8 @@ find_header(const char *str, int size) default: return -1; } - CONNECTION: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; CONT: NEXT_CHAR(); switch (ch) { @@ -3317,15 +3200,8 @@ find_header(const char *str, int size) default: return -1; } - CONTENT_DISPOSITION: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; CONTENT_E: NEXT_CHAR(); switch (ch) { @@ -3444,15 +3320,8 @@ find_header(const char *str, int size) default: return -1; } - CONTENT_ENCODING: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; CONTENT_L: NEXT_CHAR(); switch (ch) { @@ -3591,15 +3460,8 @@ find_header(const char *str, int size) default: return -1; } - CONTENT_LANGUAGE: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; CONTENT_LE: NEXT_CHAR(); switch (ch) { @@ -3667,15 +3529,8 @@ find_header(const char *str, int size) default: return -1; } - CONTENT_LENGTH: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; CONTENT_LO: NEXT_CHAR(); switch (ch) { @@ -3777,15 +3632,8 @@ find_header(const char *str, int size) default: return -1; } - CONTENT_LOCATION: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; CONTENT_M: NEXT_CHAR(); switch (ch) { @@ -3814,15 +3662,8 @@ find_header(const char *str, int size) default: return -1; } - CONTENT_MD5: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; CONTENT_R: NEXT_CHAR(); switch (ch) { @@ -3890,15 +3731,8 @@ find_header(const char *str, int size) default: return -1; } - CONTENT_RANGE: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; CONTENT_T: NEXT_CHAR(); switch (ch) { @@ -4175,15 +4009,8 @@ find_header(const char *str, int size) default: return -1; } - CONTENT_TRANSFER_ENCODING: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; CONTENT_TY: NEXT_CHAR(); switch (ch) { @@ -4217,15 +4044,8 @@ find_header(const char *str, int size) default: return -1; } - CONTENT_TYPE: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; COO: NEXT_CHAR(); switch (ch) { @@ -4276,15 +4096,8 @@ find_header(const char *str, int size) default: return -1; } - COOKIE: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; D: NEXT_CHAR(); switch (ch) { @@ -4355,15 +4168,8 @@ find_header(const char *str, int size) default: return -1; } - DATE: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; DE: NEXT_CHAR(); switch (ch) { @@ -4516,15 +4322,8 @@ find_header(const char *str, int size) default: return -1; } - DESTINATION: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; DI: NEXT_CHAR(); switch (ch) { @@ -4592,15 +4391,8 @@ find_header(const char *str, int size) default: return -1; } - DIGEST: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; E: NEXT_CHAR(); switch (ch) { @@ -4661,15 +4453,8 @@ find_header(const char *str, int size) default: return -1; } - ETAG: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; EX: NEXT_CHAR(); switch (ch) { @@ -4747,15 +4532,8 @@ find_header(const char *str, int size) default: return -1; } - EXPECT: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; EXPI: NEXT_CHAR(); switch (ch) { @@ -4806,15 +4584,8 @@ find_header(const char *str, int size) default: return -1; } - EXPIRES: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; F: NEXT_CHAR(); switch (ch) { @@ -4960,15 +4731,8 @@ find_header(const char *str, int size) default: return -1; } - FORWARDED: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; FR: NEXT_CHAR(); switch (ch) { @@ -5002,15 +4766,8 @@ find_header(const char *str, int size) default: return -1; } - FROM: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; H: NEXT_CHAR(); switch (ch) { @@ -5061,15 +4818,8 @@ find_header(const char *str, int size) default: return -1; } - HOST: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; I: NEXT_CHAR(); switch (ch) { @@ -5223,15 +4973,8 @@ find_header(const char *str, int size) default: return -1; } - IF_MATCH: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; IF_MO: NEXT_CHAR(); switch (ch) { @@ -5430,15 +5173,8 @@ find_header(const char *str, int size) default: return -1; } - IF_MODIFIED_SINCE: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; IF_N: NEXT_CHAR(); switch (ch) { @@ -5586,15 +5322,8 @@ find_header(const char *str, int size) default: return -1; } - IF_NONE_MATCH: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; IF_R: NEXT_CHAR(); switch (ch) { @@ -5662,15 +5391,8 @@ find_header(const char *str, int size) default: return -1; } - IF_RANGE: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; IF_U: NEXT_CHAR(); switch (ch) { @@ -5920,15 +5642,8 @@ find_header(const char *str, int size) default: return -1; } - IF_UNMODIFIED_SINCE: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; K: NEXT_CHAR(); switch (ch) { @@ -6076,15 +5791,8 @@ find_header(const char *str, int size) default: return -1; } - KEEP_ALIVE: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; L: NEXT_CHAR(); switch (ch) { @@ -6308,15 +6016,8 @@ find_header(const char *str, int size) default: return -1; } - LAST_EVENT_ID: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; LAST_M: NEXT_CHAR(); switch (ch) { @@ -6435,15 +6136,8 @@ find_header(const char *str, int size) default: return -1; } - LAST_MODIFIED: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; LI: NEXT_CHAR(); switch (ch) { @@ -6477,15 +6171,8 @@ find_header(const char *str, int size) default: return -1; } - LINK: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; LO: NEXT_CHAR(); switch (ch) { @@ -6587,15 +6274,8 @@ find_header(const char *str, int size) default: return -1; } - LOCATION: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; M: NEXT_CHAR(); switch (ch) { @@ -6777,15 +6457,8 @@ find_header(const char *str, int size) default: return -1; } - MAX_FORWARDS: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; O: NEXT_CHAR(); switch (ch) { @@ -6870,15 +6543,8 @@ find_header(const char *str, int size) default: return -1; } - ORIGIN: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; P: NEXT_CHAR(); switch (ch) { @@ -6973,15 +6639,8 @@ find_header(const char *str, int size) default: return -1; } - PRAGMA: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; PRO: NEXT_CHAR(); switch (ch) { @@ -7236,15 +6895,8 @@ find_header(const char *str, int size) default: return -1; } - PROXY_AUTHENTICATE: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; R: NEXT_CHAR(); switch (ch) { @@ -7322,15 +6974,8 @@ find_header(const char *str, int size) default: return -1; } - RANGE: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; RE: NEXT_CHAR(); switch (ch) { @@ -7425,15 +7070,8 @@ find_header(const char *str, int size) default: return -1; } - REFERER: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; RET: NEXT_CHAR(); switch (ch) { @@ -7564,15 +7202,8 @@ find_header(const char *str, int size) default: return -1; } - RETRY_AFTER: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; S: NEXT_CHAR(); switch (ch) { @@ -7945,15 +7576,8 @@ find_header(const char *str, int size) default: return -1; } - SEC_WEBSOCKET_ACCEPT: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; SEC_WEBSOCKET_E: NEXT_CHAR(); switch (ch) { @@ -8106,15 +7730,8 @@ find_header(const char *str, int size) default: return -1; } - SEC_WEBSOCKET_EXTENSIONS: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; SEC_WEBSOCKET_K: NEXT_CHAR(); switch (ch) { @@ -8160,15 +7777,8 @@ find_header(const char *str, int size) default: return -1; } - SEC_WEBSOCKET_KEY1: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; SEC_WEBSOCKET_P: NEXT_CHAR(); switch (ch) { @@ -8287,15 +7897,8 @@ find_header(const char *str, int size) default: return -1; } - SEC_WEBSOCKET_PROTOCOL: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; SEC_WEBSOCKET_V: NEXT_CHAR(); switch (ch) { @@ -8397,15 +8000,8 @@ find_header(const char *str, int size) default: return -1; } - SEC_WEBSOCKET_VERSION: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; SER: NEXT_CHAR(); switch (ch) { @@ -8456,15 +8052,8 @@ find_header(const char *str, int size) default: return -1; } - SERVER: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; SET: NEXT_CHAR(); switch (ch) { @@ -8578,15 +8167,8 @@ find_header(const char *str, int size) default: return -1; } - SET_COOKIE: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; T: NEXT_CHAR(); switch (ch) { @@ -8613,15 +8195,8 @@ find_header(const char *str, int size) default: return -1; } - TE: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; TR: NEXT_CHAR(); switch (ch) { @@ -8716,15 +8291,8 @@ find_header(const char *str, int size) default: return -1; } - TRAILER: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; TRAN: NEXT_CHAR(); switch (ch) { @@ -8940,15 +8508,8 @@ find_header(const char *str, int size) default: return -1; } - TRANSFER_ENCODING: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; U: NEXT_CHAR(); switch (ch) { @@ -9070,15 +8631,8 @@ find_header(const char *str, int size) default: return -1; } - UPGRADE: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; UR: NEXT_CHAR(); switch (ch) { @@ -9095,15 +8649,8 @@ find_header(const char *str, int size) default: return -1; } - URI: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; US: NEXT_CHAR(); switch (ch) { @@ -9234,15 +8781,8 @@ find_header(const char *str, int size) default: return -1; } - USER_AGENT: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; V: NEXT_CHAR(); switch (ch) { @@ -9303,15 +8843,8 @@ find_header(const char *str, int size) default: return -1; } - VARY: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; VI: NEXT_CHAR(); switch (ch) { @@ -9328,15 +8861,8 @@ find_header(const char *str, int size) default: return -1; } - VIA: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; W: NEXT_CHAR(); switch (ch) { @@ -9531,15 +9057,8 @@ find_header(const char *str, int size) default: return -1; } - WANT_DIGEST: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; WAR: NEXT_CHAR(); switch (ch) { @@ -9607,15 +9126,8 @@ find_header(const char *str, int size) default: return -1; } - WARNING: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; WE: NEXT_CHAR(); switch (ch) { @@ -9734,15 +9246,8 @@ find_header(const char *str, int size) default: return -1; } - WEBSOCKET: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; WW: NEXT_CHAR(); switch (ch) { @@ -9975,15 +9480,8 @@ find_header(const char *str, int size) default: return -1; } - WWW_AUTHENTICATE: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; X: NEXT_CHAR(); switch (ch) { @@ -10231,15 +9729,8 @@ find_header(const char *str, int size) default: return -1; } - X_FORWARDED_FOR: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; X_FORWARDED_H: NEXT_CHAR(); switch (ch) { @@ -10290,15 +9781,8 @@ find_header(const char *str, int size) default: return -1; } - X_FORWARDED_HOST: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; X_FORWARDED_P: NEXT_CHAR(); switch (ch) { @@ -10366,15 +9850,9 @@ find_header(const char *str, int size) default: return -1; } - X_FORWARDED_PROTO: - NEXT_CHAR(); - switch (ch) { - - default: - return -1; - } - + goto migging; missing: + /* nothing found */ return -1; } diff --git a/aiohttp/_headers.pxi b/aiohttp/_headers.pxi index 06e1b76d41f..e953fa5c7fd 100644 --- a/aiohttp/_headers.pxi +++ b/aiohttp/_headers.pxi @@ -1,4 +1,4 @@ -from . import hdrs +# The file is autogenerated from aiohtt/hdrs.py# Run ./tools/gen.py to update it after the origin changing.from . import hdrs cdef tuple headers = ( hdrs.ACCEPT, hdrs.ACCEPT_CHARSET, diff --git a/aiohttp/hdrs.py b/aiohttp/hdrs.py index b49d79b1043..f6dfa491184 100644 --- a/aiohttp/hdrs.py +++ b/aiohttp/hdrs.py @@ -1,4 +1,8 @@ """HTTP Headers constants.""" + +# After changing the file content call ./tools/gen.py +# to regenerate the headers parser + from multidict import istr diff --git a/tools/gen.py b/tools/gen.py index 0ce0ee22ebf..e32b8914923 100755 --- a/tools/gen.py +++ b/tools/gen.py @@ -30,7 +30,10 @@ def build(headers): dct = build(headers) -HEADER = """ +HEADER = """\ +/* The file is autogenerated from aiohtt/hdrs.py +Run ./tools/gen.py to update it after the origin changing. */ + #include "_find_header.h" #define NEXT_CHAR() \\ @@ -72,8 +75,13 @@ def build(headers): }} goto {next};""" +GOTO_MISSING = """\ +{label}: + goto migging;""" + FOOTER = """ missing: + /* nothing found */ return -1; } """ @@ -97,14 +105,17 @@ def gen_block(dct, prefix, used_blocks, out): else: index = -1 hi = k.upper() + lo = k.lower() case = CASE.format(char=hi, index=index, next=next_prefix) cases.append(case) - lo = k.lower() if lo != hi: case = CASE.format(char=lo, index=index, next=next_prefix) cases.append(case) label = prefix if prefix else 'INITIAL' - block = BLOCK.format(label=label, cases='\n'.join(cases)) + if cases: + block = BLOCK.format(label=label, cases='\n'.join(cases)) + else: + block = GOTO_MISSING.format(label=label) out.write(block) for k, v in dct.items(): if not isinstance(v, defaultdict): @@ -126,6 +137,8 @@ def gen(dct): def gen_headers(headers): out = io.StringIO() + out.write("# The file is autogenerated from aiohtt/hdrs.py") + out.write("# Run ./tools/gen.py to update it after the origin changing.") out.write("from . import hdrs\n") out.write("cdef tuple headers = (\n") for hdr in headers: From 781e8d47515a749a302122767f2a0c53041c9857 Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Fri, 22 Jun 2018 11:05:40 +0300 Subject: [PATCH 21/22] Improve formatting --- aiohttp/_find_header.c | 298 ++++++++++++++++++++--------------------- tools/gen.py | 21 ++- 2 files changed, 159 insertions(+), 160 deletions(-) diff --git a/aiohttp/_find_header.c b/aiohttp/_find_header.c index c40041fb11e..3b656f99f68 100644 --- a/aiohttp/_find_header.c +++ b/aiohttp/_find_header.c @@ -506,8 +506,7 @@ find_header(const char *str, int size) default: return -1; } -ACCEPT_CHARSET: - goto migging; + ACCEPT_E: NEXT_CHAR(); switch (ch) { @@ -626,8 +625,7 @@ find_header(const char *str, int size) default: return -1; } -ACCEPT_ENCODING: - goto migging; + ACCEPT_L: NEXT_CHAR(); switch (ch) { @@ -746,8 +744,7 @@ find_header(const char *str, int size) default: return -1; } -ACCEPT_LANGUAGE: - goto migging; + ACCEPT_R: NEXT_CHAR(); switch (ch) { @@ -832,8 +829,7 @@ find_header(const char *str, int size) default: return -1; } -ACCEPT_RANGES: - goto migging; + ACCES: NEXT_CHAR(); switch (ch) { @@ -1337,8 +1333,7 @@ find_header(const char *str, int size) default: return -1; } -ACCESS_CONTROL_ALLOW_CREDENTIALS: - goto migging; + ACCESS_CONTROL_ALLOW_H: NEXT_CHAR(); switch (ch) { @@ -1440,8 +1435,7 @@ find_header(const char *str, int size) default: return -1; } -ACCESS_CONTROL_ALLOW_HEADERS: - goto migging; + ACCESS_CONTROL_ALLOW_M: NEXT_CHAR(); switch (ch) { @@ -1543,8 +1537,7 @@ find_header(const char *str, int size) default: return -1; } -ACCESS_CONTROL_ALLOW_METHODS: - goto migging; + ACCESS_CONTROL_ALLOW_O: NEXT_CHAR(); switch (ch) { @@ -1629,8 +1622,7 @@ find_header(const char *str, int size) default: return -1; } -ACCESS_CONTROL_ALLOW_ORIGIN: - goto migging; + ACCESS_CONTROL_E: NEXT_CHAR(); switch (ch) { @@ -1846,8 +1838,7 @@ find_header(const char *str, int size) default: return -1; } -ACCESS_CONTROL_EXPOSE_HEADERS: - goto migging; + ACCESS_CONTROL_M: NEXT_CHAR(); switch (ch) { @@ -1944,8 +1935,7 @@ find_header(const char *str, int size) default: return -1; } -ACCESS_CONTROL_MAX_AGE: - goto migging; + ACCESS_CONTROL_R: NEXT_CHAR(); switch (ch) { @@ -2188,8 +2178,7 @@ find_header(const char *str, int size) default: return -1; } -ACCESS_CONTROL_REQUEST_HEADERS: - goto migging; + ACCESS_CONTROL_REQUEST_M: NEXT_CHAR(); switch (ch) { @@ -2274,8 +2263,7 @@ find_header(const char *str, int size) default: return -1; } -ACCESS_CONTROL_REQUEST_METHOD: - goto migging; + AG: NEXT_CHAR(); switch (ch) { @@ -2292,8 +2280,7 @@ find_header(const char *str, int size) default: return -1; } -AGE: - goto migging; + AL: NEXT_CHAR(); switch (ch) { @@ -2344,8 +2331,7 @@ find_header(const char *str, int size) default: return -1; } -ALLOW: - goto migging; + AU: NEXT_CHAR(); switch (ch) { @@ -2532,8 +2518,7 @@ find_header(const char *str, int size) default: return -1; } -AUTHORIZATION: - goto migging; + C: NEXT_CHAR(); switch (ch) { @@ -2742,8 +2727,7 @@ find_header(const char *str, int size) default: return -1; } -CACHE_CONTROL: - goto migging; + CO: NEXT_CHAR(); switch (ch) { @@ -2899,8 +2883,7 @@ find_header(const char *str, int size) default: return -1; } -CONNECTION: - goto migging; + CONT: NEXT_CHAR(); switch (ch) { @@ -3200,8 +3183,7 @@ find_header(const char *str, int size) default: return -1; } -CONTENT_DISPOSITION: - goto migging; + CONTENT_E: NEXT_CHAR(); switch (ch) { @@ -3320,8 +3302,7 @@ find_header(const char *str, int size) default: return -1; } -CONTENT_ENCODING: - goto migging; + CONTENT_L: NEXT_CHAR(); switch (ch) { @@ -3460,8 +3441,7 @@ find_header(const char *str, int size) default: return -1; } -CONTENT_LANGUAGE: - goto migging; + CONTENT_LE: NEXT_CHAR(); switch (ch) { @@ -3529,8 +3509,7 @@ find_header(const char *str, int size) default: return -1; } -CONTENT_LENGTH: - goto migging; + CONTENT_LO: NEXT_CHAR(); switch (ch) { @@ -3632,8 +3611,7 @@ find_header(const char *str, int size) default: return -1; } -CONTENT_LOCATION: - goto migging; + CONTENT_M: NEXT_CHAR(); switch (ch) { @@ -3662,8 +3640,7 @@ find_header(const char *str, int size) default: return -1; } -CONTENT_MD5: - goto migging; + CONTENT_R: NEXT_CHAR(); switch (ch) { @@ -3731,8 +3708,7 @@ find_header(const char *str, int size) default: return -1; } -CONTENT_RANGE: - goto migging; + CONTENT_T: NEXT_CHAR(); switch (ch) { @@ -4009,8 +3985,7 @@ find_header(const char *str, int size) default: return -1; } -CONTENT_TRANSFER_ENCODING: - goto migging; + CONTENT_TY: NEXT_CHAR(); switch (ch) { @@ -4044,8 +4019,7 @@ find_header(const char *str, int size) default: return -1; } -CONTENT_TYPE: - goto migging; + COO: NEXT_CHAR(); switch (ch) { @@ -4096,8 +4070,7 @@ find_header(const char *str, int size) default: return -1; } -COOKIE: - goto migging; + D: NEXT_CHAR(); switch (ch) { @@ -4168,8 +4141,7 @@ find_header(const char *str, int size) default: return -1; } -DATE: - goto migging; + DE: NEXT_CHAR(); switch (ch) { @@ -4322,8 +4294,7 @@ find_header(const char *str, int size) default: return -1; } -DESTINATION: - goto migging; + DI: NEXT_CHAR(); switch (ch) { @@ -4391,8 +4362,7 @@ find_header(const char *str, int size) default: return -1; } -DIGEST: - goto migging; + E: NEXT_CHAR(); switch (ch) { @@ -4453,8 +4423,7 @@ find_header(const char *str, int size) default: return -1; } -ETAG: - goto migging; + EX: NEXT_CHAR(); switch (ch) { @@ -4532,8 +4501,7 @@ find_header(const char *str, int size) default: return -1; } -EXPECT: - goto migging; + EXPI: NEXT_CHAR(); switch (ch) { @@ -4584,8 +4552,7 @@ find_header(const char *str, int size) default: return -1; } -EXPIRES: - goto migging; + F: NEXT_CHAR(); switch (ch) { @@ -4731,8 +4698,7 @@ find_header(const char *str, int size) default: return -1; } -FORWARDED: - goto migging; + FR: NEXT_CHAR(); switch (ch) { @@ -4766,8 +4732,7 @@ find_header(const char *str, int size) default: return -1; } -FROM: - goto migging; + H: NEXT_CHAR(); switch (ch) { @@ -4818,8 +4783,7 @@ find_header(const char *str, int size) default: return -1; } -HOST: - goto migging; + I: NEXT_CHAR(); switch (ch) { @@ -4973,8 +4937,7 @@ find_header(const char *str, int size) default: return -1; } -IF_MATCH: - goto migging; + IF_MO: NEXT_CHAR(); switch (ch) { @@ -5173,8 +5136,7 @@ find_header(const char *str, int size) default: return -1; } -IF_MODIFIED_SINCE: - goto migging; + IF_N: NEXT_CHAR(); switch (ch) { @@ -5322,8 +5284,7 @@ find_header(const char *str, int size) default: return -1; } -IF_NONE_MATCH: - goto migging; + IF_R: NEXT_CHAR(); switch (ch) { @@ -5391,8 +5352,7 @@ find_header(const char *str, int size) default: return -1; } -IF_RANGE: - goto migging; + IF_U: NEXT_CHAR(); switch (ch) { @@ -5642,8 +5602,7 @@ find_header(const char *str, int size) default: return -1; } -IF_UNMODIFIED_SINCE: - goto migging; + K: NEXT_CHAR(); switch (ch) { @@ -5791,8 +5750,7 @@ find_header(const char *str, int size) default: return -1; } -KEEP_ALIVE: - goto migging; + L: NEXT_CHAR(); switch (ch) { @@ -6016,8 +5974,7 @@ find_header(const char *str, int size) default: return -1; } -LAST_EVENT_ID: - goto migging; + LAST_M: NEXT_CHAR(); switch (ch) { @@ -6136,8 +6093,7 @@ find_header(const char *str, int size) default: return -1; } -LAST_MODIFIED: - goto migging; + LI: NEXT_CHAR(); switch (ch) { @@ -6171,8 +6127,7 @@ find_header(const char *str, int size) default: return -1; } -LINK: - goto migging; + LO: NEXT_CHAR(); switch (ch) { @@ -6274,8 +6229,7 @@ find_header(const char *str, int size) default: return -1; } -LOCATION: - goto migging; + M: NEXT_CHAR(); switch (ch) { @@ -6457,8 +6411,7 @@ find_header(const char *str, int size) default: return -1; } -MAX_FORWARDS: - goto migging; + O: NEXT_CHAR(); switch (ch) { @@ -6543,8 +6496,7 @@ find_header(const char *str, int size) default: return -1; } -ORIGIN: - goto migging; + P: NEXT_CHAR(); switch (ch) { @@ -6639,8 +6591,7 @@ find_header(const char *str, int size) default: return -1; } -PRAGMA: - goto migging; + PRO: NEXT_CHAR(); switch (ch) { @@ -6895,8 +6846,7 @@ find_header(const char *str, int size) default: return -1; } -PROXY_AUTHENTICATE: - goto migging; + R: NEXT_CHAR(); switch (ch) { @@ -6974,8 +6924,7 @@ find_header(const char *str, int size) default: return -1; } -RANGE: - goto migging; + RE: NEXT_CHAR(); switch (ch) { @@ -7070,8 +7019,7 @@ find_header(const char *str, int size) default: return -1; } -REFERER: - goto migging; + RET: NEXT_CHAR(); switch (ch) { @@ -7202,8 +7150,7 @@ find_header(const char *str, int size) default: return -1; } -RETRY_AFTER: - goto migging; + S: NEXT_CHAR(); switch (ch) { @@ -7576,8 +7523,7 @@ find_header(const char *str, int size) default: return -1; } -SEC_WEBSOCKET_ACCEPT: - goto migging; + SEC_WEBSOCKET_E: NEXT_CHAR(); switch (ch) { @@ -7730,8 +7676,7 @@ find_header(const char *str, int size) default: return -1; } -SEC_WEBSOCKET_EXTENSIONS: - goto migging; + SEC_WEBSOCKET_K: NEXT_CHAR(); switch (ch) { @@ -7777,8 +7722,7 @@ find_header(const char *str, int size) default: return -1; } -SEC_WEBSOCKET_KEY1: - goto migging; + SEC_WEBSOCKET_P: NEXT_CHAR(); switch (ch) { @@ -7897,8 +7841,7 @@ find_header(const char *str, int size) default: return -1; } -SEC_WEBSOCKET_PROTOCOL: - goto migging; + SEC_WEBSOCKET_V: NEXT_CHAR(); switch (ch) { @@ -8000,8 +7943,7 @@ find_header(const char *str, int size) default: return -1; } -SEC_WEBSOCKET_VERSION: - goto migging; + SER: NEXT_CHAR(); switch (ch) { @@ -8052,8 +7994,7 @@ find_header(const char *str, int size) default: return -1; } -SERVER: - goto migging; + SET: NEXT_CHAR(); switch (ch) { @@ -8167,8 +8108,7 @@ find_header(const char *str, int size) default: return -1; } -SET_COOKIE: - goto migging; + T: NEXT_CHAR(); switch (ch) { @@ -8195,8 +8135,7 @@ find_header(const char *str, int size) default: return -1; } -TE: - goto migging; + TR: NEXT_CHAR(); switch (ch) { @@ -8291,8 +8230,7 @@ find_header(const char *str, int size) default: return -1; } -TRAILER: - goto migging; + TRAN: NEXT_CHAR(); switch (ch) { @@ -8508,8 +8446,7 @@ find_header(const char *str, int size) default: return -1; } -TRANSFER_ENCODING: - goto migging; + U: NEXT_CHAR(); switch (ch) { @@ -8631,8 +8568,7 @@ find_header(const char *str, int size) default: return -1; } -UPGRADE: - goto migging; + UR: NEXT_CHAR(); switch (ch) { @@ -8649,8 +8585,7 @@ find_header(const char *str, int size) default: return -1; } -URI: - goto migging; + US: NEXT_CHAR(); switch (ch) { @@ -8781,8 +8716,7 @@ find_header(const char *str, int size) default: return -1; } -USER_AGENT: - goto migging; + V: NEXT_CHAR(); switch (ch) { @@ -8843,8 +8777,7 @@ find_header(const char *str, int size) default: return -1; } -VARY: - goto migging; + VI: NEXT_CHAR(); switch (ch) { @@ -8861,8 +8794,7 @@ find_header(const char *str, int size) default: return -1; } -VIA: - goto migging; + W: NEXT_CHAR(); switch (ch) { @@ -9057,8 +8989,7 @@ find_header(const char *str, int size) default: return -1; } -WANT_DIGEST: - goto migging; + WAR: NEXT_CHAR(); switch (ch) { @@ -9126,8 +9057,7 @@ find_header(const char *str, int size) default: return -1; } -WARNING: - goto migging; + WE: NEXT_CHAR(); switch (ch) { @@ -9246,8 +9176,7 @@ find_header(const char *str, int size) default: return -1; } -WEBSOCKET: - goto migging; + WW: NEXT_CHAR(); switch (ch) { @@ -9480,8 +9409,7 @@ find_header(const char *str, int size) default: return -1; } -WWW_AUTHENTICATE: - goto migging; + X: NEXT_CHAR(); switch (ch) { @@ -9729,8 +9657,7 @@ find_header(const char *str, int size) default: return -1; } -X_FORWARDED_FOR: - goto migging; + X_FORWARDED_H: NEXT_CHAR(); switch (ch) { @@ -9781,8 +9708,7 @@ find_header(const char *str, int size) default: return -1; } -X_FORWARDED_HOST: - goto migging; + X_FORWARDED_P: NEXT_CHAR(); switch (ch) { @@ -9850,8 +9776,82 @@ find_header(const char *str, int size) default: return -1; } + +ACCEPT_CHARSET: +ACCEPT_ENCODING: +ACCEPT_LANGUAGE: +ACCEPT_RANGES: +ACCESS_CONTROL_ALLOW_CREDENTIALS: +ACCESS_CONTROL_ALLOW_HEADERS: +ACCESS_CONTROL_ALLOW_METHODS: +ACCESS_CONTROL_ALLOW_ORIGIN: +ACCESS_CONTROL_EXPOSE_HEADERS: +ACCESS_CONTROL_MAX_AGE: +ACCESS_CONTROL_REQUEST_HEADERS: +ACCESS_CONTROL_REQUEST_METHOD: +AGE: +ALLOW: +AUTHORIZATION: +CACHE_CONTROL: +CONNECTION: +CONTENT_DISPOSITION: +CONTENT_ENCODING: +CONTENT_LANGUAGE: +CONTENT_LENGTH: +CONTENT_LOCATION: +CONTENT_MD5: +CONTENT_RANGE: +CONTENT_TRANSFER_ENCODING: +CONTENT_TYPE: +COOKIE: +DATE: +DESTINATION: +DIGEST: +ETAG: +EXPECT: +EXPIRES: +FORWARDED: +FROM: +HOST: +IF_MATCH: +IF_MODIFIED_SINCE: +IF_NONE_MATCH: +IF_RANGE: +IF_UNMODIFIED_SINCE: +KEEP_ALIVE: +LAST_EVENT_ID: +LAST_MODIFIED: +LINK: +LOCATION: +MAX_FORWARDS: +ORIGIN: +PRAGMA: +PROXY_AUTHENTICATE: +RANGE: +REFERER: +RETRY_AFTER: +SEC_WEBSOCKET_ACCEPT: +SEC_WEBSOCKET_EXTENSIONS: +SEC_WEBSOCKET_KEY1: +SEC_WEBSOCKET_PROTOCOL: +SEC_WEBSOCKET_VERSION: +SERVER: +SET_COOKIE: +TE: +TRAILER: +TRANSFER_ENCODING: +UPGRADE: +URI: +USER_AGENT: +VARY: +VIA: +WANT_DIGEST: +WARNING: +WEBSOCKET: +WWW_AUTHENTICATE: +X_FORWARDED_FOR: +X_FORWARDED_HOST: X_FORWARDED_PROTO: - goto migging; missing: /* nothing found */ return -1; diff --git a/tools/gen.py b/tools/gen.py index e32b8914923..28cf6c3da82 100755 --- a/tools/gen.py +++ b/tools/gen.py @@ -75,15 +75,12 @@ def build(headers): }} goto {next};""" -GOTO_MISSING = """\ -{label}: - goto migging;""" - FOOTER = """ +{missing} missing: /* nothing found */ return -1; -} +}} """ def gen_prefix(prefix, k): @@ -93,7 +90,7 @@ def gen_prefix(prefix, k): return prefix + k.upper() -def gen_block(dct, prefix, used_blocks, out): +def gen_block(dct, prefix, used_blocks, missing, out): cases = [] for k, v in dct.items(): if k is TERMINAL: @@ -114,9 +111,9 @@ def gen_block(dct, prefix, used_blocks, out): label = prefix if prefix else 'INITIAL' if cases: block = BLOCK.format(label=label, cases='\n'.join(cases)) + out.write(block) else: - block = GOTO_MISSING.format(label=label) - out.write(block) + missing.add(label) for k, v in dct.items(): if not isinstance(v, defaultdict): continue @@ -124,14 +121,16 @@ def gen_block(dct, prefix, used_blocks, out): if block_name in used_blocks: continue used_blocks.add(block_name) - gen_block(v, block_name, used_blocks, out) + gen_block(v, block_name, used_blocks, missing, out) def gen(dct): out = io.StringIO() out.write(HEADER) - gen_block(dct, '', set(), out) - out.write(FOOTER) + missing = set() + gen_block(dct, '', set(), missing, out) + missing_labels = '\n'.join(m + ':' for m in sorted(missing)) + out.write(FOOTER.format(missing=missing_labels)) return out From 552c0b362eaa7743e0a9da397d133b9f6991e3bc Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Fri, 22 Jun 2018 11:29:58 +0300 Subject: [PATCH 22/22] Title-case headers --- aiohttp/hdrs.py | 152 ++++++++++++++++++++++++------------------------ 1 file changed, 76 insertions(+), 76 deletions(-) diff --git a/aiohttp/hdrs.py b/aiohttp/hdrs.py index f6dfa491184..a2b4490e35c 100644 --- a/aiohttp/hdrs.py +++ b/aiohttp/hdrs.py @@ -21,81 +21,81 @@ METH_OPTIONS, METH_PATCH, METH_POST, METH_PUT, METH_TRACE} -ACCEPT = istr('ACCEPT') -ACCEPT_CHARSET = istr('ACCEPT-CHARSET') -ACCEPT_ENCODING = istr('ACCEPT-ENCODING') -ACCEPT_LANGUAGE = istr('ACCEPT-LANGUAGE') -ACCEPT_RANGES = istr('ACCEPT-RANGES') -ACCESS_CONTROL_MAX_AGE = istr('ACCESS-CONTROL-MAX-AGE') -ACCESS_CONTROL_ALLOW_CREDENTIALS = istr('ACCESS-CONTROL-ALLOW-CREDENTIALS') -ACCESS_CONTROL_ALLOW_HEADERS = istr('ACCESS-CONTROL-ALLOW-HEADERS') -ACCESS_CONTROL_ALLOW_METHODS = istr('ACCESS-CONTROL-ALLOW-METHODS') -ACCESS_CONTROL_ALLOW_ORIGIN = istr('ACCESS-CONTROL-ALLOW-ORIGIN') -ACCESS_CONTROL_EXPOSE_HEADERS = istr('ACCESS-CONTROL-EXPOSE-HEADERS') -ACCESS_CONTROL_REQUEST_HEADERS = istr('ACCESS-CONTROL-REQUEST-HEADERS') -ACCESS_CONTROL_REQUEST_METHOD = istr('ACCESS-CONTROL-REQUEST-METHOD') -AGE = istr('AGE') -ALLOW = istr('ALLOW') -AUTHORIZATION = istr('AUTHORIZATION') -CACHE_CONTROL = istr('CACHE-CONTROL') -CONNECTION = istr('CONNECTION') -CONTENT_DISPOSITION = istr('CONTENT-DISPOSITION') -CONTENT_ENCODING = istr('CONTENT-ENCODING') -CONTENT_LANGUAGE = istr('CONTENT-LANGUAGE') -CONTENT_LENGTH = istr('CONTENT-LENGTH') -CONTENT_LOCATION = istr('CONTENT-LOCATION') -CONTENT_MD5 = istr('CONTENT-MD5') -CONTENT_RANGE = istr('CONTENT-RANGE') -CONTENT_TRANSFER_ENCODING = istr('CONTENT-TRANSFER-ENCODING') -CONTENT_TYPE = istr('CONTENT-TYPE') -COOKIE = istr('COOKIE') -DATE = istr('DATE') -DESTINATION = istr('DESTINATION') -DIGEST = istr('DIGEST') -ETAG = istr('ETAG') -EXPECT = istr('EXPECT') -EXPIRES = istr('EXPIRES') -FORWARDED = istr('FORWARDED') -FROM = istr('FROM') -HOST = istr('HOST') -IF_MATCH = istr('IF-MATCH') -IF_MODIFIED_SINCE = istr('IF-MODIFIED-SINCE') -IF_NONE_MATCH = istr('IF-NONE-MATCH') -IF_RANGE = istr('IF-RANGE') -IF_UNMODIFIED_SINCE = istr('IF-UNMODIFIED-SINCE') -KEEP_ALIVE = istr('KEEP-ALIVE') -LAST_EVENT_ID = istr('LAST-EVENT-ID') -LAST_MODIFIED = istr('LAST-MODIFIED') -LINK = istr('LINK') -LOCATION = istr('LOCATION') -MAX_FORWARDS = istr('MAX-FORWARDS') -ORIGIN = istr('ORIGIN') -PRAGMA = istr('PRAGMA') -PROXY_AUTHENTICATE = istr('PROXY_AUTHENTICATE') -PROXY_AUTHORIZATION = istr('PROXY-AUTHORIZATION') -RANGE = istr('RANGE') -REFERER = istr('REFERER') -RETRY_AFTER = istr('RETRY-AFTER') -SEC_WEBSOCKET_ACCEPT = istr('SEC-WEBSOCKET-ACCEPT') -SEC_WEBSOCKET_VERSION = istr('SEC-WEBSOCKET-VERSION') -SEC_WEBSOCKET_PROTOCOL = istr('SEC-WEBSOCKET-PROTOCOL') -SEC_WEBSOCKET_EXTENSIONS = istr('SEC-WEBSOCKET-EXTENSIONS') -SEC_WEBSOCKET_KEY = istr('SEC-WEBSOCKET-KEY') -SEC_WEBSOCKET_KEY1 = istr('SEC-WEBSOCKET-KEY1') -SERVER = istr('SERVER') -SET_COOKIE = istr('SET-COOKIE') +ACCEPT = istr('Accept') +ACCEPT_CHARSET = istr('Accept-Charset') +ACCEPT_ENCODING = istr('Accept-Encoding') +ACCEPT_LANGUAGE = istr('Accept-Language') +ACCEPT_RANGES = istr('Accept-Ranges') +ACCESS_CONTROL_MAX_AGE = istr('Access-Control-Max-Age') +ACCESS_CONTROL_ALLOW_CREDENTIALS = istr('Access-Control-Allow-Credentials') +ACCESS_CONTROL_ALLOW_HEADERS = istr('Access-Control-Allow-Headers') +ACCESS_CONTROL_ALLOW_METHODS = istr('Access-Control-Allow-Methods') +ACCESS_CONTROL_ALLOW_ORIGIN = istr('Access-Control-Allow-Origin') +ACCESS_CONTROL_EXPOSE_HEADERS = istr('Access-Control-Expose-Headers') +ACCESS_CONTROL_REQUEST_HEADERS = istr('Access-Control-Request-Headers') +ACCESS_CONTROL_REQUEST_METHOD = istr('Access-Control-Request-Method') +AGE = istr('Age') +ALLOW = istr('Allow') +AUTHORIZATION = istr('Authorization') +CACHE_CONTROL = istr('Cache-Control') +CONNECTION = istr('Connection') +CONTENT_DISPOSITION = istr('Content-Disposition') +CONTENT_ENCODING = istr('Content-Encoding') +CONTENT_LANGUAGE = istr('Content-Language') +CONTENT_LENGTH = istr('Content-Length') +CONTENT_LOCATION = istr('Content-Location') +CONTENT_MD5 = istr('Content-MD5') +CONTENT_RANGE = istr('Content-Range') +CONTENT_TRANSFER_ENCODING = istr('Content-Transfer-Encoding') +CONTENT_TYPE = istr('Content-Type') +COOKIE = istr('Cookie') +DATE = istr('Date') +DESTINATION = istr('Destination') +DIGEST = istr('Digest') +ETAG = istr('Etag') +EXPECT = istr('Expect') +EXPIRES = istr('Expires') +FORWARDED = istr('Forwarded') +FROM = istr('From') +HOST = istr('Host') +IF_MATCH = istr('If-Match') +IF_MODIFIED_SINCE = istr('If-Modified-Since') +IF_NONE_MATCH = istr('If-None-Match') +IF_RANGE = istr('If-Range') +IF_UNMODIFIED_SINCE = istr('If-Unmodified-Since') +KEEP_ALIVE = istr('Keep-Alive') +LAST_EVENT_ID = istr('Last-Event-ID') +LAST_MODIFIED = istr('Last-Modified') +LINK = istr('Link') +LOCATION = istr('Location') +MAX_FORWARDS = istr('Max-Forwards') +ORIGIN = istr('Origin') +PRAGMA = istr('Pragma') +PROXY_AUTHENTICATE = istr('Proxy-Authenticate') +PROXY_AUTHORIZATION = istr('Proxy-Authorization') +RANGE = istr('Range') +REFERER = istr('Referer') +RETRY_AFTER = istr('Retry-After') +SEC_WEBSOCKET_ACCEPT = istr('Sec-WebSocket-Accept') +SEC_WEBSOCKET_VERSION = istr('Sec-WebSocket-Version') +SEC_WEBSOCKET_PROTOCOL = istr('Sec-WebSocket-Protocol') +SEC_WEBSOCKET_EXTENSIONS = istr('Sec-WebSocket-Extensions') +SEC_WEBSOCKET_KEY = istr('Sec-WebSocket-Key') +SEC_WEBSOCKET_KEY1 = istr('Sec-WebSocket-Key1') +SERVER = istr('Server') +SET_COOKIE = istr('Set-Cookie') TE = istr('TE') -TRAILER = istr('TRAILER') -TRANSFER_ENCODING = istr('TRANSFER-ENCODING') -UPGRADE = istr('UPGRADE') -WEBSOCKET = istr('WEBSOCKET') +TRAILER = istr('Trailer') +TRANSFER_ENCODING = istr('Transfer-Encoding') +UPGRADE = istr('Upgrade') +WEBSOCKET = istr('WebSocket') URI = istr('URI') -USER_AGENT = istr('USER-AGENT') -VARY = istr('VARY') -VIA = istr('VIA') -WANT_DIGEST = istr('WANT-DIGEST') -WARNING = istr('WARNING') -WWW_AUTHENTICATE = istr('WWW-AUTHENTICATE') -X_FORWARDED_FOR = istr('X-FORWARDED-FOR') -X_FORWARDED_HOST = istr('X-FORWARDED-HOST') -X_FORWARDED_PROTO = istr('X-FORWARDED-PROTO') +USER_AGENT = istr('User-Agent') +VARY = istr('Vary') +VIA = istr('Via') +WANT_DIGEST = istr('Want-Digest') +WARNING = istr('Warning') +WWW_AUTHENTICATE = istr('WWW-Authenticate') +X_FORWARDED_FOR = istr('X-Forwarded-For') +X_FORWARDED_HOST = istr('X-Forwarded-Host') +X_FORWARDED_PROTO = istr('X-Forwarded-Proto')