From a70aa8f9be8568208ba69ca85fdea3186e04f420 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 24 Jan 2013 14:03:40 -0600 Subject: [PATCH] add parsers for web socket headers --- .../libsofia-sip-ua/http/http_basic.c | 32 +++++++++++++++++++ .../libsofia-sip-ua/http/sofia-sip/http.h | 10 ++++++ 2 files changed, 42 insertions(+) diff --git a/libs/sofia-sip/libsofia-sip-ua/http/http_basic.c b/libs/sofia-sip/libsofia-sip-ua/http/http_basic.c index 2cfcd94a56..55312c2893 100644 --- a/libs/sofia-sip/libsofia-sip-ua/http/http_basic.c +++ b/libs/sofia-sip/libsofia-sip-ua/http/http_basic.c @@ -1464,6 +1464,38 @@ HTTP_HEADER_CLASS_LIST(transfer_encoding, "Transfer-Encoding", list_critical); msg_hclass_t http_upgrade_class[] = HTTP_HEADER_CLASS_LIST(upgrade, "Upgrade", list_critical); +/* ====================================================================== */ +/**@HTTP_HEADER http_sec_websocket_key Sec-WebSocket-Key header. */ + +#define http_sec_websocket_key_d msg_generic_d +#define http_sec_websocket_key_e msg_generic_e +msg_hclass_t http_sec_websocket_key_class[] = +HTTP_HEADER_CLASS_G(sec_websocket_key, "Sec-WebSocket-Key", single); + +/* ====================================================================== */ +/**@HTTP_HEADER http_sec_websocket_protocol Sec-WebSocket-Protocol header. */ + +#define http_sec_websocket_protocol_d msg_generic_d +#define http_sec_websocket_protocol_e msg_generic_e +msg_hclass_t http_sec_websocket_protocol_class[] = +HTTP_HEADER_CLASS_G(sec_websocket_protocol, "Sec-WebSocket-Protocol", single); + +/* ====================================================================== */ +/**@HTTP_HEADER http_sec_websocket_version Sec-WebSocket-Version header. */ + +#define http_sec_websocket_version_d msg_generic_d +#define http_sec_websocket_version_e msg_generic_e +msg_hclass_t http_sec_websocket_version_class[] = +HTTP_HEADER_CLASS_G(sec_websocket_version, "Sec-WebSocket-Version", single); + +/* ====================================================================== */ +/**@HTTP_HEADER http_origin Origin header. */ + +#define http_origin_d msg_generic_d +#define http_origin_e msg_generic_e +msg_hclass_t http_origin_class[] = +HTTP_HEADER_CLASS_G(origin, "Origin", single); + /* ====================================================================== */ /**@HTTP_HEADER http_user_agent User-Agent header. */ diff --git a/libs/sofia-sip/libsofia-sip-ua/http/sofia-sip/http.h b/libs/sofia-sip/libsofia-sip-ua/http/sofia-sip/http.h index bd42743c9f..f5a9d6dd1b 100644 --- a/libs/sofia-sip/libsofia-sip-ua/http/sofia-sip/http.h +++ b/libs/sofia-sip/libsofia-sip-ua/http/sofia-sip/http.h @@ -158,6 +158,11 @@ typedef msg_auth_t http_www_authenticate_t; typedef msg_list_t http_proxy_connection_t; +typedef msg_generic_t http_sec_websocket_key_t; +typedef msg_generic_t http_origin_t; +typedef msg_generic_t http_sec_websocket_protocol_t; +typedef msg_generic_t http_sec_websocket_version_t; + typedef struct http_set_cookie_s http_set_cookie_t; typedef struct http_cookie_s http_cookie_t; @@ -382,6 +387,11 @@ struct http_s { http_set_cookie_t *http_set_cookie; /**< Set-Cookie */ http_cookie_t *http_cookie; /**< Cookie */ + http_sec_websocket_key_t *http_sec_websocket_key; /**< Sec-Websocket-Key */ + http_origin_t *http_origin; /**< Origin */ + http_sec_websocket_protocol_t *http_sec_websocket_protocol; /**< Sec-Websocket-Protocol */ + http_sec_websocket_version_t *http_sec_websocket_version; /**< Sec-Websocket-Version */ + http_mime_version_t *http_mime_version; /**< MIME-Version */ http_content_encoding_t *http_content_encoding; /**< Content-Encoding */ http_content_language_t *http_content_language; /**< Content-Language */