test2720 (1928B)
1 <testcase> 2 <info> 3 <keywords> 4 WebSockets 5 </keywords> 6 </info> 7 8 <client> 9 <name> 10 ws: Fragmented messages with empty fragments 11 </name> 12 <features> 13 Debug 14 ws 15 </features> 16 <server> 17 http 18 </server> 19 <tool> 20 lib2700 21 </tool> 22 <command> 23 ws://%HOSTIP:%HTTPPORT/%TESTNUMBER 24 </command> 25 <setenv> 26 CURL_WS_FORCE_ZERO_MASK=1 27 </setenv> 28 </client> 29 30 <reply> 31 <servercmd> 32 upgrade 33 </servercmd> 34 35 # Full list of frames: see <verify.stdout> below 36 # 1st a message with an emtpy fragment at the beginning 37 # 2nd a message with an emtpy fragment in the middle 38 # 3rd a message with an emtpy fragment at the end 39 # 4th a message with only empty fragments 40 <data nocheck="yes" nonewline="yes"> 41 HTTP/1.1 101 Switching to WebSockets 42 Server: server/%TESTNUMBER 43 Upgrade: Websocket 44 Connection: Upgrade 45 Sec-WebSocket-Accept: HkPsVga7+8LuxM4RGQ5p9tZHeYs= 46 47 %hex[%01%00]hex%%hex[%00%02a1]hex%%hex[%80%02a2]hex%%hex[%01%02b1]hex%%hex[%00%00]hex%%hex[%80%02b2]hex%%hex[%01%02c1]hex%%hex[%00%02c2]hex%%hex[%80%00]hex%%hex[%01%00]hex%%hex[%00%00]hex%%hex[%80%00]hex%%hex[%88%00]hex% 48 </data> 49 </reply> 50 51 <verify> 52 53 # Exact echo of reply data with additional masking 54 <protocol nonewline="yes"> 55 %hex[%01%80%00%00%00%00]hex%%hex[%00%82%00%00%00%00a1]hex%%hex[%80%82%00%00%00%00a2]hex%%hex[%01%82%00%00%00%00b1]hex%%hex[%00%80%00%00%00%00]hex%%hex[%80%82%00%00%00%00b2]hex%%hex[%01%82%00%00%00%00c1]hex%%hex[%00%82%00%00%00%00c2]hex%%hex[%80%80%00%00%00%00]hex%%hex[%01%80%00%00%00%00]hex%%hex[%00%80%00%00%00%00]hex%%hex[%80%80%00%00%00%00]hex%%hex[%88%80%00%00%00%00]hex% 56 </protocol> 57 58 <stdout> 59 txt --- [0] 60 txt --- [2] a1 61 txt fin [2] a2 62 txt --- [2] b1 63 txt --- [0] 64 txt fin [2] b2 65 txt --- [2] c1 66 txt --- [2] c2 67 txt fin [0] 68 txt --- [0] 69 txt --- [0] 70 txt fin [0] 71 close [0] 72 </stdout> 73 74 # CURLE_OK 75 <errorcode> 76 0 77 </errorcode> 78 79 # Strip HTTP header from <protocol> 80 <strip> 81 ^GET /.* 82 ^(Host|User-Agent|Accept|Upgrade|Connection|Sec-WebSocket-(Version|Key)): .* 83 ^\s*$ 84 </strip> 85 </verify> 86 </testcase>