aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndy Green <andy.green@linaro.org>2013-11-09 11:04:35 +0800
committerAndy Green <andy.green@linaro.org>2013-11-09 11:40:38 +0800
commit7900256c8a17a9d07267bfe819f9b1ce90a59c5a (patch)
tree6daa7b7b2ae7e98e1d3ff2ccd6155d375130c008 /lib
parent84fd949e05d011410dba2abe93dfd2fd7dff1589 (diff)
downloadlibwebsockets-7900256c8a17a9d07267bfe819f9b1ce90a59c5a.tar.gz
allow other headers in http send file
Signed-off-by: Andy Green <andy.green@linaro.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/lextable.h427
-rw-r--r--lib/libwebsockets.h2
-rw-r--r--lib/output.c12
3 files changed, 272 insertions, 169 deletions
diff --git a/lib/lextable.h b/lib/lextable.h
index d3b8fd5e..7e3e0966 100644
--- a/lib/lextable.h
+++ b/lib/lextable.h
@@ -1,166 +1,261 @@
-/* pos 0: state 0 */ 0x47 /* 'G' */, 0x09 /* (to pos 18 state 1) */,
- 0x48 /* 'H' */, 0x0C /* (to pos 26 state 5) */,
- 0x43 /* 'C' */, 0x11 /* (to pos 38 state 10) */,
- 0x53 /* 'S' */, 0x1B /* (to pos 60 state 21) */,
- 0x55 /* 'U' */, 0x41 /* (to pos 138 state 51) */,
- 0x4F /* 'O' */, 0x48 /* (to pos 154 state 59) */,
- 0x0D /* '.' */, 0x54 /* (to pos 180 state 72) */,
- 0x41 /* 'A' */, 0x85 /* (to pos 280 state 122) */,
- 0xC9 /* 'I' */, 0x8B /* (to pos 294 state 129) */,
-/* pos 18: state 1 */ 0xC5 /* 'E' */, 0x01 /* (to pos 20 state 2) */,
-/* pos 20: state 2 */ 0xD4 /* 'T' */, 0x01 /* (to pos 22 state 3) */,
-/* pos 22: state 3 */ 0xA0 /* ' ' */, 0x01 /* (to pos 24 state 4) */,
-/* pos 24: state 4 */ 0x80, 0x00 /* - terminal marker 0 - */,
-/* pos 26: state 5 */ 0x6F /* 'o' */, 0x02 /* (to pos 30 state 6) */,
- 0xD4 /* 'T' */, 0x76 /* (to pos 264 state 114) */,
-/* pos 30: state 6 */ 0xF3 /* 's' */, 0x01 /* (to pos 32 state 7) */,
-/* pos 32: state 7 */ 0xF4 /* 't' */, 0x01 /* (to pos 34 state 8) */,
-/* pos 34: state 8 */ 0xBA /* ':' */, 0x01 /* (to pos 36 state 9) */,
-/* pos 36: state 9 */ 0x81, 0x00 /* - terminal marker 1 - */,
-/* pos 38: state 10 */ 0xEF /* 'o' */, 0x01 /* (to pos 40 state 11) */,
-/* pos 40: state 11 */ 0xEE /* 'n' */, 0x01 /* (to pos 42 state 12) */,
-/* pos 42: state 12 */ 0xEE /* 'n' */, 0x01 /* (to pos 44 state 13) */,
-/* pos 44: state 13 */ 0xE5 /* 'e' */, 0x01 /* (to pos 46 state 14) */,
-/* pos 46: state 14 */ 0xE3 /* 'c' */, 0x01 /* (to pos 48 state 15) */,
-/* pos 48: state 15 */ 0xF4 /* 't' */, 0x01 /* (to pos 50 state 16) */,
-/* pos 50: state 16 */ 0xE9 /* 'i' */, 0x01 /* (to pos 52 state 17) */,
-/* pos 52: state 17 */ 0xEF /* 'o' */, 0x01 /* (to pos 54 state 18) */,
-/* pos 54: state 18 */ 0xEE /* 'n' */, 0x01 /* (to pos 56 state 19) */,
-/* pos 56: state 19 */ 0xBA /* ':' */, 0x01 /* (to pos 58 state 20) */,
-/* pos 58: state 20 */ 0x82, 0x00 /* - terminal marker 2 - */,
-/* pos 60: state 21 */ 0xE5 /* 'e' */, 0x01 /* (to pos 62 state 22) */,
-/* pos 62: state 22 */ 0xE3 /* 'c' */, 0x01 /* (to pos 64 state 23) */,
-/* pos 64: state 23 */ 0xAD /* '-' */, 0x01 /* (to pos 66 state 24) */,
-/* pos 66: state 24 */ 0xD7 /* 'W' */, 0x01 /* (to pos 68 state 25) */,
-/* pos 68: state 25 */ 0xE5 /* 'e' */, 0x01 /* (to pos 70 state 26) */,
-/* pos 70: state 26 */ 0xE2 /* 'b' */, 0x01 /* (to pos 72 state 27) */,
-/* pos 72: state 27 */ 0xD3 /* 'S' */, 0x01 /* (to pos 74 state 28) */,
-/* pos 74: state 28 */ 0xEF /* 'o' */, 0x01 /* (to pos 76 state 29) */,
-/* pos 76: state 29 */ 0xE3 /* 'c' */, 0x01 /* (to pos 78 state 30) */,
-/* pos 78: state 30 */ 0xEB /* 'k' */, 0x01 /* (to pos 80 state 31) */,
-/* pos 80: state 31 */ 0xE5 /* 'e' */, 0x01 /* (to pos 82 state 32) */,
-/* pos 82: state 32 */ 0xF4 /* 't' */, 0x01 /* (to pos 84 state 33) */,
-/* pos 84: state 33 */ 0xAD /* '-' */, 0x01 /* (to pos 86 state 34) */,
-/* pos 86: state 34 */ 0x4B /* 'K' */, 0x08 /* (to pos 102 state 35) */,
- 0x50 /* 'P' */, 0x10 /* (to pos 120 state 42) */,
- 0x44 /* 'D' */, 0x27 /* (to pos 168 state 66) */,
- 0x56 /* 'V' */, 0x2F /* (to pos 186 state 75) */,
- 0x4F /* 'O' */, 0x36 /* (to pos 202 state 83) */,
- 0x45 /* 'E' */, 0x3C /* (to pos 216 state 90) */,
- 0x41 /* 'A' */, 0x46 /* (to pos 238 state 101) */,
- 0xCE /* 'N' */, 0x4C /* (to pos 252 state 108) */,
-/* pos 102: state 35 */ 0xE5 /* 'e' */, 0x01 /* (to pos 104 state 36) */,
-/* pos 104: state 36 */ 0xF9 /* 'y' */, 0x01 /* (to pos 106 state 37) */,
-/* pos 106: state 37 */ 0x31 /* '1' */, 0x03 /* (to pos 112 state 38) */,
- 0x32 /* '2' */, 0x04 /* (to pos 116 state 40) */,
- 0xBA /* ':' */, 0x25 /* (to pos 184 state 74) */,
-/* pos 112: state 38 */ 0xBA /* ':' */, 0x01 /* (to pos 114 state 39) */,
-/* pos 114: state 39 */ 0x83, 0x00 /* - terminal marker 3 - */,
-/* pos 116: state 40 */ 0xBA /* ':' */, 0x01 /* (to pos 118 state 41) */,
-/* pos 118: state 41 */ 0x84, 0x00 /* - terminal marker 4 - */,
-/* pos 120: state 42 */ 0xF2 /* 'r' */, 0x01 /* (to pos 122 state 43) */,
-/* pos 122: state 43 */ 0xEF /* 'o' */, 0x01 /* (to pos 124 state 44) */,
-/* pos 124: state 44 */ 0xF4 /* 't' */, 0x01 /* (to pos 126 state 45) */,
-/* pos 126: state 45 */ 0xEF /* 'o' */, 0x01 /* (to pos 128 state 46) */,
-/* pos 128: state 46 */ 0xE3 /* 'c' */, 0x01 /* (to pos 130 state 47) */,
-/* pos 130: state 47 */ 0xEF /* 'o' */, 0x01 /* (to pos 132 state 48) */,
-/* pos 132: state 48 */ 0xEC /* 'l' */, 0x01 /* (to pos 134 state 49) */,
-/* pos 134: state 49 */ 0xBA /* ':' */, 0x01 /* (to pos 136 state 50) */,
-/* pos 136: state 50 */ 0x85, 0x00 /* - terminal marker 5 - */,
-/* pos 138: state 51 */ 0xF0 /* 'p' */, 0x01 /* (to pos 140 state 52) */,
-/* pos 140: state 52 */ 0xE7 /* 'g' */, 0x01 /* (to pos 142 state 53) */,
-/* pos 142: state 53 */ 0xF2 /* 'r' */, 0x01 /* (to pos 144 state 54) */,
-/* pos 144: state 54 */ 0xE1 /* 'a' */, 0x01 /* (to pos 146 state 55) */,
-/* pos 146: state 55 */ 0xE4 /* 'd' */, 0x01 /* (to pos 148 state 56) */,
-/* pos 148: state 56 */ 0xE5 /* 'e' */, 0x01 /* (to pos 150 state 57) */,
-/* pos 150: state 57 */ 0xBA /* ':' */, 0x01 /* (to pos 152 state 58) */,
-/* pos 152: state 58 */ 0x86, 0x00 /* - terminal marker 6 - */,
-/* pos 154: state 59 */ 0xF2 /* 'r' */, 0x01 /* (to pos 156 state 60) */,
-/* pos 156: state 60 */ 0xE9 /* 'i' */, 0x01 /* (to pos 158 state 61) */,
-/* pos 158: state 61 */ 0xE7 /* 'g' */, 0x01 /* (to pos 160 state 62) */,
-/* pos 160: state 62 */ 0xE9 /* 'i' */, 0x01 /* (to pos 162 state 63) */,
-/* pos 162: state 63 */ 0xEE /* 'n' */, 0x01 /* (to pos 164 state 64) */,
-/* pos 164: state 64 */ 0xBA /* ':' */, 0x01 /* (to pos 166 state 65) */,
-/* pos 166: state 65 */ 0x87, 0x00 /* - terminal marker 7 - */,
-/* pos 168: state 66 */ 0xF2 /* 'r' */, 0x01 /* (to pos 170 state 67) */,
-/* pos 170: state 67 */ 0xE1 /* 'a' */, 0x01 /* (to pos 172 state 68) */,
-/* pos 172: state 68 */ 0xE6 /* 'f' */, 0x01 /* (to pos 174 state 69) */,
-/* pos 174: state 69 */ 0xF4 /* 't' */, 0x01 /* (to pos 176 state 70) */,
-/* pos 176: state 70 */ 0xBA /* ':' */, 0x01 /* (to pos 178 state 71) */,
-/* pos 178: state 71 */ 0x88, 0x00 /* - terminal marker 8 - */,
-/* pos 180: state 72 */ 0x8A /* '.' */, 0x01 /* (to pos 182 state 73) */,
-/* pos 182: state 73 */ 0x89, 0x00 /* - terminal marker 9 - */,
-/* pos 184: state 74 */ 0x8A, 0x00 /* - terminal marker 10 - */,
-/* pos 186: state 75 */ 0xE5 /* 'e' */, 0x01 /* (to pos 188 state 76) */,
-/* pos 188: state 76 */ 0xF2 /* 'r' */, 0x01 /* (to pos 190 state 77) */,
-/* pos 190: state 77 */ 0xF3 /* 's' */, 0x01 /* (to pos 192 state 78) */,
-/* pos 192: state 78 */ 0xE9 /* 'i' */, 0x01 /* (to pos 194 state 79) */,
-/* pos 194: state 79 */ 0xEF /* 'o' */, 0x01 /* (to pos 196 state 80) */,
-/* pos 196: state 80 */ 0xEE /* 'n' */, 0x01 /* (to pos 198 state 81) */,
-/* pos 198: state 81 */ 0xBA /* ':' */, 0x01 /* (to pos 200 state 82) */,
-/* pos 200: state 82 */ 0x8B, 0x00 /* - terminal marker 11 - */,
-/* pos 202: state 83 */ 0xF2 /* 'r' */, 0x01 /* (to pos 204 state 84) */,
-/* pos 204: state 84 */ 0xE9 /* 'i' */, 0x01 /* (to pos 206 state 85) */,
-/* pos 206: state 85 */ 0xE7 /* 'g' */, 0x01 /* (to pos 208 state 86) */,
-/* pos 208: state 86 */ 0xE9 /* 'i' */, 0x01 /* (to pos 210 state 87) */,
-/* pos 210: state 87 */ 0xEE /* 'n' */, 0x01 /* (to pos 212 state 88) */,
-/* pos 212: state 88 */ 0xBA /* ':' */, 0x01 /* (to pos 214 state 89) */,
-/* pos 214: state 89 */ 0x8C, 0x00 /* - terminal marker 12 - */,
-/* pos 216: state 90 */ 0xF8 /* 'x' */, 0x01 /* (to pos 218 state 91) */,
-/* pos 218: state 91 */ 0xF4 /* 't' */, 0x01 /* (to pos 220 state 92) */,
-/* pos 220: state 92 */ 0xE5 /* 'e' */, 0x01 /* (to pos 222 state 93) */,
-/* pos 222: state 93 */ 0xEE /* 'n' */, 0x01 /* (to pos 224 state 94) */,
-/* pos 224: state 94 */ 0xF3 /* 's' */, 0x01 /* (to pos 226 state 95) */,
-/* pos 226: state 95 */ 0xE9 /* 'i' */, 0x01 /* (to pos 228 state 96) */,
-/* pos 228: state 96 */ 0xEF /* 'o' */, 0x01 /* (to pos 230 state 97) */,
-/* pos 230: state 97 */ 0xEE /* 'n' */, 0x01 /* (to pos 232 state 98) */,
-/* pos 232: state 98 */ 0xF3 /* 's' */, 0x01 /* (to pos 234 state 99) */,
-/* pos 234: state 99 */ 0xBA /* ':' */, 0x01 /* (to pos 236 state 100) */,
-/* pos 236: state 100 */ 0x8D, 0x00 /* - terminal marker 13 - */,
-/* pos 238: state 101 */ 0xE3 /* 'c' */, 0x01 /* (to pos 240 state 102) */,
-/* pos 240: state 102 */ 0xE3 /* 'c' */, 0x01 /* (to pos 242 state 103) */,
-/* pos 242: state 103 */ 0xE5 /* 'e' */, 0x01 /* (to pos 244 state 104) */,
-/* pos 244: state 104 */ 0xF0 /* 'p' */, 0x01 /* (to pos 246 state 105) */,
-/* pos 246: state 105 */ 0xF4 /* 't' */, 0x01 /* (to pos 248 state 106) */,
-/* pos 248: state 106 */ 0xBA /* ':' */, 0x01 /* (to pos 250 state 107) */,
-/* pos 250: state 107 */ 0x8E, 0x00 /* - terminal marker 14 - */,
-/* pos 252: state 108 */ 0xEF /* 'o' */, 0x01 /* (to pos 254 state 109) */,
-/* pos 254: state 109 */ 0xEE /* 'n' */, 0x01 /* (to pos 256 state 110) */,
-/* pos 256: state 110 */ 0xE3 /* 'c' */, 0x01 /* (to pos 258 state 111) */,
-/* pos 258: state 111 */ 0xE5 /* 'e' */, 0x01 /* (to pos 260 state 112) */,
-/* pos 260: state 112 */ 0xBA /* ':' */, 0x01 /* (to pos 262 state 113) */,
-/* pos 262: state 113 */ 0x8F, 0x00 /* - terminal marker 15 - */,
-/* pos 264: state 114 */ 0xD4 /* 'T' */, 0x01 /* (to pos 266 state 115) */,
-/* pos 266: state 115 */ 0xD0 /* 'P' */, 0x01 /* (to pos 268 state 116) */,
-/* pos 268: state 116 */ 0xAF /* '/' */, 0x01 /* (to pos 270 state 117) */,
-/* pos 270: state 117 */ 0xB1 /* '1' */, 0x01 /* (to pos 272 state 118) */,
-/* pos 272: state 118 */ 0xAE /* '.' */, 0x01 /* (to pos 274 state 119) */,
-/* pos 274: state 119 */ 0xB1 /* '1' */, 0x01 /* (to pos 276 state 120) */,
-/* pos 276: state 120 */ 0xA0 /* ' ' */, 0x01 /* (to pos 278 state 121) */,
-/* pos 278: state 121 */ 0x90, 0x00 /* - terminal marker 16 - */,
-/* pos 280: state 122 */ 0xE3 /* 'c' */, 0x01 /* (to pos 282 state 123) */,
-/* pos 282: state 123 */ 0xE3 /* 'c' */, 0x01 /* (to pos 284 state 124) */,
-/* pos 284: state 124 */ 0xE5 /* 'e' */, 0x01 /* (to pos 286 state 125) */,
-/* pos 286: state 125 */ 0xF0 /* 'p' */, 0x01 /* (to pos 288 state 126) */,
-/* pos 288: state 126 */ 0xF4 /* 't' */, 0x01 /* (to pos 290 state 127) */,
-/* pos 290: state 127 */ 0xBA /* ':' */, 0x01 /* (to pos 292 state 128) */,
-/* pos 292: state 128 */ 0x91, 0x00 /* - terminal marker 17 - */,
-/* pos 294: state 129 */ 0xE6 /* 'f' */, 0x01 /* (to pos 296 state 130) */,
-/* pos 296: state 130 */ 0xAD /* '-' */, 0x01 /* (to pos 298 state 131) */,
-/* pos 298: state 131 */ 0xCD /* 'M' */, 0x01 /* (to pos 300 state 132) */,
-/* pos 300: state 132 */ 0xEF /* 'o' */, 0x01 /* (to pos 302 state 133) */,
-/* pos 302: state 133 */ 0xE4 /* 'd' */, 0x01 /* (to pos 304 state 134) */,
-/* pos 304: state 134 */ 0xE9 /* 'i' */, 0x01 /* (to pos 306 state 135) */,
-/* pos 306: state 135 */ 0xE6 /* 'f' */, 0x01 /* (to pos 308 state 136) */,
-/* pos 308: state 136 */ 0xE9 /* 'i' */, 0x01 /* (to pos 310 state 137) */,
-/* pos 310: state 137 */ 0xE5 /* 'e' */, 0x01 /* (to pos 312 state 138) */,
-/* pos 312: state 138 */ 0xE4 /* 'd' */, 0x01 /* (to pos 314 state 139) */,
-/* pos 314: state 139 */ 0xAD /* '-' */, 0x01 /* (to pos 316 state 140) */,
-/* pos 316: state 140 */ 0xD3 /* 'S' */, 0x01 /* (to pos 318 state 141) */,
-/* pos 318: state 141 */ 0xE9 /* 'i' */, 0x01 /* (to pos 320 state 142) */,
-/* pos 320: state 142 */ 0xEE /* 'n' */, 0x01 /* (to pos 322 state 143) */,
-/* pos 322: state 143 */ 0xE3 /* 'c' */, 0x01 /* (to pos 324 state 144) */,
-/* pos 324: state 144 */ 0xE5 /* 'e' */, 0x01 /* (to pos 326 state 145) */,
-/* pos 326: state 145 */ 0xBA /* ':' */, 0x01 /* (to pos 328 state 146) */,
-/* pos 328: state 146 */ 0x92, 0x00 /* - terminal marker 18 - */,
-/* total size 330 bytes */
+/* pos 0: state 0 */ 0x47 /* 'G' */, 0x0C /* (to pos 24 state 1) */,
+ 0x48 /* 'H' */, 0x0F /* (to pos 32 state 5) */,
+ 0x43 /* 'C' */, 0x14 /* (to pos 44 state 10) */,
+ 0x53 /* 'S' */, 0x21 /* (to pos 72 state 21) */,
+ 0x55 /* 'U' */, 0x47 /* (to pos 150 state 51) */,
+ 0x4F /* 'O' */, 0x4E /* (to pos 166 state 59) */,
+ 0x0D /* '.' */, 0x5A /* (to pos 192 state 72) */,
+ 0x41 /* 'A' */, 0x8B /* (to pos 292 state 122) */,
+ 0x49 /* 'I' */, 0x93 /* (to pos 310 state 129) */,
+ 0x50 /* 'P' */, 0xB8 /* (to pos 386 state 166) */,
+ 0x44 /* 'D' */, 0xE7 /* (to pos 482 state 214) */,
+ 0xD2 /* 'R' */, 0xEB /* (to pos 492 state 219) */,
+/* pos 24: state 1 */ 0xC5 /* 'E' */, 0x01 /* (to pos 26 state 2) */,
+/* pos 26: state 2 */ 0xD4 /* '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) */,
+ 0xD4 /* 'T' */, 0x79 /* (to pos 276 state 114) */,
+/* 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 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 */ 0xD7 /* '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 */ 0xD3 /* '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 */ 0x4B /* 'K' */, 0x08 /* (to pos 114 state 35) */,
+ 0x50 /* 'P' */, 0x10 /* (to pos 132 state 42) */,
+ 0x44 /* 'D' */, 0x27 /* (to pos 180 state 66) */,
+ 0x56 /* 'V' */, 0x2F /* (to pos 198 state 75) */,
+ 0x4F /* 'O' */, 0x36 /* (to pos 214 state 83) */,
+ 0x45 /* 'E' */, 0x3C /* (to pos 228 state 90) */,
+ 0x41 /* 'A' */, 0x46 /* (to pos 250 state 101) */,
+ 0xCE /* '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 */ 0xD4 /* 'T' */, 0x01 /* (to pos 278 state 115) */,
+/* pos 278: state 115 */ 0xD0 /* '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 */ 0xCD /* '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 */ 0xD3 /* '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 */ 0x45 /* 'E' */, 0x02 /* (to pos 350 state 148) */,
+ 0xCC /* '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 */ 0xC3 /* '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 */ 0xD4 /* '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 */
diff --git a/lib/libwebsockets.h b/lib/libwebsockets.h
index 389bcb6c..5cade285 100644
--- a/lib/libwebsockets.h
+++ b/lib/libwebsockets.h
@@ -922,7 +922,7 @@ libwebsocket_write(struct libwebsocket *wsi, unsigned char *buf, size_t len,
LWS_VISIBLE LWS_EXTERN int
libwebsockets_serve_http_file(struct libwebsocket_context *context,
struct libwebsocket *wsi, const char *file,
- const char *content_type);
+ const char *content_type, const char *other_headers);
LWS_VISIBLE LWS_EXTERN int
libwebsockets_serve_http_file_fragment(struct libwebsocket_context *context,
struct libwebsocket *wsi);
diff --git a/lib/output.c b/lib/output.c
index 23565af0..9abe0873 100644
--- a/lib/output.c
+++ b/lib/output.c
@@ -648,6 +648,7 @@ LWS_VISIBLE int libwebsockets_serve_http_file_fragment(
* @wsi: Websocket instance (available from user callback)
* @file: The file to issue over http
* @content_type: The http content type, eg, text/html
+ * @other_headers: NULL or pointer to \0-terminated other header string
*
* This function is intended to be called from the callback in response
* to http requests from the client. It allows the callback to issue
@@ -659,13 +660,15 @@ LWS_VISIBLE int libwebsockets_serve_http_file_fragment(
* the wsi should be left alone.
*/
-LWS_VISIBLE int libwebsockets_serve_http_file(struct libwebsocket_context *context,
+LWS_VISIBLE int libwebsockets_serve_http_file(
+ struct libwebsocket_context *context,
struct libwebsocket *wsi, const char *file,
- const char *content_type)
+ const char *content_type, const char *other_headers)
{
struct stat stat_buf;
unsigned char *p = context->service_buffer;
int ret = 0;
+ int n;
wsi->u.http.fd = open(file, O_RDONLY
#ifdef WIN32
@@ -691,6 +694,11 @@ LWS_VISIBLE int libwebsockets_serve_http_file(struct libwebsocket_context *conte
p += sprintf((char *)p,
"HTTP/1.0 200 OK\x0d\x0aServer: libwebsockets\x0d\x0a""Content-Type: %s\x0d\x0a",
content_type);
+ if (other_headers) {
+ n = strlen(other_headers);
+ memcpy(p, other_headers, n);
+ p += n;
+ }
p += sprintf((char *)p,
"Content-Length: %u\x0d\x0a\x0d\x0a",
(unsigned int)stat_buf.st_size);