Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
hazae41 committed Jan 31, 2023
1 parent c3f6eaf commit 38eb8c8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"type": "module",
"name": "@hazae41/cadenas",
"version": "0.1.0",
"version": "0.1.2",
"description": "Zero-copy TLS protocol for the web",
"homepage": "https://github.com/hazae41/cadenas",
"repository": "github:hazae41/cadenas",
Expand Down
10 changes: 5 additions & 5 deletions src/mods/tls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,14 +251,14 @@ export class TlsStream extends AsyncEventTarget {
}

private async onReadClose() {
console.debug(`${this.#class.name}.onReadClose`)
// console.debug(`${this.#class.name}.onReadClose`)

const closeEvent = new CloseEvent("close", {})
if (!await this.read.dispatchEvent(closeEvent)) return
}

private async onWriteClose() {
console.debug(`${this.#class.name}.onWriteClose`)
// console.debug(`${this.#class.name}.onWriteClose`)

const closeEvent = new CloseEvent("close", {})
if (!await this.write.dispatchEvent(closeEvent)) return
Expand All @@ -268,7 +268,7 @@ export class TlsStream extends AsyncEventTarget {
if (Streams.isCloseError(error))
return await this.onReadClose()

console.debug(`${this.#class.name}.onReadError`, error)
// console.debug(`${this.#class.name}.onReadError`, error)

const errorEvent = new ErrorEvent("error", { error })
if (!await this.read.dispatchEvent(errorEvent)) return
Expand All @@ -278,7 +278,7 @@ export class TlsStream extends AsyncEventTarget {
if (Streams.isCloseError(error))
return await this.onWriteClose()

console.debug(`${this.#class.name}.onWriteError`, error)
// console.debug(`${this.#class.name}.onWriteError`, error)

const errorEvent = new ErrorEvent("error", { error })
if (!await this.write.dispatchEvent(errorEvent)) return
Expand All @@ -287,7 +287,7 @@ export class TlsStream extends AsyncEventTarget {
private async onError(event: Event) {
const errorEvent = event as ErrorEvent

console.debug(`${this.#class.name}.onError`, errorEvent)
// console.debug(`${this.#class.name}.onError`, errorEvent)

const errorEventClone = Events.clone(errorEvent)
if (!await this.dispatchEvent(errorEventClone)) return
Expand Down

0 comments on commit 38eb8c8

Please sign in to comment.