nish 0.34.1 → 0.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -6
- package/docs/AI.md +86 -16
- package/docs/INSTALL.md +22 -13
- package/llms.txt +5 -2
- package/package.json +15 -5
- package/runtime/async.d.mts +49 -0
- package/runtime/async.mjs +27 -0
- package/runtime/nish.d.ts +4681 -427
- package/runtime/nish.h +6 -2
- package/runtime/nish.mjs +4 -0
- package/runtime/runtime-net.c +22 -0
- package/runtime/runtime-shm.c +93 -2
- package/runtime/vite.d.ts +30 -0
- package/runtime/vite.mjs +150 -0
- package/scripts/build.sh +108 -13
- package/std/README.md +131 -131
- package/std/base64.ts +34 -5
- package/std/bytes.ts +258 -42
- package/std/cli-args.ts +296 -70
- package/std/cli-flags.ts +184 -19
- package/std/cli.ts +475 -54
- package/std/collections.ts +121 -23
- package/std/compress/checksum.ts +44 -14
- package/std/compress/deflate.ts +224 -111
- package/std/compress/gzip.ts +217 -53
- package/std/compress/zlib.ts +63 -7
- package/std/crypto/aes.ts +80 -9
- package/std/crypto/base64url.ts +22 -0
- package/std/crypto/bcrypt-batch.ts +88 -21
- package/std/crypto/bcrypt.ts +60 -0
- package/std/crypto/chacha20poly1305.ts +53 -0
- package/std/crypto/ct.ts +32 -13
- package/std/crypto/ed25519.ts +47 -0
- package/std/crypto/hkdf.ts +198 -13
- package/std/crypto/hmac.ts +235 -31
- package/std/crypto/jwt.ts +192 -63
- package/std/crypto/p256.ts +159 -16
- package/std/crypto/p384.ts +28 -3
- package/std/crypto/pki-roots.ts +32 -2
- package/std/crypto/pki.ts +81 -15
- package/std/crypto/rsa.ts +33 -3
- package/std/crypto/sha1.ts +3 -0
- package/std/crypto/sha256.ts +24 -1
- package/std/crypto/sha512.ts +99 -14
- package/std/crypto/x25519.ts +152 -14
- package/std/crypto/x509-random.ts +10 -0
- package/std/crypto/x509.ts +67 -7
- package/std/json-equal.ts +19 -0
- package/std/json-format.ts +112 -13
- package/std/json-number.ts +64 -14
- package/std/json-pointer.ts +23 -1
- package/std/json-tokenizer.ts +100 -29
- package/std/json-typed.ts +713 -66
- package/std/json-value.ts +400 -124
- package/std/json.ts +138 -10
- package/std/map.ts +25 -7
- package/std/math.ts +36 -4
- package/std/net/buffer-pool.ts +42 -11
- package/std/net/dns-config.ts +109 -23
- package/std/net/dns-message.ts +62 -7
- package/std/net/dns-resolver.ts +247 -53
- package/std/net/dns.ts +203 -35
- package/std/net/fetch.ts +151 -61
- package/std/net/handler.ts +278 -80
- package/std/net/hpack.ts +262 -52
- package/std/net/http-compress.ts +125 -15
- package/std/net/http-fields.ts +85 -9
- package/std/net/http1-client-codec.ts +100 -19
- package/std/net/http1-codec.ts +297 -77
- package/std/net/http1-server.ts +430 -94
- package/std/net/http2-frame.ts +272 -35
- package/std/net/http2-tls.ts +135 -34
- package/std/net/http2.ts +247 -106
- package/std/net/http3-frame.ts +154 -17
- package/std/net/http3-server.ts +275 -101
- package/std/net/http3.ts +307 -115
- package/std/net/outbound.ts +37 -3
- package/std/net/postgres-carrier.ts +144 -8
- package/std/net/postgres.ts +801 -112
- package/std/net/prefork.ts +164 -31
- package/std/net/qpack.ts +105 -18
- package/std/net/quic-conn-ack.ts +59 -12
- package/std/net/quic-conn-cid.ts +124 -27
- package/std/net/quic-conn-params.ts +70 -10
- package/std/net/quic-datagram.ts +43 -3
- package/std/net/quic-frame.ts +286 -12
- package/std/net/quic-listener.ts +101 -32
- package/std/net/quic-packet.ts +302 -21
- package/std/net/quic-recovery.ts +264 -52
- package/std/net/quic-stream.ts +353 -91
- package/std/net/quic.ts +1124 -201
- package/std/net/router.ts +87 -40
- package/std/net/tls/client.ts +166 -51
- package/std/net/tls/codec.ts +413 -56
- package/std/net/tls/record-client.ts +110 -55
- package/std/net/tls/record-server.ts +159 -59
- package/std/net/tls/record.ts +109 -12
- package/std/net/tls/schedule.ts +235 -26
- package/std/net/tls/ticket.ts +159 -40
- package/std/net/tls/verify.ts +49 -3
- package/std/net/tls-tcp.ts +250 -45
- package/std/net/tls.ts +221 -59
- package/std/net/upstream.ts +81 -45
- package/std/net/url.ts +97 -13
- package/std/net/websocket.ts +122 -12
- package/std/net/webtransport.ts +220 -89
- package/std/pair.ts +10 -2
- package/std/random.ts +34 -9
- package/std/regex.ts +352 -198
- package/std/region.ts +70 -15
- package/std/secret.ts +52 -11
- package/std/sort.ts +17 -2
- package/std/sqlite.ts +256 -35
- package/std/sync/ring.ts +430 -40
- package/std/sync/shm.ts +222 -15
- package/std/term-io.ts +137 -64
- package/std/term-pixels.ts +144 -19
- package/std/term-probe.ts +66 -25
- package/std/term-rate.ts +128 -57
- package/std/term.ts +332 -121
- package/std/testing.ts +130 -32
- package/std/text.ts +73 -7
- package/std/threads.ts +229 -41
- package/std/yaml-json.ts +94 -82
- package/std/yaml-lines.ts +47 -15
- package/std/yaml-write.ts +24 -16
- package/std/yaml.ts +764 -384
|
@@ -386,6 +386,15 @@ const http1ClientPutField = (out: u8[], at: i32, names: string[], values: string
|
|
|
386
386
|
* here; a `Connection` that lists `upgrade`, which only
|
|
387
387
|
* `http1UpgradeRequestHead` may write; and a `bodyLength` below -2. Answers
|
|
388
388
|
* `HTTP1_NO_ROOM` when it is well formed but does not fit. Either way `out` is untouched.
|
|
389
|
+
*
|
|
390
|
+
* @param out The buffer the head is written into; nothing outside the head's bytes changes.
|
|
391
|
+
* @param at The index in `out` the request line starts at; a negative one answers `HTTP1_NO_ROOM`.
|
|
392
|
+
* @param method The request method, a token such as `GET`, written as given.
|
|
393
|
+
* @param target The request target in the form the method may send, written as given.
|
|
394
|
+
* @param names The field names, matched case-insensitively; exactly one is `Host`, which is written first, and the rest follow in order.
|
|
395
|
+
* @param values The value of each field in `names`, at the same index.
|
|
396
|
+
* @param bodyLength The body's length in bytes, or `HTTP1_CHUNKED` (-1) or `HTTP1_NO_BODY` (-2).
|
|
397
|
+
* @returns The index in `out` just past the empty line, or `HTTP1_REFUSED` or `HTTP1_NO_ROOM`.
|
|
389
398
|
*/
|
|
390
399
|
export const http1WriteRequestHead = (
|
|
391
400
|
out: u8[],
|
|
@@ -448,8 +457,15 @@ const http1ClientPutHead = (
|
|
|
448
457
|
}
|
|
449
458
|
|
|
450
459
|
/**
|
|
451
|
-
* `http1WriteRequestHead`'s head in an array of its own,
|
|
452
|
-
*
|
|
460
|
+
* `http1WriteRequestHead`'s head in an array of its own, sized to fit, so
|
|
461
|
+
* there is no room to run out of.
|
|
462
|
+
*
|
|
463
|
+
* @param method The request method, a token such as `GET`.
|
|
464
|
+
* @param target The request target in the form the method may send.
|
|
465
|
+
* @param names The field names; exactly one is `Host`, which is written first, and the rest follow in order.
|
|
466
|
+
* @param values The value of each field in `names`, at the same index.
|
|
467
|
+
* @param bodyLength The body's length in bytes, or `HTTP1_CHUNKED` (-1) or `HTTP1_NO_BODY` (-2).
|
|
468
|
+
* @returns The head, ending in the empty line, or `null` for everything `http1WriteRequestHead` refuses and for a head over 1 GiB.
|
|
453
469
|
*/
|
|
454
470
|
export const http1RequestHead = (
|
|
455
471
|
method: string,
|
|
@@ -468,6 +484,13 @@ export const http1RequestHead = (
|
|
|
468
484
|
* `Connection` among the caller's fields, which would contradict the two this
|
|
469
485
|
* writes. A response to it is read after `expect(false, false)` and then
|
|
470
486
|
* `expectUpgrade()`, so that its 101 answers `HTTP1_UPGRADE`.
|
|
487
|
+
*
|
|
488
|
+
* @param method The request method, a token; a WebSocket handshake sends `GET`.
|
|
489
|
+
* @param target The request target in the form the method may send.
|
|
490
|
+
* @param names The caller's field names; exactly one is `Host`, which is written first, and the rest follow in order, before the two upgrade fields.
|
|
491
|
+
* @param values The value of each field in `names`, at the same index.
|
|
492
|
+
* @param upgrade The protocol asked for, one token such as `websocket`; an empty one answers `null`.
|
|
493
|
+
* @returns The head, ending in the empty line, or `null` when any of the above is refused or the head is over 1 GiB.
|
|
471
494
|
*/
|
|
472
495
|
export const http1UpgradeRequestHead = (
|
|
473
496
|
method: string,
|
|
@@ -545,64 +568,81 @@ export class Http1ResponseParser {
|
|
|
545
568
|
* `fieldName`, `fieldValue`, `reasonText` and `header` answer in either mode.
|
|
546
569
|
*/
|
|
547
570
|
names: string[]
|
|
571
|
+
/** The field values, each beside its name in `names`. */
|
|
548
572
|
values: string[]
|
|
549
573
|
/**
|
|
550
574
|
* The response's reason phrase and kept fields, copied: `head[reasonStart ..
|
|
551
575
|
* reasonEnd)` is the reason, and field `i` is `head[spans[4i] ..
|
|
552
576
|
* spans[4i + 1])`, its name in lowercase, then `head[spans[4i + 2] ..
|
|
553
577
|
* spans[4i + 3])`, its value. Both arrays are reused from response to response.
|
|
578
|
+
* @internal
|
|
554
579
|
*/
|
|
555
580
|
head: u8[]
|
|
581
|
+
/** @internal Parser state the module's `http1Client` helpers read and write. */
|
|
556
582
|
spans: i32[]
|
|
557
583
|
/** The buffer the last `HTTP1_BODY`'s bytes are in, at `bodyOff`, `bodyLen` long. */
|
|
558
584
|
body: u8[]
|
|
559
585
|
/** What was wrong, once `next()` said `HTTP1_ERROR`; for a log. */
|
|
560
586
|
errorText: string = ""
|
|
561
|
-
/** The bytes fed and not yet consumed are `buf[start .. end)`. */
|
|
587
|
+
/** The bytes fed and not yet consumed are `buf[start .. end)`. @internal */
|
|
562
588
|
buf: u8[]
|
|
563
589
|
|
|
564
590
|
// --- limits, the caller's --------------------------------------------------
|
|
591
|
+
/** The most body bytes a response may carry, de-chunked; past it the parser refuses. */
|
|
565
592
|
maxBody: i64 = 0
|
|
566
593
|
/** The declared body length, or -1 when the response has none or is chunked or read until close. */
|
|
567
594
|
contentLength: i64 = -1
|
|
568
|
-
/** Bytes left in a length-delimited body or in the current chunk. */
|
|
595
|
+
/** Bytes left in a length-delimited body or in the current chunk. @internal */
|
|
569
596
|
left: i64 = 0
|
|
570
597
|
/** De-chunked body bytes so far, against `maxBody`. */
|
|
571
598
|
bodyTotal: i64 = 0
|
|
599
|
+
/** @internal Parser state the module's `http1Client` helpers read and write. */
|
|
572
600
|
maxStatusLine: i32 = 0
|
|
601
|
+
/** @internal Parser state the module's `http1Client` helpers read and write. */
|
|
573
602
|
maxHeaderBytes: i32 = 0
|
|
603
|
+
/** @internal Parser state the module's `http1Client` helpers read and write. */
|
|
574
604
|
maxHeaders: i32 = 0
|
|
605
|
+
/** @internal Parser state the module's `http1Client` helpers read and write. */
|
|
575
606
|
maxTrailerBytes: i32 = 0
|
|
576
607
|
|
|
577
608
|
/** The status code of the response last read. */
|
|
578
609
|
status: i32 = 0
|
|
579
610
|
/** The minor version: 0 for HTTP/1.0, 1 for HTTP/1.1 and anything above it. */
|
|
580
611
|
minor: i32 = 1
|
|
612
|
+
/** Where the last `HTTP1_BODY`'s bytes start in `body`. */
|
|
581
613
|
bodyOff: i32 = 0
|
|
614
|
+
/** How many bytes the last `HTTP1_BODY` holds. */
|
|
582
615
|
bodyLen: i32 = 0
|
|
583
616
|
/** Why `next()` said `HTTP1_ERROR`: one of the `HTTP1_E_` codes. */
|
|
584
617
|
error: i32 = 0
|
|
585
618
|
|
|
586
619
|
// --- internal --------------------------------------------------------------
|
|
620
|
+
/** @internal Parser state the module's `http1Client` helpers read and write. */
|
|
587
621
|
start: i32 = 0
|
|
622
|
+
/** @internal Parser state the module's `http1Client` helpers read and write. */
|
|
588
623
|
end: i32 = 0
|
|
589
|
-
/** Where the search for the next LF resumes, so a line fed a byte at a time is scanned once. */
|
|
624
|
+
/** Where the search for the next LF resumes, so a line fed a byte at a time is scanned once. @internal */
|
|
590
625
|
scan: i32 = 0
|
|
626
|
+
/** @internal Parser state the module's `http1Client` helpers read and write. */
|
|
591
627
|
state: i32 = 0
|
|
592
|
-
/** Bytes of the header or trailer section so far, against its limit. */
|
|
628
|
+
/** Bytes of the header or trailer section so far, against its limit. @internal */
|
|
593
629
|
sectionBytes: i32 = 0
|
|
594
|
-
/** Field lines of the response so far, its trailers included, against `maxHeaders`. */
|
|
630
|
+
/** Field lines of the response so far, its trailers included, against `maxHeaders`. @internal */
|
|
595
631
|
fieldCount: i32 = 0
|
|
596
|
-
/** Interim responses before this request's final one, against `HTTP1_MAX_INFORMATIONAL`. */
|
|
632
|
+
/** Interim responses before this request's final one, against `HTTP1_MAX_INFORMATIONAL`. @internal */
|
|
597
633
|
informational: i32 = 0
|
|
598
|
-
/** The line `http1ClientTakeLine` found is `buf[lineStart .. lineEnd)`, its CRLF dropped. */
|
|
634
|
+
/** The line `http1ClientTakeLine` found is `buf[lineStart .. lineEnd)`, its CRLF dropped. @internal */
|
|
599
635
|
lineStart: i32 = 0
|
|
636
|
+
/** @internal Parser state the module's `http1Client` helpers read and write. */
|
|
600
637
|
lineEnd: i32 = 0
|
|
601
638
|
|
|
639
|
+
/** Whether the response's body is chunked. */
|
|
602
640
|
chunked: boolean = false
|
|
641
|
+
/** @internal Parser state the module's `http1Client` helpers read and write. */
|
|
603
642
|
persistent: boolean = false
|
|
604
|
-
/** What `expect` said of the request this response answers. */
|
|
643
|
+
/** What `expect` said of the request this response answers: whether it was a HEAD. */
|
|
605
644
|
wasHead: boolean = false
|
|
645
|
+
/** What `expect` said of the request this response answers: whether it was a CONNECT. */
|
|
606
646
|
wasConnect: boolean = false
|
|
607
647
|
/** Whether `expectUpgrade` said the request asked to switch protocols. */
|
|
608
648
|
wasUpgrade: boolean = false
|
|
@@ -610,15 +650,23 @@ export class Http1ResponseParser {
|
|
|
610
650
|
closed: boolean = false
|
|
611
651
|
/** Whether `names`, `values` and `reason` are filled; `fieldsAsSpans()` clears it. */
|
|
612
652
|
keepStrings: boolean = true
|
|
613
|
-
/** Bytes of `head` in use, and the fields recorded in `spans`. */
|
|
653
|
+
/** Bytes of `head` in use, and the fields recorded in `spans`. @internal */
|
|
614
654
|
headUsed: i32 = 0
|
|
655
|
+
/** @internal Parser state the module's `http1Client` helpers read and write. */
|
|
615
656
|
spanCount: i32 = 0
|
|
657
|
+
/** @internal Parser state the module's `http1Client` helpers read and write. */
|
|
616
658
|
reasonStart: i32 = 0
|
|
659
|
+
/** @internal Parser state the module's `http1Client` helpers read and write. */
|
|
617
660
|
reasonEnd: i32 = 0
|
|
618
661
|
|
|
619
662
|
/**
|
|
620
663
|
* Each `i32` limit is clamped into 0 to 2^30 and `maxBody` into 0 to 2^53,
|
|
621
664
|
* so that the sums the parser makes of them cannot overflow.
|
|
665
|
+
* @param maxStatusLine The longest status line accepted, in bytes.
|
|
666
|
+
* @param maxHeaderBytes The most bytes the header section may take.
|
|
667
|
+
* @param maxHeaders The most field lines a response may carry, trailers included.
|
|
668
|
+
* @param maxBody The most body bytes a response may carry, de-chunked.
|
|
669
|
+
* @param maxTrailerBytes The most bytes the trailer section may take.
|
|
622
670
|
*/
|
|
623
671
|
constructor(maxStatusLine: i32, maxHeaderBytes: i32, maxHeaders: i32, maxBody: i64, maxTrailerBytes: i32) {
|
|
624
672
|
this.maxStatusLine = http1ClientClamp(maxStatusLine)
|
|
@@ -682,6 +730,8 @@ export class Http1ResponseParser {
|
|
|
682
730
|
* parser waits for a response's first status line, and the parser forgets it
|
|
683
731
|
* after that response's `HTTP1_END`; anywhere else it does nothing, so a
|
|
684
732
|
* pipelining caller says it once per response, after the last one's end.
|
|
733
|
+
* @param methodWasHead Whether the request was a HEAD, so the response has no body.
|
|
734
|
+
* @param wasConnect Whether the request was a CONNECT, so a 2xx opens a tunnel.
|
|
685
735
|
*/
|
|
686
736
|
expect(methodWasHead: boolean, wasConnect: boolean): void {
|
|
687
737
|
if (this.state === HTTP1_CLIENT_S_STATUS_LINE && this.informational === 0) {
|
|
@@ -712,6 +762,9 @@ export class Http1ResponseParser {
|
|
|
712
762
|
* Appends `data[off .. off + len)` to the input. A window outside `data`
|
|
713
763
|
* panics. After `finish()`, or once the parser has closed or refused, the
|
|
714
764
|
* input is dropped; in a tunnel it is kept for `tunnelBytes()`.
|
|
765
|
+
* @param data The bytes read from the connection.
|
|
766
|
+
* @param off Where the new bytes start in `data`.
|
|
767
|
+
* @param len How many bytes to append.
|
|
715
768
|
*/
|
|
716
769
|
feed(data: u8[], off: i32, len: i32): void {
|
|
717
770
|
const size: i32 = toI32(data.length)
|
|
@@ -736,7 +789,10 @@ export class Http1ResponseParser {
|
|
|
736
789
|
this.closed = true
|
|
737
790
|
}
|
|
738
791
|
|
|
739
|
-
/**
|
|
792
|
+
/**
|
|
793
|
+
* The next event the input holds; see the module comment.
|
|
794
|
+
* @returns An `HTTP1_` event, `HTTP1_NEED_MORE` when the input runs out.
|
|
795
|
+
*/
|
|
740
796
|
next(): i32 {
|
|
741
797
|
const event: i32 = http1ClientNext(this)
|
|
742
798
|
if (event !== HTTP1_NEED_MORE || !this.closed) {
|
|
@@ -757,12 +813,17 @@ export class Http1ResponseParser {
|
|
|
757
813
|
* ended (RFC 9112 §9.3): a 1.1 response unless `Connection` lists `close`,
|
|
758
814
|
* a 1.0 response only when it lists `keep-alive`, and never one read until
|
|
759
815
|
* close, a tunnel or an error.
|
|
816
|
+
* @returns Whether the connection may be reused.
|
|
760
817
|
*/
|
|
761
818
|
keepAlive(): boolean {
|
|
762
819
|
return this.persistent
|
|
763
820
|
}
|
|
764
821
|
|
|
765
|
-
/**
|
|
822
|
+
/**
|
|
823
|
+
* The value of the first field named `name` (any case).
|
|
824
|
+
* @param name The field name to look for.
|
|
825
|
+
* @returns The field's value, OWS trimmed, or `null` when the response has no such field.
|
|
826
|
+
*/
|
|
766
827
|
header(name: string): string | null {
|
|
767
828
|
for (let i: i32 = 0; i < this.spanCount; i += 1) {
|
|
768
829
|
if (http1ClientHeadSameWord(this.head, this.spans[i * 4], this.spans[i * 4 + 1], name)) {
|
|
@@ -772,12 +833,19 @@ export class Http1ResponseParser {
|
|
|
772
833
|
return null
|
|
773
834
|
}
|
|
774
835
|
|
|
775
|
-
/**
|
|
836
|
+
/**
|
|
837
|
+
* How many fields the response last read has; trailers are not kept.
|
|
838
|
+
* @returns The number of fields, which `fieldName` and `fieldValue` index.
|
|
839
|
+
*/
|
|
776
840
|
fields(): i32 {
|
|
777
841
|
return this.spanCount
|
|
778
842
|
}
|
|
779
843
|
|
|
780
|
-
/**
|
|
844
|
+
/**
|
|
845
|
+
* Field `i`'s name, in lowercase, as a fresh string.
|
|
846
|
+
* @param i The field's index, from 0 to below `fields()`.
|
|
847
|
+
* @returns The name, or "" past the last field.
|
|
848
|
+
*/
|
|
781
849
|
fieldName(i: i32): string {
|
|
782
850
|
if (i < 0 || i >= this.spanCount) {
|
|
783
851
|
return ""
|
|
@@ -785,7 +853,11 @@ export class Http1ResponseParser {
|
|
|
785
853
|
return http1Text(this.head, this.spans[i * 4], this.spans[i * 4 + 1], false)
|
|
786
854
|
}
|
|
787
855
|
|
|
788
|
-
/**
|
|
856
|
+
/**
|
|
857
|
+
* Field `i`'s value, OWS trimmed, as a fresh string.
|
|
858
|
+
* @param i The field's index, from 0 to below `fields()`.
|
|
859
|
+
* @returns The value, or "" past the last field.
|
|
860
|
+
*/
|
|
789
861
|
fieldValue(i: i32): string {
|
|
790
862
|
if (i < 0 || i >= this.spanCount) {
|
|
791
863
|
return ""
|
|
@@ -793,7 +865,10 @@ export class Http1ResponseParser {
|
|
|
793
865
|
return http1Text(this.head, this.spans[i * 4 + 2], this.spans[i * 4 + 3], false)
|
|
794
866
|
}
|
|
795
867
|
|
|
796
|
-
/**
|
|
868
|
+
/**
|
|
869
|
+
* The reason phrase, as a fresh string.
|
|
870
|
+
* @returns The reason phrase of the response last read, "" when it had none.
|
|
871
|
+
*/
|
|
797
872
|
reasonText(): string {
|
|
798
873
|
if (this.reasonEnd <= this.reasonStart) {
|
|
799
874
|
return ""
|
|
@@ -801,12 +876,18 @@ export class Http1ResponseParser {
|
|
|
801
876
|
return http1Text(this.head, this.reasonStart, this.reasonEnd, false)
|
|
802
877
|
}
|
|
803
878
|
|
|
804
|
-
/**
|
|
879
|
+
/**
|
|
880
|
+
* How many bytes were fed and not consumed yet.
|
|
881
|
+
* @returns The count of unread input bytes.
|
|
882
|
+
*/
|
|
805
883
|
buffered(): i32 {
|
|
806
884
|
return this.end - this.start
|
|
807
885
|
}
|
|
808
886
|
|
|
809
|
-
/**
|
|
887
|
+
/**
|
|
888
|
+
* In a tunnel: every byte fed past the response head, as a fresh array.
|
|
889
|
+
* @returns The bytes, or an empty array outside a tunnel.
|
|
890
|
+
*/
|
|
810
891
|
tunnelBytes(): u8[] {
|
|
811
892
|
let n: i32 = this.end - this.start
|
|
812
893
|
if (n < 0 || this.state !== HTTP1_CLIENT_S_TUNNEL) {
|