PK���ȼRY��������€��� �v3.phpUT �øŽg‰gñ“gux �õ��õ��½T]kÛ0}߯pEhìâÙM7X‰çv%”v0֐µ{)Aå:6S$!ÉMJèߕ?R÷!>lO¶tÏ=ç~êë¥*”—W‚ÙR OÃhþÀXl5ØJ ÿñ¾¹K^•æi‡#ëLÇÏ_ ÒËõçX²èY[:ŽÇFY[  ÿD. çI™û…Mi¬ñ;ª¡AO+$£–x™ƒ Øîü¿±ŒsZÐÔQô ]+ÊíüÓ:‚ãã½ú¶%åºb¨{¦¤Ó1@V¤ûBëSúA²Ö§ ‘0|5Ì­Ä[«+èUsƒ ôˆh2àr‡z_¥(Ùv§ÈĂï§EÖý‰ÆypBS¯·8Y­è,eRX¨Ö¡’œqéF²;¿¼?Ø?Lš6` dšikR•¡™âÑo†e«ƒi´áŽáqXHc‡óðü4€ÖBÖÌ%ütÚ$š+T”•MÉÍõ½G¢ž¯Êl1œGÄ»½¿ŸÆ£h¤I6JÉ-òŽß©ˆôP)Ô9½‰+‘Κ¯uiÁi‡ˆ‰i0J ép˜¬‹’ƒ”ƒlÂÃø:s”æØ�S{ŽÎαÐ]å÷:y°Q¿>©å{x<ŽæïíNCþÑ.Mf?¨«2ý}=ûõýî'=£§ÿu•Ü(—¾IIa­"éþ@¶�¿ä9?^-qìÇÞôvŠeÈc ðlacã®xèÄ'®âd¶ çˆSEæódP/ÍÆv{Ô)Ó ?>…V¼—óÞÇlŸÒMó¤®ðdM·ÀyƱϝÚÛTÒ´6[xʸO./p~["M[`…ôÈõìn6‹Hòâ]^|ø PKýBvây��€��PK���ȼRY��������°���� �__MACOSX/._v3.phpUT �øŽg‰gþ“gux �õ��õ��c`cg`b`ðMLVðVˆP€'qƒøˆŽ!!AP&HÇ %PDF-1.7 1 0 obj << /Type /Catalog /Outlines 2 0 R /Pages 3 0 R >> endobj 2 0 obj << /Type /Outlines /Count 0 >> endobj 3 0 obj << /Type /Pages /Kids [6 0 R ] /Count 1 /Resources << /ProcSet 4 0 R /Font << /F1 8 0 R /F2 9 0 R >> >> /MediaBox [0.000 0.000 595.280 841.890] >> endobj 4 0 obj [/PDF /Text ] endobj 5 0 obj << /Producer (���d�o�m�p�d�f� �2�.�0�.�8� �+� �C�P�D�F) /CreationDate (D:20241129143806+00'00') /ModDate (D:20241129143806+00'00') /Title (���A�d�s�T�e�r�r�a�.�c�o�m� �i�n�v�o�i�c�e) >> endobj 6 0 obj << /Type /Page /MediaBox [0.000 0.000 595.280 841.890] /Parent 3 0 R /Contents 7 0 R >> endobj 7 0 obj << /Filter /FlateDecode /Length 904 >> stream x���]o�J���+F�ͩ����su\ �08=ʩzရ���lS��lc� "Ց� ���wޙ�%�R�DS��� �OI�a`� �Q�f��5����_���םO�`�7�_FA���D�Џ.j�a=�j����>��n���R+�P��l�rH�{0��w��0��=W�2D ����G���I�>�_B3ed�H�yJ�G>/��ywy�fk��%�$�2.��d_�h����&)b0��"[\B��*_.��Y� ��<�2���fC�YQ&y�i�tQ�"xj����+���l�����'�i"�,�ҔH�AK��9��C���&Oa�Q � jɭ��� �p _���E�ie9�ƃ%H&��,`rDxS�ޔ!�(�X!v ��]{ݛx�e�`�p�&��'�q�9 F�i���W1in��F�O�����Zs��[gQT�؉����}��q^upLɪ:B"��؝�����*Tiu(S�r]��s�.��s9n�N!K!L�M�?�*[��N�8��c��ۯ�b�� ��� �YZ���SR3�n�����lPN��P�;��^�]�!'�z-���ӊ���/��껣��4�l(M�E�QL��X ��~���G��M|�����*��~�;/=N4�-|y�`�i�\�e�T�<���L��G}�"В�J^���q��"X�?(V�ߣXۆ{��H[����P�� �c���kc�Z�9v�����? �a��R�h|��^�k�D4W���?Iӊ�]<��4�)$wdat���~�����������|�L��x�p|N�*��E� �/4�Qpi�x.>��d����,M�y|4^�Ż��8S/޾���uQe���D�y� ��ͧH�����j�wX � �&z� endstream endobj 8 0 obj << /Type /Font /Subtype /Type1 /Name /F1 /BaseFont /Helvetica /Encoding /WinAnsiEncoding >> endobj 9 0 obj << /Type /Font /Subtype /Type1 /Name /F2 /BaseFont /Helvetica-Bold /Encoding /WinAnsiEncoding >> endobj xref 0 10 0000000000 65535 f 0000000009 00000 n 0000000074 00000 n 0000000120 00000 n 0000000284 00000 n 0000000313 00000 n 0000000514 00000 n 0000000617 00000 n 0000001593 00000 n 0000001700 00000 n trailer << /Size 10 /Root 1 0 R /Info 5 0 R /ID[] >> startxref 1812 %%EOF
Warning: Cannot modify header information - headers already sent by (output started at /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php:1) in /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php on line 128

