diff --git a/lib/handshake.c b/lib/handshake.c index 1935c25d3..d2feae8ce 100644 --- a/lib/handshake.c +++ b/lib/handshake.c @@ -113,13 +113,18 @@ libwebsocket_read(struct libwebsocket_context *context, /* it's not websocket.... shall we accept it as http? */ - if (!lws_hdr_total_length(wsi, WSI_TOKEN_GET_URI)) { + if (!lws_hdr_total_length(wsi, WSI_TOKEN_GET_URI) && !lws_hdr_total_length(wsi, WSI_TOKEN_POST_URI)) { lwsl_warn("Missing URI in HTTP request\n"); goto bail_nuke_ah; } - lwsl_info("HTTP request for '%s'\n", + if (lws_hdr_total_length(wsi, WSI_TOKEN_GET_URI)) { + lwsl_info("HTTP GET request for '%s'\n", lws_hdr_simple_ptr(wsi, WSI_TOKEN_GET_URI)); + } else if (lws_hdr_total_length(wsi, WSI_TOKEN_POST_URI)) { + lwsl_info("HTTP POST request for '%s'\n", + lws_hdr_simple_ptr(wsi, WSI_TOKEN_POST_URI)); + } if (libwebsocket_ensure_user_space(wsi)) goto bail_nuke_ah; @@ -132,8 +137,14 @@ libwebsocket_read(struct libwebsocket_context *context, */ ah = wsi->u.hdr.ah; - uri_ptr = lws_hdr_simple_ptr(wsi, WSI_TOKEN_GET_URI); - uri_len = lws_hdr_total_length(wsi, WSI_TOKEN_GET_URI); + if (lws_hdr_total_length(wsi, WSI_TOKEN_GET_URI)) { + uri_ptr = lws_hdr_simple_ptr(wsi, WSI_TOKEN_GET_URI); + uri_len = lws_hdr_total_length(wsi, WSI_TOKEN_GET_URI); + } else { + /* WSI_TOKEN_POST_URI, no if clause to make compiler happy */ + uri_ptr = lws_hdr_simple_ptr(wsi, WSI_TOKEN_POST_URI); + uri_len = lws_hdr_total_length(wsi, WSI_TOKEN_POST_URI); + } /* union transition */ memset(&wsi->u, 0, sizeof(wsi->u)); diff --git a/lib/lextable.h b/lib/lextable.h index f25102afa..7466300dc 100644 --- a/lib/lextable.h +++ b/lib/lextable.h @@ -1,261 +1,274 @@ /* pos 0: state 0 */ 0x67 /* 'g' */, 0x0C /* (to pos 24 state 1) */, - 0x68 /* 'h' */, 0x0F /* (to pos 32 state 5) */, - 0x63 /* 'c' */, 0x14 /* (to pos 44 state 10) */, - 0x73 /* 's' */, 0x21 /* (to pos 72 state 21) */, - 0x75 /* 'u' */, 0x47 /* (to pos 150 state 51) */, - 0x6F /* 'o' */, 0x4E /* (to pos 166 state 59) */, - 0x0D /* '.' */, 0x5A /* (to pos 192 state 72) */, - 0x61 /* 'a' */, 0x8B /* (to pos 292 state 122) */, - 0x69 /* 'i' */, 0x93 /* (to pos 310 state 129) */, - 0x70 /* 'p' */, 0xB8 /* (to pos 386 state 166) */, - 0x64 /* 'd' */, 0xE7 /* (to pos 482 state 214) */, - 0xF2 /* 'r' */, 0xEB /* (to pos 492 state 219) */, + 0x70 /* 'p' */, 0x0F /* (to pos 32 state 5) */, + 0x68 /* 'h' */, 0x14 /* (to pos 44 state 10) */, + 0x63 /* 'c' */, 0x19 /* (to pos 56 state 15) */, + 0x73 /* 's' */, 0x26 /* (to pos 84 state 26) */, + 0x75 /* 'u' */, 0x4C /* (to pos 162 state 56) */, + 0x6F /* 'o' */, 0x53 /* (to pos 178 state 64) */, + 0x0D /* '.' */, 0x5F /* (to pos 204 state 77) */, + 0x61 /* 'a' */, 0x90 /* (to pos 304 state 127) */, + 0x69 /* 'i' */, 0x98 /* (to pos 322 state 134) */, + 0x64 /* 'd' */, 0xF4 /* (to pos 508 state 225) */, + 0xF2 /* 'r' */, 0xF8 /* (to pos 518 state 230) */, /* pos 24: state 1 */ 0xE5 /* 'e' */, 0x01 /* (to pos 26 state 2) */, /* pos 26: state 2 */ 0xF4 /* 't' */, 0x01 /* (to pos 28 state 3) */, /* pos 28: state 3 */ 0xA0 /* ' ' */, 0x01 /* (to pos 30 state 4) */, /* pos 30: state 4 */ 0x80, 0x00 /* - terminal marker 0 - */, /* pos 32: state 5 */ 0x6F /* 'o' */, 0x02 /* (to pos 36 state 6) */, - 0xF4 /* 't' */, 0x79 /* (to pos 276 state 114) */, + 0xF2 /* 'r' */, 0xB6 /* (to pos 398 state 171) */, /* pos 36: state 6 */ 0xF3 /* 's' */, 0x01 /* (to pos 38 state 7) */, /* pos 38: state 7 */ 0xF4 /* 't' */, 0x01 /* (to pos 40 state 8) */, -/* pos 40: state 8 */ 0xBA /* ':' */, 0x01 /* (to pos 42 state 9) */, +/* pos 40: state 8 */ 0xA0 /* ' ' */, 0x01 /* (to pos 42 state 9) */, /* pos 42: state 9 */ 0x81, 0x00 /* - terminal marker 1 - */, /* pos 44: state 10 */ 0x6F /* 'o' */, 0x02 /* (to pos 48 state 11) */, - 0xE1 /* 'a' */, 0xB1 /* (to pos 400 state 173) */, -/* pos 48: state 11 */ 0x6E /* 'n' */, 0x02 /* (to pos 52 state 12) */, - 0xEF /* 'o' */, 0xC9 /* (to pos 452 state 199) */, -/* pos 52: state 12 */ 0x6E /* 'n' */, 0x02 /* (to pos 56 state 13) */, - 0xF4 /* 't' */, 0xCC /* (to pos 462 state 204) */, -/* pos 56: state 13 */ 0xE5 /* 'e' */, 0x01 /* (to pos 58 state 14) */, -/* pos 58: state 14 */ 0xE3 /* 'c' */, 0x01 /* (to pos 60 state 15) */, -/* pos 60: state 15 */ 0xF4 /* 't' */, 0x01 /* (to pos 62 state 16) */, -/* pos 62: state 16 */ 0xE9 /* 'i' */, 0x01 /* (to pos 64 state 17) */, -/* pos 64: state 17 */ 0xEF /* 'o' */, 0x01 /* (to pos 66 state 18) */, -/* pos 66: state 18 */ 0xEE /* 'n' */, 0x01 /* (to pos 68 state 19) */, -/* pos 68: state 19 */ 0xBA /* ':' */, 0x01 /* (to pos 70 state 20) */, -/* pos 70: state 20 */ 0x82, 0x00 /* - terminal marker 2 - */, -/* pos 72: state 21 */ 0xE5 /* 'e' */, 0x01 /* (to pos 74 state 22) */, -/* pos 74: state 22 */ 0xE3 /* 'c' */, 0x01 /* (to pos 76 state 23) */, -/* pos 76: state 23 */ 0xAD /* '-' */, 0x01 /* (to pos 78 state 24) */, -/* pos 78: state 24 */ 0xF7 /* 'w' */, 0x01 /* (to pos 80 state 25) */, -/* pos 80: state 25 */ 0xE5 /* 'e' */, 0x01 /* (to pos 82 state 26) */, -/* pos 82: state 26 */ 0xE2 /* 'b' */, 0x01 /* (to pos 84 state 27) */, -/* pos 84: state 27 */ 0xF3 /* 's' */, 0x01 /* (to pos 86 state 28) */, -/* pos 86: state 28 */ 0xEF /* 'o' */, 0x01 /* (to pos 88 state 29) */, -/* pos 88: state 29 */ 0xE3 /* 'c' */, 0x01 /* (to pos 90 state 30) */, -/* pos 90: state 30 */ 0xEB /* 'k' */, 0x01 /* (to pos 92 state 31) */, -/* pos 92: state 31 */ 0xE5 /* 'e' */, 0x01 /* (to pos 94 state 32) */, -/* pos 94: state 32 */ 0xF4 /* 't' */, 0x01 /* (to pos 96 state 33) */, -/* pos 96: state 33 */ 0xAD /* '-' */, 0x01 /* (to pos 98 state 34) */, -/* pos 98: state 34 */ 0x6B /* 'k' */, 0x08 /* (to pos 114 state 35) */, - 0x70 /* 'p' */, 0x10 /* (to pos 132 state 42) */, - 0x64 /* 'd' */, 0x27 /* (to pos 180 state 66) */, - 0x76 /* 'v' */, 0x2F /* (to pos 198 state 75) */, - 0x6F /* 'o' */, 0x36 /* (to pos 214 state 83) */, - 0x65 /* 'e' */, 0x3C /* (to pos 228 state 90) */, - 0x61 /* 'a' */, 0x46 /* (to pos 250 state 101) */, - 0xEE /* 'n' */, 0x4C /* (to pos 264 state 108) */, -/* pos 114: state 35 */ 0xE5 /* 'e' */, 0x01 /* (to pos 116 state 36) */, -/* pos 116: state 36 */ 0xF9 /* 'y' */, 0x01 /* (to pos 118 state 37) */, -/* pos 118: state 37 */ 0x31 /* '1' */, 0x03 /* (to pos 124 state 38) */, - 0x32 /* '2' */, 0x04 /* (to pos 128 state 40) */, - 0xBA /* ':' */, 0x25 /* (to pos 196 state 74) */, -/* pos 124: state 38 */ 0xBA /* ':' */, 0x01 /* (to pos 126 state 39) */, -/* pos 126: state 39 */ 0x83, 0x00 /* - terminal marker 3 - */, -/* pos 128: state 40 */ 0xBA /* ':' */, 0x01 /* (to pos 130 state 41) */, -/* pos 130: state 41 */ 0x84, 0x00 /* - terminal marker 4 - */, -/* pos 132: state 42 */ 0xF2 /* 'r' */, 0x01 /* (to pos 134 state 43) */, -/* pos 134: state 43 */ 0xEF /* 'o' */, 0x01 /* (to pos 136 state 44) */, -/* pos 136: state 44 */ 0xF4 /* 't' */, 0x01 /* (to pos 138 state 45) */, -/* pos 138: state 45 */ 0xEF /* 'o' */, 0x01 /* (to pos 140 state 46) */, -/* pos 140: state 46 */ 0xE3 /* 'c' */, 0x01 /* (to pos 142 state 47) */, -/* pos 142: state 47 */ 0xEF /* 'o' */, 0x01 /* (to pos 144 state 48) */, -/* pos 144: state 48 */ 0xEC /* 'l' */, 0x01 /* (to pos 146 state 49) */, -/* pos 146: state 49 */ 0xBA /* ':' */, 0x01 /* (to pos 148 state 50) */, -/* pos 148: state 50 */ 0x85, 0x00 /* - terminal marker 5 - */, -/* pos 150: state 51 */ 0xF0 /* 'p' */, 0x01 /* (to pos 152 state 52) */, -/* pos 152: state 52 */ 0xE7 /* 'g' */, 0x01 /* (to pos 154 state 53) */, -/* pos 154: state 53 */ 0xF2 /* 'r' */, 0x01 /* (to pos 156 state 54) */, -/* pos 156: state 54 */ 0xE1 /* 'a' */, 0x01 /* (to pos 158 state 55) */, -/* pos 158: state 55 */ 0xE4 /* 'd' */, 0x01 /* (to pos 160 state 56) */, -/* pos 160: state 56 */ 0xE5 /* 'e' */, 0x01 /* (to pos 162 state 57) */, -/* pos 162: state 57 */ 0xBA /* ':' */, 0x01 /* (to pos 164 state 58) */, -/* pos 164: state 58 */ 0x86, 0x00 /* - terminal marker 6 - */, -/* pos 166: state 59 */ 0xF2 /* 'r' */, 0x01 /* (to pos 168 state 60) */, -/* pos 168: state 60 */ 0xE9 /* 'i' */, 0x01 /* (to pos 170 state 61) */, -/* pos 170: state 61 */ 0xE7 /* 'g' */, 0x01 /* (to pos 172 state 62) */, -/* pos 172: state 62 */ 0xE9 /* 'i' */, 0x01 /* (to pos 174 state 63) */, -/* pos 174: state 63 */ 0xEE /* 'n' */, 0x01 /* (to pos 176 state 64) */, -/* pos 176: state 64 */ 0xBA /* ':' */, 0x01 /* (to pos 178 state 65) */, -/* pos 178: state 65 */ 0x87, 0x00 /* - terminal marker 7 - */, -/* pos 180: state 66 */ 0xF2 /* 'r' */, 0x01 /* (to pos 182 state 67) */, -/* pos 182: state 67 */ 0xE1 /* 'a' */, 0x01 /* (to pos 184 state 68) */, -/* pos 184: state 68 */ 0xE6 /* 'f' */, 0x01 /* (to pos 186 state 69) */, -/* pos 186: state 69 */ 0xF4 /* 't' */, 0x01 /* (to pos 188 state 70) */, -/* pos 188: state 70 */ 0xBA /* ':' */, 0x01 /* (to pos 190 state 71) */, -/* pos 190: state 71 */ 0x88, 0x00 /* - terminal marker 8 - */, -/* pos 192: state 72 */ 0x8A /* '.' */, 0x01 /* (to pos 194 state 73) */, -/* pos 194: state 73 */ 0x89, 0x00 /* - terminal marker 9 - */, -/* pos 196: state 74 */ 0x8A, 0x00 /* - terminal marker 10 - */, -/* pos 198: state 75 */ 0xE5 /* 'e' */, 0x01 /* (to pos 200 state 76) */, -/* pos 200: state 76 */ 0xF2 /* 'r' */, 0x01 /* (to pos 202 state 77) */, -/* pos 202: state 77 */ 0xF3 /* 's' */, 0x01 /* (to pos 204 state 78) */, -/* pos 204: state 78 */ 0xE9 /* 'i' */, 0x01 /* (to pos 206 state 79) */, -/* pos 206: state 79 */ 0xEF /* 'o' */, 0x01 /* (to pos 208 state 80) */, -/* pos 208: state 80 */ 0xEE /* 'n' */, 0x01 /* (to pos 210 state 81) */, -/* pos 210: state 81 */ 0xBA /* ':' */, 0x01 /* (to pos 212 state 82) */, -/* pos 212: state 82 */ 0x8B, 0x00 /* - terminal marker 11 - */, -/* pos 214: state 83 */ 0xF2 /* 'r' */, 0x01 /* (to pos 216 state 84) */, -/* pos 216: state 84 */ 0xE9 /* 'i' */, 0x01 /* (to pos 218 state 85) */, -/* pos 218: state 85 */ 0xE7 /* 'g' */, 0x01 /* (to pos 220 state 86) */, -/* pos 220: state 86 */ 0xE9 /* 'i' */, 0x01 /* (to pos 222 state 87) */, -/* pos 222: state 87 */ 0xEE /* 'n' */, 0x01 /* (to pos 224 state 88) */, -/* pos 224: state 88 */ 0xBA /* ':' */, 0x01 /* (to pos 226 state 89) */, -/* pos 226: state 89 */ 0x8C, 0x00 /* - terminal marker 12 - */, -/* pos 228: state 90 */ 0xF8 /* 'x' */, 0x01 /* (to pos 230 state 91) */, -/* pos 230: state 91 */ 0xF4 /* 't' */, 0x01 /* (to pos 232 state 92) */, -/* pos 232: state 92 */ 0xE5 /* 'e' */, 0x01 /* (to pos 234 state 93) */, -/* pos 234: state 93 */ 0xEE /* 'n' */, 0x01 /* (to pos 236 state 94) */, -/* pos 236: state 94 */ 0xF3 /* 's' */, 0x01 /* (to pos 238 state 95) */, -/* pos 238: state 95 */ 0xE9 /* 'i' */, 0x01 /* (to pos 240 state 96) */, -/* pos 240: state 96 */ 0xEF /* 'o' */, 0x01 /* (to pos 242 state 97) */, -/* pos 242: state 97 */ 0xEE /* 'n' */, 0x01 /* (to pos 244 state 98) */, -/* pos 244: state 98 */ 0xF3 /* 's' */, 0x01 /* (to pos 246 state 99) */, -/* pos 246: state 99 */ 0xBA /* ':' */, 0x01 /* (to pos 248 state 100) */, -/* pos 248: state 100 */ 0x8D, 0x00 /* - terminal marker 13 - */, -/* pos 250: state 101 */ 0xE3 /* 'c' */, 0x01 /* (to pos 252 state 102) */, -/* pos 252: state 102 */ 0xE3 /* 'c' */, 0x01 /* (to pos 254 state 103) */, -/* pos 254: state 103 */ 0xE5 /* 'e' */, 0x01 /* (to pos 256 state 104) */, -/* pos 256: state 104 */ 0xF0 /* 'p' */, 0x01 /* (to pos 258 state 105) */, -/* pos 258: state 105 */ 0xF4 /* 't' */, 0x01 /* (to pos 260 state 106) */, -/* pos 260: state 106 */ 0xBA /* ':' */, 0x01 /* (to pos 262 state 107) */, -/* pos 262: state 107 */ 0x8E, 0x00 /* - terminal marker 14 - */, -/* pos 264: state 108 */ 0xEF /* 'o' */, 0x01 /* (to pos 266 state 109) */, -/* pos 266: state 109 */ 0xEE /* 'n' */, 0x01 /* (to pos 268 state 110) */, -/* pos 268: state 110 */ 0xE3 /* 'c' */, 0x01 /* (to pos 270 state 111) */, -/* pos 270: state 111 */ 0xE5 /* 'e' */, 0x01 /* (to pos 272 state 112) */, -/* pos 272: state 112 */ 0xBA /* ':' */, 0x01 /* (to pos 274 state 113) */, -/* pos 274: state 113 */ 0x8F, 0x00 /* - terminal marker 15 - */, -/* pos 276: state 114 */ 0xF4 /* 't' */, 0x01 /* (to pos 278 state 115) */, -/* pos 278: state 115 */ 0xF0 /* 'p' */, 0x01 /* (to pos 280 state 116) */, -/* pos 280: state 116 */ 0xAF /* '/' */, 0x01 /* (to pos 282 state 117) */, -/* pos 282: state 117 */ 0xB1 /* '1' */, 0x01 /* (to pos 284 state 118) */, -/* pos 284: state 118 */ 0xAE /* '.' */, 0x01 /* (to pos 286 state 119) */, -/* pos 286: state 119 */ 0xB1 /* '1' */, 0x01 /* (to pos 288 state 120) */, -/* pos 288: state 120 */ 0xA0 /* ' ' */, 0x01 /* (to pos 290 state 121) */, -/* pos 290: state 121 */ 0x90, 0x00 /* - terminal marker 16 - */, -/* pos 292: state 122 */ 0x63 /* 'c' */, 0x02 /* (to pos 296 state 123) */, - 0xF5 /* 'u' */, 0x42 /* (to pos 426 state 186) */, -/* pos 296: state 123 */ 0xE3 /* 'c' */, 0x01 /* (to pos 298 state 124) */, -/* pos 298: state 124 */ 0xE5 /* 'e' */, 0x01 /* (to pos 300 state 125) */, -/* pos 300: state 125 */ 0xF0 /* 'p' */, 0x01 /* (to pos 302 state 126) */, -/* pos 302: state 126 */ 0xF4 /* 't' */, 0x01 /* (to pos 304 state 127) */, -/* pos 304: state 127 */ 0x3A /* ':' */, 0x02 /* (to pos 308 state 128) */, - 0xAD /* '-' */, 0x14 /* (to pos 346 state 147) */, -/* pos 308: state 128 */ 0x91, 0x00 /* - terminal marker 17 - */, -/* pos 310: state 129 */ 0xE6 /* 'f' */, 0x01 /* (to pos 312 state 130) */, -/* pos 312: state 130 */ 0xAD /* '-' */, 0x01 /* (to pos 314 state 131) */, -/* pos 314: state 131 */ 0xED /* 'm' */, 0x01 /* (to pos 316 state 132) */, -/* pos 316: state 132 */ 0xEF /* 'o' */, 0x01 /* (to pos 318 state 133) */, -/* pos 318: state 133 */ 0xE4 /* 'd' */, 0x01 /* (to pos 320 state 134) */, -/* pos 320: state 134 */ 0xE9 /* 'i' */, 0x01 /* (to pos 322 state 135) */, -/* pos 322: state 135 */ 0xE6 /* 'f' */, 0x01 /* (to pos 324 state 136) */, -/* pos 324: state 136 */ 0xE9 /* 'i' */, 0x01 /* (to pos 326 state 137) */, -/* pos 326: state 137 */ 0xE5 /* 'e' */, 0x01 /* (to pos 328 state 138) */, -/* pos 328: state 138 */ 0xE4 /* 'd' */, 0x01 /* (to pos 330 state 139) */, -/* pos 330: state 139 */ 0xAD /* '-' */, 0x01 /* (to pos 332 state 140) */, -/* pos 332: state 140 */ 0xF3 /* 's' */, 0x01 /* (to pos 334 state 141) */, -/* pos 334: state 141 */ 0xE9 /* 'i' */, 0x01 /* (to pos 336 state 142) */, -/* pos 336: state 142 */ 0xEE /* 'n' */, 0x01 /* (to pos 338 state 143) */, -/* pos 338: state 143 */ 0xE3 /* 'c' */, 0x01 /* (to pos 340 state 144) */, -/* pos 340: state 144 */ 0xE5 /* 'e' */, 0x01 /* (to pos 342 state 145) */, -/* pos 342: state 145 */ 0xBA /* ':' */, 0x01 /* (to pos 344 state 146) */, -/* pos 344: state 146 */ 0x92, 0x00 /* - terminal marker 18 - */, -/* pos 346: state 147 */ 0x65 /* 'e' */, 0x02 /* (to pos 350 state 148) */, - 0xEC /* 'l' */, 0x0A /* (to pos 368 state 157) */, -/* pos 350: state 148 */ 0xEE /* 'n' */, 0x01 /* (to pos 352 state 149) */, -/* pos 352: state 149 */ 0xE3 /* 'c' */, 0x01 /* (to pos 354 state 150) */, -/* pos 354: state 150 */ 0xEF /* 'o' */, 0x01 /* (to pos 356 state 151) */, -/* pos 356: state 151 */ 0xE4 /* 'd' */, 0x01 /* (to pos 358 state 152) */, -/* pos 358: state 152 */ 0xE9 /* 'i' */, 0x01 /* (to pos 360 state 153) */, -/* pos 360: state 153 */ 0xEE /* 'n' */, 0x01 /* (to pos 362 state 154) */, -/* pos 362: state 154 */ 0xE7 /* 'g' */, 0x01 /* (to pos 364 state 155) */, -/* pos 364: state 155 */ 0xBA /* ':' */, 0x01 /* (to pos 366 state 156) */, -/* pos 366: state 156 */ 0x93, 0x00 /* - terminal marker 19 - */, -/* pos 368: state 157 */ 0xE1 /* 'a' */, 0x01 /* (to pos 370 state 158) */, -/* pos 370: state 158 */ 0xEE /* 'n' */, 0x01 /* (to pos 372 state 159) */, -/* pos 372: state 159 */ 0xE7 /* 'g' */, 0x01 /* (to pos 374 state 160) */, -/* pos 374: state 160 */ 0xF5 /* 'u' */, 0x01 /* (to pos 376 state 161) */, -/* pos 376: state 161 */ 0xE1 /* 'a' */, 0x01 /* (to pos 378 state 162) */, -/* pos 378: state 162 */ 0xE7 /* 'g' */, 0x01 /* (to pos 380 state 163) */, -/* pos 380: state 163 */ 0xE5 /* 'e' */, 0x01 /* (to pos 382 state 164) */, -/* pos 382: state 164 */ 0xBA /* ':' */, 0x01 /* (to pos 384 state 165) */, -/* pos 384: state 165 */ 0x94, 0x00 /* - terminal marker 20 - */, -/* pos 386: state 166 */ 0xF2 /* 'r' */, 0x01 /* (to pos 388 state 167) */, -/* pos 388: state 167 */ 0xE1 /* 'a' */, 0x01 /* (to pos 390 state 168) */, -/* pos 390: state 168 */ 0xE7 /* 'g' */, 0x01 /* (to pos 392 state 169) */, -/* pos 392: state 169 */ 0xED /* 'm' */, 0x01 /* (to pos 394 state 170) */, -/* pos 394: state 170 */ 0xE1 /* 'a' */, 0x01 /* (to pos 396 state 171) */, -/* pos 396: state 171 */ 0xBA /* ':' */, 0x01 /* (to pos 398 state 172) */, -/* pos 398: state 172 */ 0x95, 0x00 /* - terminal marker 21 - */, -/* pos 400: state 173 */ 0xE3 /* 'c' */, 0x01 /* (to pos 402 state 174) */, -/* pos 402: state 174 */ 0xE8 /* 'h' */, 0x01 /* (to pos 404 state 175) */, -/* pos 404: state 175 */ 0xE5 /* 'e' */, 0x01 /* (to pos 406 state 176) */, -/* pos 406: state 176 */ 0xAD /* '-' */, 0x01 /* (to pos 408 state 177) */, -/* pos 408: state 177 */ 0xE3 /* 'c' */, 0x01 /* (to pos 410 state 178) */, -/* pos 410: state 178 */ 0xEF /* 'o' */, 0x01 /* (to pos 412 state 179) */, -/* pos 412: state 179 */ 0xEE /* 'n' */, 0x01 /* (to pos 414 state 180) */, -/* pos 414: state 180 */ 0xF4 /* 't' */, 0x01 /* (to pos 416 state 181) */, -/* pos 416: state 181 */ 0xF2 /* 'r' */, 0x01 /* (to pos 418 state 182) */, -/* pos 418: state 182 */ 0xEF /* 'o' */, 0x01 /* (to pos 420 state 183) */, -/* pos 420: state 183 */ 0xEC /* 'l' */, 0x01 /* (to pos 422 state 184) */, -/* pos 422: state 184 */ 0xBA /* ':' */, 0x01 /* (to pos 424 state 185) */, -/* pos 424: state 185 */ 0x96, 0x00 /* - terminal marker 22 - */, -/* pos 426: state 186 */ 0xF4 /* 't' */, 0x01 /* (to pos 428 state 187) */, -/* pos 428: state 187 */ 0xE8 /* 'h' */, 0x01 /* (to pos 430 state 188) */, -/* pos 430: state 188 */ 0xEF /* 'o' */, 0x01 /* (to pos 432 state 189) */, -/* pos 432: state 189 */ 0xF2 /* 'r' */, 0x01 /* (to pos 434 state 190) */, -/* pos 434: state 190 */ 0xE9 /* 'i' */, 0x01 /* (to pos 436 state 191) */, -/* pos 436: state 191 */ 0xFA /* 'z' */, 0x01 /* (to pos 438 state 192) */, -/* pos 438: state 192 */ 0xE1 /* 'a' */, 0x01 /* (to pos 440 state 193) */, -/* pos 440: state 193 */ 0xF4 /* 't' */, 0x01 /* (to pos 442 state 194) */, -/* pos 442: state 194 */ 0xE9 /* 'i' */, 0x01 /* (to pos 444 state 195) */, -/* pos 444: state 195 */ 0xEF /* 'o' */, 0x01 /* (to pos 446 state 196) */, -/* pos 446: state 196 */ 0xEE /* 'n' */, 0x01 /* (to pos 448 state 197) */, -/* pos 448: state 197 */ 0xBA /* ':' */, 0x01 /* (to pos 450 state 198) */, -/* pos 450: state 198 */ 0x97, 0x00 /* - terminal marker 23 - */, -/* pos 452: state 199 */ 0xEB /* 'k' */, 0x01 /* (to pos 454 state 200) */, -/* pos 454: state 200 */ 0xE9 /* 'i' */, 0x01 /* (to pos 456 state 201) */, -/* pos 456: state 201 */ 0xE5 /* 'e' */, 0x01 /* (to pos 458 state 202) */, -/* pos 458: state 202 */ 0xBA /* ':' */, 0x01 /* (to pos 460 state 203) */, -/* pos 460: state 203 */ 0x98, 0x00 /* - terminal marker 24 - */, -/* pos 462: state 204 */ 0xE5 /* 'e' */, 0x01 /* (to pos 464 state 205) */, -/* pos 464: state 205 */ 0xEE /* 'n' */, 0x01 /* (to pos 466 state 206) */, -/* pos 466: state 206 */ 0xF4 /* 't' */, 0x01 /* (to pos 468 state 207) */, -/* pos 468: state 207 */ 0xAD /* '-' */, 0x01 /* (to pos 470 state 208) */, -/* pos 470: state 208 */ 0xF4 /* 't' */, 0x01 /* (to pos 472 state 209) */, -/* pos 472: state 209 */ 0xF9 /* 'y' */, 0x01 /* (to pos 474 state 210) */, -/* pos 474: state 210 */ 0xF0 /* 'p' */, 0x01 /* (to pos 476 state 211) */, -/* pos 476: state 211 */ 0xE5 /* 'e' */, 0x01 /* (to pos 478 state 212) */, -/* pos 478: state 212 */ 0xBA /* ':' */, 0x01 /* (to pos 480 state 213) */, -/* pos 480: state 213 */ 0x99, 0x00 /* - terminal marker 25 - */, -/* pos 482: state 214 */ 0xE1 /* 'a' */, 0x01 /* (to pos 484 state 215) */, -/* pos 484: state 215 */ 0xF4 /* 't' */, 0x01 /* (to pos 486 state 216) */, -/* pos 486: state 216 */ 0xE5 /* 'e' */, 0x01 /* (to pos 488 state 217) */, -/* pos 488: state 217 */ 0xBA /* ':' */, 0x01 /* (to pos 490 state 218) */, -/* pos 490: state 218 */ 0x9A, 0x00 /* - terminal marker 26 - */, -/* pos 492: state 219 */ 0x61 /* 'a' */, 0x02 /* (to pos 496 state 220) */, - 0xE5 /* 'e' */, 0x06 /* (to pos 506 state 225) */, -/* pos 496: state 220 */ 0xEE /* 'n' */, 0x01 /* (to pos 498 state 221) */, -/* pos 498: state 221 */ 0xE7 /* 'g' */, 0x01 /* (to pos 500 state 222) */, -/* pos 500: state 222 */ 0xE5 /* 'e' */, 0x01 /* (to pos 502 state 223) */, -/* pos 502: state 223 */ 0xBA /* ':' */, 0x01 /* (to pos 504 state 224) */, -/* pos 504: state 224 */ 0x9B, 0x00 /* - terminal marker 27 - */, -/* pos 506: state 225 */ 0xE6 /* 'f' */, 0x01 /* (to pos 508 state 226) */, -/* pos 508: state 226 */ 0xE5 /* 'e' */, 0x01 /* (to pos 510 state 227) */, -/* pos 510: state 227 */ 0xF2 /* 'r' */, 0x01 /* (to pos 512 state 228) */, -/* pos 512: state 228 */ 0xE5 /* 'e' */, 0x01 /* (to pos 514 state 229) */, -/* pos 514: state 229 */ 0xF2 /* 'r' */, 0x01 /* (to pos 516 state 230) */, -/* pos 516: state 230 */ 0xBA /* ':' */, 0x01 /* (to pos 518 state 231) */, -/* pos 518: state 231 */ 0x9C, 0x00 /* - terminal marker 28 - */, -/* total size 520 bytes */ + 0xF4 /* 't' */, 0x79 /* (to pos 288 state 119) */, +/* pos 48: state 11 */ 0xF3 /* 's' */, 0x01 /* (to pos 50 state 12) */, +/* pos 50: state 12 */ 0xF4 /* 't' */, 0x01 /* (to pos 52 state 13) */, +/* pos 52: state 13 */ 0xBA /* ':' */, 0x01 /* (to pos 54 state 14) */, +/* pos 54: state 14 */ 0x82, 0x00 /* - terminal marker 2 - */, +/* pos 56: state 15 */ 0x6F /* 'o' */, 0x02 /* (to pos 60 state 16) */, + 0xE1 /* 'a' */, 0xB0 /* (to pos 410 state 177) */, +/* pos 60: state 16 */ 0x6E /* 'n' */, 0x02 /* (to pos 64 state 17) */, + 0xEF /* 'o' */, 0xC8 /* (to pos 462 state 203) */, +/* pos 64: state 17 */ 0x6E /* 'n' */, 0x02 /* (to pos 68 state 18) */, + 0xF4 /* 't' */, 0xCB /* (to pos 472 state 208) */, +/* pos 68: state 18 */ 0xE5 /* 'e' */, 0x01 /* (to pos 70 state 19) */, +/* pos 70: state 19 */ 0xE3 /* 'c' */, 0x01 /* (to pos 72 state 20) */, +/* pos 72: state 20 */ 0xF4 /* 't' */, 0x01 /* (to pos 74 state 21) */, +/* pos 74: state 21 */ 0xE9 /* 'i' */, 0x01 /* (to pos 76 state 22) */, +/* pos 76: state 22 */ 0xEF /* 'o' */, 0x01 /* (to pos 78 state 23) */, +/* pos 78: state 23 */ 0xEE /* 'n' */, 0x01 /* (to pos 80 state 24) */, +/* pos 80: state 24 */ 0xBA /* ':' */, 0x01 /* (to pos 82 state 25) */, +/* pos 82: state 25 */ 0x83, 0x00 /* - terminal marker 3 - */, +/* pos 84: state 26 */ 0xE5 /* 'e' */, 0x01 /* (to pos 86 state 27) */, +/* pos 86: state 27 */ 0xE3 /* 'c' */, 0x01 /* (to pos 88 state 28) */, +/* pos 88: state 28 */ 0xAD /* '-' */, 0x01 /* (to pos 90 state 29) */, +/* pos 90: state 29 */ 0xF7 /* 'w' */, 0x01 /* (to pos 92 state 30) */, +/* pos 92: state 30 */ 0xE5 /* 'e' */, 0x01 /* (to pos 94 state 31) */, +/* pos 94: state 31 */ 0xE2 /* 'b' */, 0x01 /* (to pos 96 state 32) */, +/* pos 96: state 32 */ 0xF3 /* 's' */, 0x01 /* (to pos 98 state 33) */, +/* pos 98: state 33 */ 0xEF /* 'o' */, 0x01 /* (to pos 100 state 34) */, +/* pos 100: state 34 */ 0xE3 /* 'c' */, 0x01 /* (to pos 102 state 35) */, +/* pos 102: state 35 */ 0xEB /* 'k' */, 0x01 /* (to pos 104 state 36) */, +/* pos 104: state 36 */ 0xE5 /* 'e' */, 0x01 /* (to pos 106 state 37) */, +/* pos 106: state 37 */ 0xF4 /* 't' */, 0x01 /* (to pos 108 state 38) */, +/* pos 108: state 38 */ 0xAD /* '-' */, 0x01 /* (to pos 110 state 39) */, +/* pos 110: state 39 */ 0x6B /* 'k' */, 0x08 /* (to pos 126 state 40) */, + 0x70 /* 'p' */, 0x10 /* (to pos 144 state 47) */, + 0x64 /* 'd' */, 0x27 /* (to pos 192 state 71) */, + 0x76 /* 'v' */, 0x2F /* (to pos 210 state 80) */, + 0x6F /* 'o' */, 0x36 /* (to pos 226 state 88) */, + 0x65 /* 'e' */, 0x3C /* (to pos 240 state 95) */, + 0x61 /* 'a' */, 0x46 /* (to pos 262 state 106) */, + 0xEE /* 'n' */, 0x4C /* (to pos 276 state 113) */, +/* pos 126: state 40 */ 0xE5 /* 'e' */, 0x01 /* (to pos 128 state 41) */, +/* pos 128: state 41 */ 0xF9 /* 'y' */, 0x01 /* (to pos 130 state 42) */, +/* pos 130: state 42 */ 0x31 /* '1' */, 0x03 /* (to pos 136 state 43) */, + 0x32 /* '2' */, 0x04 /* (to pos 140 state 45) */, + 0xBA /* ':' */, 0x25 /* (to pos 208 state 79) */, +/* pos 136: state 43 */ 0xBA /* ':' */, 0x01 /* (to pos 138 state 44) */, +/* pos 138: state 44 */ 0x84, 0x00 /* - terminal marker 4 - */, +/* pos 140: state 45 */ 0xBA /* ':' */, 0x01 /* (to pos 142 state 46) */, +/* pos 142: state 46 */ 0x85, 0x00 /* - terminal marker 5 - */, +/* pos 144: state 47 */ 0xF2 /* 'r' */, 0x01 /* (to pos 146 state 48) */, +/* pos 146: state 48 */ 0xEF /* 'o' */, 0x01 /* (to pos 148 state 49) */, +/* pos 148: state 49 */ 0xF4 /* 't' */, 0x01 /* (to pos 150 state 50) */, +/* pos 150: state 50 */ 0xEF /* 'o' */, 0x01 /* (to pos 152 state 51) */, +/* pos 152: state 51 */ 0xE3 /* 'c' */, 0x01 /* (to pos 154 state 52) */, +/* pos 154: state 52 */ 0xEF /* 'o' */, 0x01 /* (to pos 156 state 53) */, +/* pos 156: state 53 */ 0xEC /* 'l' */, 0x01 /* (to pos 158 state 54) */, +/* pos 158: state 54 */ 0xBA /* ':' */, 0x01 /* (to pos 160 state 55) */, +/* pos 160: state 55 */ 0x86, 0x00 /* - terminal marker 6 - */, +/* pos 162: state 56 */ 0xF0 /* 'p' */, 0x01 /* (to pos 164 state 57) */, +/* pos 164: state 57 */ 0xE7 /* 'g' */, 0x01 /* (to pos 166 state 58) */, +/* pos 166: state 58 */ 0xF2 /* 'r' */, 0x01 /* (to pos 168 state 59) */, +/* pos 168: state 59 */ 0xE1 /* 'a' */, 0x01 /* (to pos 170 state 60) */, +/* pos 170: state 60 */ 0xE4 /* 'd' */, 0x01 /* (to pos 172 state 61) */, +/* pos 172: state 61 */ 0xE5 /* 'e' */, 0x01 /* (to pos 174 state 62) */, +/* pos 174: state 62 */ 0xBA /* ':' */, 0x01 /* (to pos 176 state 63) */, +/* pos 176: state 63 */ 0x87, 0x00 /* - terminal marker 7 - */, +/* pos 178: state 64 */ 0xF2 /* 'r' */, 0x01 /* (to pos 180 state 65) */, +/* pos 180: state 65 */ 0xE9 /* 'i' */, 0x01 /* (to pos 182 state 66) */, +/* pos 182: state 66 */ 0xE7 /* 'g' */, 0x01 /* (to pos 184 state 67) */, +/* pos 184: state 67 */ 0xE9 /* 'i' */, 0x01 /* (to pos 186 state 68) */, +/* pos 186: state 68 */ 0xEE /* 'n' */, 0x01 /* (to pos 188 state 69) */, +/* pos 188: state 69 */ 0xBA /* ':' */, 0x01 /* (to pos 190 state 70) */, +/* pos 190: state 70 */ 0x88, 0x00 /* - terminal marker 8 - */, +/* pos 192: state 71 */ 0xF2 /* 'r' */, 0x01 /* (to pos 194 state 72) */, +/* pos 194: state 72 */ 0xE1 /* 'a' */, 0x01 /* (to pos 196 state 73) */, +/* pos 196: state 73 */ 0xE6 /* 'f' */, 0x01 /* (to pos 198 state 74) */, +/* pos 198: state 74 */ 0xF4 /* 't' */, 0x01 /* (to pos 200 state 75) */, +/* pos 200: state 75 */ 0xBA /* ':' */, 0x01 /* (to pos 202 state 76) */, +/* pos 202: state 76 */ 0x89, 0x00 /* - terminal marker 9 - */, +/* pos 204: state 77 */ 0x8A /* '.' */, 0x01 /* (to pos 206 state 78) */, +/* pos 206: state 78 */ 0x8A, 0x00 /* - terminal marker 10 - */, +/* pos 208: state 79 */ 0x8B, 0x00 /* - terminal marker 11 - */, +/* pos 210: state 80 */ 0xE5 /* 'e' */, 0x01 /* (to pos 212 state 81) */, +/* pos 212: state 81 */ 0xF2 /* 'r' */, 0x01 /* (to pos 214 state 82) */, +/* pos 214: state 82 */ 0xF3 /* 's' */, 0x01 /* (to pos 216 state 83) */, +/* pos 216: state 83 */ 0xE9 /* 'i' */, 0x01 /* (to pos 218 state 84) */, +/* pos 218: state 84 */ 0xEF /* 'o' */, 0x01 /* (to pos 220 state 85) */, +/* pos 220: state 85 */ 0xEE /* 'n' */, 0x01 /* (to pos 222 state 86) */, +/* pos 222: state 86 */ 0xBA /* ':' */, 0x01 /* (to pos 224 state 87) */, +/* pos 224: state 87 */ 0x8C, 0x00 /* - terminal marker 12 - */, +/* pos 226: state 88 */ 0xF2 /* 'r' */, 0x01 /* (to pos 228 state 89) */, +/* pos 228: state 89 */ 0xE9 /* 'i' */, 0x01 /* (to pos 230 state 90) */, +/* pos 230: state 90 */ 0xE7 /* 'g' */, 0x01 /* (to pos 232 state 91) */, +/* pos 232: state 91 */ 0xE9 /* 'i' */, 0x01 /* (to pos 234 state 92) */, +/* pos 234: state 92 */ 0xEE /* 'n' */, 0x01 /* (to pos 236 state 93) */, +/* pos 236: state 93 */ 0xBA /* ':' */, 0x01 /* (to pos 238 state 94) */, +/* pos 238: state 94 */ 0x8D, 0x00 /* - terminal marker 13 - */, +/* pos 240: state 95 */ 0xF8 /* 'x' */, 0x01 /* (to pos 242 state 96) */, +/* pos 242: state 96 */ 0xF4 /* 't' */, 0x01 /* (to pos 244 state 97) */, +/* pos 244: state 97 */ 0xE5 /* 'e' */, 0x01 /* (to pos 246 state 98) */, +/* pos 246: state 98 */ 0xEE /* 'n' */, 0x01 /* (to pos 248 state 99) */, +/* pos 248: state 99 */ 0xF3 /* 's' */, 0x01 /* (to pos 250 state 100) */, +/* pos 250: state 100 */ 0xE9 /* 'i' */, 0x01 /* (to pos 252 state 101) */, +/* pos 252: state 101 */ 0xEF /* 'o' */, 0x01 /* (to pos 254 state 102) */, +/* pos 254: state 102 */ 0xEE /* 'n' */, 0x01 /* (to pos 256 state 103) */, +/* pos 256: state 103 */ 0xF3 /* 's' */, 0x01 /* (to pos 258 state 104) */, +/* pos 258: state 104 */ 0xBA /* ':' */, 0x01 /* (to pos 260 state 105) */, +/* pos 260: state 105 */ 0x8E, 0x00 /* - terminal marker 14 - */, +/* pos 262: state 106 */ 0xE3 /* 'c' */, 0x01 /* (to pos 264 state 107) */, +/* pos 264: state 107 */ 0xE3 /* 'c' */, 0x01 /* (to pos 266 state 108) */, +/* pos 266: state 108 */ 0xE5 /* 'e' */, 0x01 /* (to pos 268 state 109) */, +/* pos 268: state 109 */ 0xF0 /* 'p' */, 0x01 /* (to pos 270 state 110) */, +/* pos 270: state 110 */ 0xF4 /* 't' */, 0x01 /* (to pos 272 state 111) */, +/* pos 272: state 111 */ 0xBA /* ':' */, 0x01 /* (to pos 274 state 112) */, +/* pos 274: state 112 */ 0x8F, 0x00 /* - terminal marker 15 - */, +/* pos 276: state 113 */ 0xEF /* 'o' */, 0x01 /* (to pos 278 state 114) */, +/* pos 278: state 114 */ 0xEE /* 'n' */, 0x01 /* (to pos 280 state 115) */, +/* pos 280: state 115 */ 0xE3 /* 'c' */, 0x01 /* (to pos 282 state 116) */, +/* pos 282: state 116 */ 0xE5 /* 'e' */, 0x01 /* (to pos 284 state 117) */, +/* pos 284: state 117 */ 0xBA /* ':' */, 0x01 /* (to pos 286 state 118) */, +/* pos 286: state 118 */ 0x90, 0x00 /* - terminal marker 16 - */, +/* pos 288: state 119 */ 0xF4 /* 't' */, 0x01 /* (to pos 290 state 120) */, +/* pos 290: state 120 */ 0xF0 /* 'p' */, 0x01 /* (to pos 292 state 121) */, +/* pos 292: state 121 */ 0xAF /* '/' */, 0x01 /* (to pos 294 state 122) */, +/* pos 294: state 122 */ 0xB1 /* '1' */, 0x01 /* (to pos 296 state 123) */, +/* pos 296: state 123 */ 0xAE /* '.' */, 0x01 /* (to pos 298 state 124) */, +/* pos 298: state 124 */ 0xB1 /* '1' */, 0x01 /* (to pos 300 state 125) */, +/* pos 300: state 125 */ 0xA0 /* ' ' */, 0x01 /* (to pos 302 state 126) */, +/* pos 302: state 126 */ 0x91, 0x00 /* - terminal marker 17 - */, +/* pos 304: state 127 */ 0x63 /* 'c' */, 0x02 /* (to pos 308 state 128) */, + 0xF5 /* 'u' */, 0x41 /* (to pos 436 state 190) */, +/* pos 308: state 128 */ 0xE3 /* 'c' */, 0x01 /* (to pos 310 state 129) */, +/* pos 310: state 129 */ 0xE5 /* 'e' */, 0x01 /* (to pos 312 state 130) */, +/* pos 312: state 130 */ 0xF0 /* 'p' */, 0x01 /* (to pos 314 state 131) */, +/* pos 314: state 131 */ 0xF4 /* 't' */, 0x01 /* (to pos 316 state 132) */, +/* pos 316: state 132 */ 0x3A /* ':' */, 0x02 /* (to pos 320 state 133) */, + 0xAD /* '-' */, 0x14 /* (to pos 358 state 152) */, +/* pos 320: state 133 */ 0x92, 0x00 /* - terminal marker 18 - */, +/* pos 322: state 134 */ 0xE6 /* 'f' */, 0x01 /* (to pos 324 state 135) */, +/* pos 324: state 135 */ 0xAD /* '-' */, 0x01 /* (to pos 326 state 136) */, +/* pos 326: state 136 */ 0xED /* 'm' */, 0x01 /* (to pos 328 state 137) */, +/* pos 328: state 137 */ 0xEF /* 'o' */, 0x01 /* (to pos 330 state 138) */, +/* pos 330: state 138 */ 0xE4 /* 'd' */, 0x01 /* (to pos 332 state 139) */, +/* pos 332: state 139 */ 0xE9 /* 'i' */, 0x01 /* (to pos 334 state 140) */, +/* pos 334: state 140 */ 0xE6 /* 'f' */, 0x01 /* (to pos 336 state 141) */, +/* pos 336: state 141 */ 0xE9 /* 'i' */, 0x01 /* (to pos 338 state 142) */, +/* pos 338: state 142 */ 0xE5 /* 'e' */, 0x01 /* (to pos 340 state 143) */, +/* pos 340: state 143 */ 0xE4 /* 'd' */, 0x01 /* (to pos 342 state 144) */, +/* pos 342: state 144 */ 0xAD /* '-' */, 0x01 /* (to pos 344 state 145) */, +/* pos 344: state 145 */ 0xF3 /* 's' */, 0x01 /* (to pos 346 state 146) */, +/* pos 346: state 146 */ 0xE9 /* 'i' */, 0x01 /* (to pos 348 state 147) */, +/* pos 348: state 147 */ 0xEE /* 'n' */, 0x01 /* (to pos 350 state 148) */, +/* pos 350: state 148 */ 0xE3 /* 'c' */, 0x01 /* (to pos 352 state 149) */, +/* pos 352: state 149 */ 0xE5 /* 'e' */, 0x01 /* (to pos 354 state 150) */, +/* pos 354: state 150 */ 0xBA /* ':' */, 0x01 /* (to pos 356 state 151) */, +/* pos 356: state 151 */ 0x93, 0x00 /* - terminal marker 19 - */, +/* pos 358: state 152 */ 0x65 /* 'e' */, 0x02 /* (to pos 362 state 153) */, + 0xEC /* 'l' */, 0x0A /* (to pos 380 state 162) */, +/* pos 362: state 153 */ 0xEE /* 'n' */, 0x01 /* (to pos 364 state 154) */, +/* pos 364: state 154 */ 0xE3 /* 'c' */, 0x01 /* (to pos 366 state 155) */, +/* pos 366: state 155 */ 0xEF /* 'o' */, 0x01 /* (to pos 368 state 156) */, +/* pos 368: state 156 */ 0xE4 /* 'd' */, 0x01 /* (to pos 370 state 157) */, +/* pos 370: state 157 */ 0xE9 /* 'i' */, 0x01 /* (to pos 372 state 158) */, +/* pos 372: state 158 */ 0xEE /* 'n' */, 0x01 /* (to pos 374 state 159) */, +/* pos 374: state 159 */ 0xE7 /* 'g' */, 0x01 /* (to pos 376 state 160) */, +/* pos 376: state 160 */ 0xBA /* ':' */, 0x01 /* (to pos 378 state 161) */, +/* pos 378: state 161 */ 0x94, 0x00 /* - terminal marker 20 - */, +/* pos 380: state 162 */ 0xE1 /* 'a' */, 0x01 /* (to pos 382 state 163) */, +/* pos 382: state 163 */ 0xEE /* 'n' */, 0x01 /* (to pos 384 state 164) */, +/* pos 384: state 164 */ 0xE7 /* 'g' */, 0x01 /* (to pos 386 state 165) */, +/* pos 386: state 165 */ 0xF5 /* 'u' */, 0x01 /* (to pos 388 state 166) */, +/* pos 388: state 166 */ 0xE1 /* 'a' */, 0x01 /* (to pos 390 state 167) */, +/* pos 390: state 167 */ 0xE7 /* 'g' */, 0x01 /* (to pos 392 state 168) */, +/* pos 392: state 168 */ 0xE5 /* 'e' */, 0x01 /* (to pos 394 state 169) */, +/* pos 394: state 169 */ 0xBA /* ':' */, 0x01 /* (to pos 396 state 170) */, +/* pos 396: state 170 */ 0x95, 0x00 /* - terminal marker 21 - */, +/* pos 398: state 171 */ 0xE1 /* 'a' */, 0x01 /* (to pos 400 state 172) */, +/* pos 400: state 172 */ 0xE7 /* 'g' */, 0x01 /* (to pos 402 state 173) */, +/* pos 402: state 173 */ 0xED /* 'm' */, 0x01 /* (to pos 404 state 174) */, +/* pos 404: state 174 */ 0xE1 /* 'a' */, 0x01 /* (to pos 406 state 175) */, +/* pos 406: state 175 */ 0xBA /* ':' */, 0x01 /* (to pos 408 state 176) */, +/* pos 408: state 176 */ 0x96, 0x00 /* - terminal marker 22 - */, +/* pos 410: state 177 */ 0xE3 /* 'c' */, 0x01 /* (to pos 412 state 178) */, +/* pos 412: state 178 */ 0xE8 /* 'h' */, 0x01 /* (to pos 414 state 179) */, +/* pos 414: state 179 */ 0xE5 /* 'e' */, 0x01 /* (to pos 416 state 180) */, +/* pos 416: state 180 */ 0xAD /* '-' */, 0x01 /* (to pos 418 state 181) */, +/* pos 418: state 181 */ 0xE3 /* 'c' */, 0x01 /* (to pos 420 state 182) */, +/* pos 420: state 182 */ 0xEF /* 'o' */, 0x01 /* (to pos 422 state 183) */, +/* pos 422: state 183 */ 0xEE /* 'n' */, 0x01 /* (to pos 424 state 184) */, +/* pos 424: state 184 */ 0xF4 /* 't' */, 0x01 /* (to pos 426 state 185) */, +/* pos 426: state 185 */ 0xF2 /* 'r' */, 0x01 /* (to pos 428 state 186) */, +/* pos 428: state 186 */ 0xEF /* 'o' */, 0x01 /* (to pos 430 state 187) */, +/* pos 430: state 187 */ 0xEC /* 'l' */, 0x01 /* (to pos 432 state 188) */, +/* pos 432: state 188 */ 0xBA /* ':' */, 0x01 /* (to pos 434 state 189) */, +/* pos 434: state 189 */ 0x97, 0x00 /* - terminal marker 23 - */, +/* pos 436: state 190 */ 0xF4 /* 't' */, 0x01 /* (to pos 438 state 191) */, +/* pos 438: state 191 */ 0xE8 /* 'h' */, 0x01 /* (to pos 440 state 192) */, +/* pos 440: state 192 */ 0xEF /* 'o' */, 0x01 /* (to pos 442 state 193) */, +/* pos 442: state 193 */ 0xF2 /* 'r' */, 0x01 /* (to pos 444 state 194) */, +/* pos 444: state 194 */ 0xE9 /* 'i' */, 0x01 /* (to pos 446 state 195) */, +/* pos 446: state 195 */ 0xFA /* 'z' */, 0x01 /* (to pos 448 state 196) */, +/* pos 448: state 196 */ 0xE1 /* 'a' */, 0x01 /* (to pos 450 state 197) */, +/* pos 450: state 197 */ 0xF4 /* 't' */, 0x01 /* (to pos 452 state 198) */, +/* pos 452: state 198 */ 0xE9 /* 'i' */, 0x01 /* (to pos 454 state 199) */, +/* pos 454: state 199 */ 0xEF /* 'o' */, 0x01 /* (to pos 456 state 200) */, +/* pos 456: state 200 */ 0xEE /* 'n' */, 0x01 /* (to pos 458 state 201) */, +/* pos 458: state 201 */ 0xBA /* ':' */, 0x01 /* (to pos 460 state 202) */, +/* pos 460: state 202 */ 0x98, 0x00 /* - terminal marker 24 - */, +/* pos 462: state 203 */ 0xEB /* 'k' */, 0x01 /* (to pos 464 state 204) */, +/* pos 464: state 204 */ 0xE9 /* 'i' */, 0x01 /* (to pos 466 state 205) */, +/* pos 466: state 205 */ 0xE5 /* 'e' */, 0x01 /* (to pos 468 state 206) */, +/* pos 468: state 206 */ 0xBA /* ':' */, 0x01 /* (to pos 470 state 207) */, +/* pos 470: state 207 */ 0x99, 0x00 /* - terminal marker 25 - */, +/* pos 472: state 208 */ 0xE5 /* 'e' */, 0x01 /* (to pos 474 state 209) */, +/* pos 474: state 209 */ 0xEE /* 'n' */, 0x01 /* (to pos 476 state 210) */, +/* pos 476: state 210 */ 0xF4 /* 't' */, 0x01 /* (to pos 478 state 211) */, +/* pos 478: state 211 */ 0xAD /* '-' */, 0x01 /* (to pos 480 state 212) */, +/* pos 480: state 212 */ 0x6C /* 'l' */, 0x02 /* (to pos 484 state 213) */, + 0xF4 /* 't' */, 0x08 /* (to pos 498 state 220) */, +/* pos 484: state 213 */ 0xE5 /* 'e' */, 0x01 /* (to pos 486 state 214) */, +/* pos 486: state 214 */ 0xEE /* 'n' */, 0x01 /* (to pos 488 state 215) */, +/* pos 488: state 215 */ 0xE7 /* 'g' */, 0x01 /* (to pos 490 state 216) */, +/* pos 490: state 216 */ 0xF4 /* 't' */, 0x01 /* (to pos 492 state 217) */, +/* pos 492: state 217 */ 0xE8 /* 'h' */, 0x01 /* (to pos 494 state 218) */, +/* pos 494: state 218 */ 0xBA /* ':' */, 0x01 /* (to pos 496 state 219) */, +/* pos 496: state 219 */ 0x9A, 0x00 /* - terminal marker 26 - */, +/* pos 498: state 220 */ 0xF9 /* 'y' */, 0x01 /* (to pos 500 state 221) */, +/* pos 500: state 221 */ 0xF0 /* 'p' */, 0x01 /* (to pos 502 state 222) */, +/* pos 502: state 222 */ 0xE5 /* 'e' */, 0x01 /* (to pos 504 state 223) */, +/* pos 504: state 223 */ 0xBA /* ':' */, 0x01 /* (to pos 506 state 224) */, +/* pos 506: state 224 */ 0x9B, 0x00 /* - terminal marker 27 - */, +/* pos 508: state 225 */ 0xE1 /* 'a' */, 0x01 /* (to pos 510 state 226) */, +/* pos 510: state 226 */ 0xF4 /* 't' */, 0x01 /* (to pos 512 state 227) */, +/* pos 512: state 227 */ 0xE5 /* 'e' */, 0x01 /* (to pos 514 state 228) */, +/* pos 514: state 228 */ 0xBA /* ':' */, 0x01 /* (to pos 516 state 229) */, +/* pos 516: state 229 */ 0x9C, 0x00 /* - terminal marker 28 - */, +/* pos 518: state 230 */ 0x61 /* 'a' */, 0x02 /* (to pos 522 state 231) */, + 0xE5 /* 'e' */, 0x06 /* (to pos 532 state 236) */, +/* pos 522: state 231 */ 0xEE /* 'n' */, 0x01 /* (to pos 524 state 232) */, +/* pos 524: state 232 */ 0xE7 /* 'g' */, 0x01 /* (to pos 526 state 233) */, +/* pos 526: state 233 */ 0xE5 /* 'e' */, 0x01 /* (to pos 528 state 234) */, +/* pos 528: state 234 */ 0xBA /* ':' */, 0x01 /* (to pos 530 state 235) */, +/* pos 530: state 235 */ 0x9D, 0x00 /* - terminal marker 29 - */, +/* pos 532: state 236 */ 0xE6 /* 'f' */, 0x01 /* (to pos 534 state 237) */, +/* pos 534: state 237 */ 0xE5 /* 'e' */, 0x01 /* (to pos 536 state 238) */, +/* pos 536: state 238 */ 0xF2 /* 'r' */, 0x01 /* (to pos 538 state 239) */, +/* pos 538: state 239 */ 0xE5 /* 'e' */, 0x01 /* (to pos 540 state 240) */, +/* pos 540: state 240 */ 0xF2 /* 'r' */, 0x01 /* (to pos 542 state 241) */, +/* pos 542: state 241 */ 0xBA /* ':' */, 0x01 /* (to pos 544 state 242) */, +/* pos 544: state 242 */ 0x9E, 0x00 /* - terminal marker 30 - */, +/* total size 546 bytes */ diff --git a/lib/libwebsockets.c b/lib/libwebsockets.c index 2cb3ab0ca..78aa03787 100644 --- a/lib/libwebsockets.c +++ b/lib/libwebsockets.c @@ -450,6 +450,9 @@ just_kill_connection: wsi->user_space) /* user code may own */ free(wsi->user_space); + if (wsi->request_body) { + free(wsi->request_body); + } free(wsi); } diff --git a/lib/libwebsockets.h b/lib/libwebsockets.h index 89e3798d7..6be5d2ba2 100644 --- a/lib/libwebsockets.h +++ b/lib/libwebsockets.h @@ -232,6 +232,7 @@ struct lws_tokens { enum lws_token_indexes { WSI_TOKEN_GET_URI, + WSI_TOKEN_POST_URI, WSI_TOKEN_HOST, WSI_TOKEN_CONNECTION, WSI_TOKEN_KEY1, @@ -264,6 +265,7 @@ enum lws_token_indexes { WSI_TOKEN_HTTP_CACHE_CONTROL, WSI_TOKEN_HTTP_AUTHORIZATION, WSI_TOKEN_HTTP_COOKIE, + WSI_TOKEN_HTTP_CONTENT_LENGTH, WSI_TOKEN_HTTP_CONTENT_TYPE, WSI_TOKEN_HTTP_DATE, WSI_TOKEN_HTTP_RANGE, @@ -1072,6 +1074,9 @@ LWS_VISIBLE LWS_EXTERN int lws_hdr_copy(struct libwebsocket *wsi, char *dest, int len, enum lws_token_indexes h); +LWS_VISIBLE LWS_EXTERN int +lws_body_copy(struct libwebsocket *wsi, char *dest, int len); + /* * Note: this is not normally needed as a user api. It's provided in case it is * useful when integrating with other app poll loop service code. diff --git a/lib/minilex.c b/lib/minilex.c index babe50e98..26b625c37 100644 --- a/lib/minilex.c +++ b/lib/minilex.c @@ -20,6 +20,7 @@ const char *set[] = { "get ", + "post ", "host:", "connection:", "sec-websocket-key1:", @@ -48,6 +49,7 @@ const char *set[] = { "cache-control:", "authorization:", "cookie:", + "content-length:", "content-type:", "date:", "range:", diff --git a/lib/parsers.c b/lib/parsers.c index 95753e5d0..96eeef275 100644 --- a/lib/parsers.c +++ b/lib/parsers.c @@ -102,6 +102,17 @@ LWS_VISIBLE int lws_hdr_copy(struct libwebsocket *wsi, char *dest, int len, return toklen; } +LWS_VISIBLE int lws_body_copy(struct libwebsocket *wsi, char *dest, int len) +{ + if (!wsi->request_body || (wsi->request_body_index >= len)) + return -1; + + memcpy(dest, wsi->request_body, wsi->request_body_index); + dest[wsi->request_body_index] = '\0'; + + return wsi->request_body_index; +} + char *lws_hdr_simple_ptr(struct libwebsocket *wsi, enum lws_token_indexes h) { int n; @@ -178,6 +189,7 @@ int libwebsocket_parse(struct libwebsocket *wsi, unsigned char c) switch (wsi->u.hdr.parser_state) { case WSI_TOKEN_GET_URI: + case WSI_TOKEN_POST_URI: case WSI_TOKEN_HOST: case WSI_TOKEN_CONNECTION: case WSI_TOKEN_KEY1: @@ -202,6 +214,7 @@ int libwebsocket_parse(struct libwebsocket *wsi, unsigned char c) case WSI_TOKEN_HTTP_CACHE_CONTROL: case WSI_TOKEN_HTTP_AUTHORIZATION: case WSI_TOKEN_HTTP_COOKIE: + case WSI_TOKEN_HTTP_CONTENT_LENGTH: case WSI_TOKEN_HTTP_CONTENT_TYPE: case WSI_TOKEN_HTTP_DATE: case WSI_TOKEN_HTTP_RANGE: @@ -216,7 +229,7 @@ int libwebsocket_parse(struct libwebsocket *wsi, unsigned char c) wsi->u.hdr.parser_state]].len && c == ' ') break; - if (wsi->u.hdr.parser_state != WSI_TOKEN_GET_URI) + if ((wsi->u.hdr.parser_state != WSI_TOKEN_GET_URI) && (wsi->u.hdr.parser_state != WSI_TOKEN_POST_URI)) goto check_eol; /* special URI processing... end at space */ @@ -391,7 +404,7 @@ swallow: if (wsi->u.hdr.lextable_pos < 0) { /* this is not a header we know about */ - if (wsi->u.hdr.ah->frag_index[WSI_TOKEN_GET_URI] || + if (wsi->u.hdr.ah->frag_index[WSI_TOKEN_GET_URI] || wsi->u.hdr.ah->frag_index[WSI_TOKEN_POST_URI] || wsi->u.hdr.ah->frag_index[WSI_TOKEN_HTTP]) { /* * altready had the method, no idea what @@ -420,6 +433,10 @@ swallow: wsi->u.hdr.ah->frag_index[WSI_TOKEN_GET_URI]) { lwsl_warn("Duplicated GET\n"); return -1; + } else if (n == WSI_TOKEN_POST_URI && + wsi->u.hdr.ah->frag_index[WSI_TOKEN_POST_URI]) { + lwsl_warn("Duplicated POST\n"); + return -1; } /* @@ -477,6 +494,7 @@ start_fragment: /* skipping arg part of a name we didn't recognize */ case WSI_TOKEN_SKIPPING: lwsl_parser("WSI_TOKEN_SKIPPING '%c'\n", c); + if (c == '\x0d') wsi->u.hdr.parser_state = WSI_TOKEN_SKIPPING_SAW_CR; break; @@ -492,6 +510,11 @@ start_fragment: /* we're done, ignore anything else */ case WSI_PARSING_COMPLETE: lwsl_parser("WSI_PARSING_COMPLETE '%c'\n", c); + if (wsi->request_content_length > 0) { + if (wsi->request_body_index < wsi->request_content_length) { + wsi->request_body[wsi->request_body_index++] = c; + } + } break; default: /* keep gcc happy */ @@ -512,6 +535,24 @@ set_parsing_complete: wsi->u.hdr.parser_state = WSI_PARSING_COMPLETE; wsi->hdr_parsing_completed = 1; + char content_length_str[255]; + int content_length = 0; + + if (lws_hdr_total_length(wsi, WSI_TOKEN_HTTP_CONTENT_LENGTH)) { + lws_hdr_copy(wsi, content_length_str, sizeof(content_length_str) - 1, WSI_TOKEN_HTTP_CONTENT_LENGTH); + content_length = atoi(content_length_str); + if (content_length > 0) { + wsi->request_body = malloc(content_length); + if (wsi->request_body) { + memset(wsi->request_body, 0, content_length); + wsi->request_content_length = content_length; + wsi->request_body_index = 0; + } else { + wsi->request_content_length = 0; + } + } + } + return 0; } diff --git a/lib/private-libwebsockets.h b/lib/private-libwebsockets.h index 740066dfd..958768bcd 100644 --- a/lib/private-libwebsockets.h +++ b/lib/private-libwebsockets.h @@ -418,6 +418,13 @@ struct libwebsocket { struct _lws_header_related hdr; struct _lws_websocket_related ws; } u; + + /* how much they said they would send */ + int request_content_length; + /* malloced buffer to store the body of a HTTP request */ + char *request_body; + /* where we are inside the buffer */ + int request_body_index; #ifdef LWS_OPENSSL_SUPPORT SSL *ssl; diff --git a/test-server/test-server.c b/test-server/test-server.c index d9382cc12..5e37b1ff8 100644 --- a/test-server/test-server.c +++ b/test-server/test-server.c @@ -115,6 +115,7 @@ dump_handshake_info(struct libwebsocket *wsi) int n; static const char *token_names[] = { /*[WSI_TOKEN_GET_URI] =*/ "GET URI", + /*[WSI_TOKEN_POST_URI] =*/ "POST URI", /*[WSI_TOKEN_HOST] =*/ "Host", /*[WSI_TOKEN_CONNECTION] =*/ "Connection", /*[WSI_TOKEN_KEY1] =*/ "key 1", @@ -146,6 +147,7 @@ dump_handshake_info(struct libwebsocket *wsi) "Cache-Control:", "Authorization:", "Cookie:", + "Content-Length:", "Content-Type:", "Date:", "Range:", @@ -285,7 +287,7 @@ static int callback_http(struct libwebsocket_context *context, libwebsocket_callback_on_writable(context, wsi); break; } - + /* if not, send a file the easy way */ strcpy(buf, resource_path); if (strcmp(in, "/")) {