Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions lib/dispatcher/client-h1.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,10 @@ function lazyllhttp () {
if (useWasmSIMD) {
try {
mod = new WebAssembly.Module(require('../llhttp/llhttp_simd-wasm.js'))
/* istanbul ignore next */
} catch {
}
}

/* istanbul ignore next */
if (!mod) {
// We could check if the error was caused by the simd option not
// being enabled, but the occurring of this other error
Expand All @@ -100,7 +98,6 @@ function lazyllhttp () {
* @returns {number}
*/
wasm_on_url: (p, at, len) => {
/* istanbul ignore next */
return 0
},
/**
Expand Down Expand Up @@ -265,7 +262,6 @@ class Parser {

this.timeoutValue = delay
} else if (this.timeout) {
// istanbul ignore else: only for jest
if (this.timeout.refresh) {
this.timeout.refresh()
}
Expand All @@ -286,7 +282,6 @@ class Parser {

assert(this.timeoutType === TIMEOUT_BODY)
if (this.timeout) {
// istanbul ignore else: only for jest
if (this.timeout.refresh) {
this.timeout.refresh()
}
Expand Down Expand Up @@ -356,7 +351,6 @@ class Parser {
} else {
const ptr = llhttp.llhttp_get_error_reason(this.ptr)
let message = ''
/* istanbul ignore else: difficult to make a test case for */
if (ptr) {
const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0)
message =
Expand Down Expand Up @@ -402,7 +396,6 @@ class Parser {
onMessageBegin () {
const { socket, client } = this

/* istanbul ignore next: difficult to make a test case for */
if (socket.destroyed) {
return -1
}
Expand Down Expand Up @@ -531,14 +524,12 @@ class Parser {
onHeadersComplete (statusCode, upgrade, shouldKeepAlive) {
const { client, socket, headers, statusText } = this

/* istanbul ignore next: difficult to make a test case for */
if (socket.destroyed) {
return -1
}

const request = client[kQueue][client[kRunningIdx]]

/* istanbul ignore next: difficult to make a test case for */
if (!request) {
return -1
}
Expand Down Expand Up @@ -572,7 +563,6 @@ class Parser {
: client[kBodyTimeout]
this.setTimeout(bodyTimeout, TIMEOUT_BODY)
} else if (this.timeout) {
// istanbul ignore else: only for jest
if (this.timeout.refresh) {
this.timeout.refresh()
}
Expand Down Expand Up @@ -653,7 +643,6 @@ class Parser {

assert(this.timeoutType === TIMEOUT_BODY)
if (this.timeout) {
// istanbul ignore else: only for jest
if (this.timeout.refresh) {
this.timeout.refresh()
}
Expand Down Expand Up @@ -709,7 +698,6 @@ class Parser {
return 0
}

/* istanbul ignore next: should be handled by llhttp? */
if (request.method !== 'HEAD' && contentLength && bytesRead !== parseInt(contentLength, 10)) {
util.destroy(socket, new ResponseContentLengthMismatchError())
return -1
Expand Down Expand Up @@ -750,7 +738,6 @@ class Parser {
function onParserTimeout (parser) {
const { socket, timeoutType, client, paused } = parser.deref()

/* istanbul ignore else */
if (timeoutType === TIMEOUT_HEADERS) {
if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) {
assert(!paused, 'cannot be paused while waiting for headers')
Expand Down Expand Up @@ -1157,7 +1144,6 @@ function writeH1 (client, request) {
channels.sendHeaders.publish({ request, headers: header, socket })
}

/* istanbul ignore else: assertion */
if (!body || bodyLength === 0) {
writeBuffer(abort, null, client, request, socket, contentLength, header, expectsPayload)
} else if (util.isBuffer(body)) {
Expand Down Expand Up @@ -1538,7 +1524,6 @@ class AsyncWriter {

if (!ret) {
if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {
// istanbul ignore else: only for jest
if (socket[kParser].timeout.refresh) {
socket[kParser].timeout.refresh()
}
Expand Down Expand Up @@ -1589,7 +1574,6 @@ class AsyncWriter {
}

if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {
// istanbul ignore else: only for jest
if (socket[kParser].timeout.refresh) {
socket[kParser].timeout.refresh()
}
Expand Down
1 change: 0 additions & 1 deletion lib/dispatcher/client-h2.js
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,6 @@ function writeH2 (client, request) {
return true

function writeBodyH2 () {
/* istanbul ignore else: assertion */
if (!body || contentLength === 0) {
writeBuffer(
abort,
Expand Down
1 change: 0 additions & 1 deletion lib/dispatcher/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,6 @@ class Client extends DispatcherBase {
)
}

/* istanbul ignore: only used for test */
[kConnect] (cb) {
connect(this)
this.once('connect', cb)
Expand Down
1 change: 0 additions & 1 deletion scripts/generate-pem.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use strict'
/* istanbul ignore file */

require('@metcoder95/https-pem/install')
Loading