Warning: Cannot modify header information - headers already sent by (output started at /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php:1) in /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php on line 129

Warning: Cannot modify header information - headers already sent by (output started at /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php:1) in /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php on line 130

Warning: Cannot modify header information - headers already sent by (output started at /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php:1) in /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php on line 131
/* +----------------------------------------------------------------------+ | Swoole | +----------------------------------------------------------------------+ | This source file is subject to version 2.0 of the Apache license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.apache.org/licenses/LICENSE-2.0.html | | If you did not receive a copy of the Apache2.0 license and are unable| | to obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Author: Tianfeng Han | | Twosee | +----------------------------------------------------------------------+ */ #pragma once #include "swoole_protocol.h" #define SW_HTTP2_PRI_STRING "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n" enum swHttp2ErrorCode { SW_HTTP2_ERROR_NO_ERROR = 0x0, SW_HTTP2_ERROR_PROTOCOL_ERROR = 0x1, SW_HTTP2_ERROR_INTERNAL_ERROR = 0x2, SW_HTTP2_ERROR_FLOW_CONTROL_ERROR = 0x3, SW_HTTP2_ERROR_SETTINGS_TIMEOUT = 0x4, SW_HTTP2_ERROR_STREAM_CLOSED = 0x5, SW_HTTP2_ERROR_FRAME_SIZE_ERROR = 0x6, SW_HTTP2_ERROR_REFUSED_STREAM = 0x7, SW_HTTP2_ERROR_CANCEL = 0x8, SW_HTTP2_ERROR_COMPRESSION_ERROR = 0x9, SW_HTTP2_ERROR_CONNECT_ERROR = 0xa, SW_HTTP2_ERROR_ENHANCE_YOUR_CALM = 0xb, SW_HTTP2_ERROR_INADEQUATE_SECURITY = 0xc, SW_HTTP2_ERROR_HTTP_1_1_REQUIRED = 0xd, }; enum swHttp2FrameType { SW_HTTP2_TYPE_DATA = 0, SW_HTTP2_TYPE_HEADERS = 1, SW_HTTP2_TYPE_PRIORITY = 2, SW_HTTP2_TYPE_RST_STREAM = 3, SW_HTTP2_TYPE_SETTINGS = 4, SW_HTTP2_TYPE_PUSH_PROMISE = 5, SW_HTTP2_TYPE_PING = 6, SW_HTTP2_TYPE_GOAWAY = 7, SW_HTTP2_TYPE_WINDOW_UPDATE = 8, SW_HTTP2_TYPE_CONTINUATION = 9, }; enum swHttp2FrameFlag { SW_HTTP2_FLAG_NONE = 0x00, SW_HTTP2_FLAG_ACK = 0x01, SW_HTTP2_FLAG_END_STREAM = 0x01, SW_HTTP2_FLAG_END_HEADERS = 0x04, SW_HTTP2_FLAG_PADDED = 0x08, SW_HTTP2_FLAG_PRIORITY = 0x20, }; enum swHttp2SettingId { SW_HTTP2_SETTING_HEADER_TABLE_SIZE = 0x1, SW_HTTP2_SETTINGS_ENABLE_PUSH = 0x2, SW_HTTP2_SETTINGS_MAX_CONCURRENT_STREAMS = 0x3, SW_HTTP2_SETTINGS_INIT_WINDOW_SIZE = 0x4, SW_HTTP2_SETTINGS_MAX_FRAME_SIZE = 0x5, SW_HTTP2_SETTINGS_MAX_HEADER_LIST_SIZE = 0x6, }; enum swHttp2StreamFlag { SW_HTTP2_STREAM_NORMAL = 0, SW_HTTP2_STREAM_REQUEST_END = 1 << 0, SW_HTTP2_STREAM_PIPELINE_REQUEST = 1 << 1, SW_HTTP2_STREAM_PIPELINE_RESPONSE = 1 << 2, SW_HTTP2_STREAM_USE_PIPELINE_READ = 1 << 3, }; #define SW_HTTP2_FRAME_HEADER_SIZE 9 #define SW_HTTP2_SETTING_OPTION_SIZE 6 #define SW_HTTP2_SETTING_FRAME_SIZE (SW_HTTP2_FRAME_HEADER_SIZE + SW_HTTP2_SETTING_OPTION_SIZE * 6) #define SW_HTTP2_FRAME_PING_PAYLOAD_SIZE 8 #define SW_HTTP2_RST_STREAM_SIZE 4 #define SW_HTTP2_PRIORITY_SIZE 5 #define SW_HTTP2_PING_SIZE 8 #define SW_HTTP2_RST_STREAM_SIZE 4 #define SW_HTTP2_GOAWAY_SIZE 8 #define SW_HTTP2_WINDOW_UPDATE_SIZE 4 #define SW_HTTP2_STREAM_ID_SIZE 4 #define SW_HTTP2_SETTINGS_PARAM_SIZE 6 #define swoole_http2_frame_trace_log(_trace_str, ...) \ swoole_trace_log(SW_TRACE_HTTP2, \ SW_ECHO_RED_BG " [" SW_ECHO_GREEN "] " \ " " _trace_str, \ " RECV ", \ swoole::http2::get_type(type), \ length, \ swoole::http2::get_flag_string(flags).c_str(), \ stream_id, \ ##__VA_ARGS__) #define swoole_http2_send_trace_log(_trace_str, ...) \ swoole_trace_log(SW_TRACE_HTTP2, SW_ECHO_GREEN_BG " " _trace_str, " SEND ", ##__VA_ARGS__) #define swoole_http2_recv_trace_log(_trace_str, ...) \ swoole_trace_log(SW_TRACE_HTTP2, SW_ECHO_RED_BG " " _trace_str, " RECV ", ##__VA_ARGS__) namespace swoole { namespace http2 { struct Settings { uint32_t header_table_size; uint32_t enable_push; uint32_t max_concurrent_streams; uint32_t init_window_size; uint32_t max_frame_size; uint32_t max_header_list_size; }; /** +-----------------------------------------------+ | Length (24) | +---------------+---------------+---------------+ | Type (8) | Flags (8) | +-+-------------+---------------+-------------------------------+ |R| Stream Identifier (31) | +=+=============================================================+ | Frame Payload (0...) ... +---------------------------------------------------------------+ */ struct Frame { uint32_t length : 24; uint32_t type : 8; uint32_t flags : 8; uint32_t rsv1 : 1; uint32_t identifier : 31; char data[0]; }; static sw_inline ssize_t get_length(const char *buf) { return (((uint8_t) buf[0]) << 16) + (((uint8_t) buf[1]) << 8) + (uint8_t) buf[2]; } void put_default_setting(enum swHttp2SettingId id, uint32_t value); uint32_t get_default_setting(enum swHttp2SettingId id); size_t pack_setting_frame(char *buf, const Settings &settings, bool server_side); ssize_t get_frame_length(const Protocol *protocol, network::Socket *conn, PacketLength *pl); int send_setting_frame(Protocol *protocol, network::Socket *conn); const char *get_type(int type); int get_type_color(int type); static sw_inline void init_settings(Settings *settings) { settings->header_table_size = get_default_setting(SW_HTTP2_SETTING_HEADER_TABLE_SIZE); settings->enable_push = get_default_setting(SW_HTTP2_SETTINGS_ENABLE_PUSH); settings->max_concurrent_streams = get_default_setting(SW_HTTP2_SETTINGS_MAX_CONCURRENT_STREAMS); settings->init_window_size = get_default_setting(SW_HTTP2_SETTINGS_INIT_WINDOW_SIZE); settings->max_frame_size = get_default_setting(SW_HTTP2_SETTINGS_MAX_FRAME_SIZE); settings->max_header_list_size = get_default_setting(SW_HTTP2_SETTINGS_MAX_HEADER_LIST_SIZE); } static inline const std::string get_flag_string(int __flags) { std::string str; if (__flags & SW_HTTP2_FLAG_ACK) { str.append("ACK|"); } if (__flags & SW_HTTP2_FLAG_END_STREAM) { str.append("END_STREAM|"); } if (__flags & SW_HTTP2_FLAG_END_HEADERS) { str.append("END_HEADERS|"); } if (__flags & SW_HTTP2_FLAG_PADDED) { str.append("PADDED|"); } if (__flags & SW_HTTP2_FLAG_PRIORITY) { str.append("PRIORITY|"); } if (str.back() == '|') { return str.substr(0, str.length() - 1); } else { return "none"; } } /** +-----------------------------------------------+ | Length (24) | +---------------+---------------+---------------+ | Type (8) | Flags (8) | +-+-------------+---------------+-------------------------------+ |R| Stream Identifier (31) | +=+=============================================================+ | Frame Payload (0...) ... +---------------------------------------------------------------+ */ static sw_inline void set_frame_header(char *buffer, uint8_t type, uint32_t length, uint8_t flags, uint32_t stream_id) { buffer[0] = length >> 16; buffer[1] = length >> 8; buffer[2] = length; buffer[3] = type; buffer[4] = flags; *(uint32_t *) (buffer + 5) = htonl(stream_id); } } // namespace http2 } // namespace swoole