Skip to content

Commit

Permalink
fix writeDataToNetwork allocArray
Browse files Browse the repository at this point in the history
  • Loading branch information
Magellan committed Nov 28, 2023
1 parent b625431 commit f0f147b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ class SSLEngine(connector: SocketConnector, domain: String) {
val waiting = BIO_ctrl_pending(writeBio).toInt()
log.finest("sending ${waiting} bytes..")
memScoped {
val buffer = allocArray<ByteVar>(2048)
val buffer = allocArray<ByteVar>(waiting)
n = BIO_read(writeBio, buffer, waiting)
if (n > 0) {
connector.writeDataToSocket(buffer.readBytes(n))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ class SocketConnector(halcyon: Halcyon) : AbstractConnector(halcyon) {
if (state == State.Connected) closeStream()
state = State.Disconnecting
whitespacePingExecutor.stop()
usleep(175000)
usleep(175000u)
if (state != State.Disconnected) {
socket?.disconnect()
}
Expand Down

0 comments on commit f0f147b

Please sign in to comment.