Rename harvestItem to copyOut.

This commit is contained in:
cheatfate 2019-10-18 19:24:58 +03:00
parent 9ce7141087
commit 368502c10b
No known key found for this signature in database
GPG Key ID: 46ADD633A7201F95
2 changed files with 2 additions and 2 deletions

View File

@ -163,7 +163,7 @@ template toDataOpenArray*(sb: AsyncBuffer): auto =
template toBufferOpenArray*(sb: AsyncBuffer): auto =
toOpenArray(sb.buffer, sb.offset, len(sb.buffer) - 1)
template harvestItem*(dest: pointer, item: WriteItem, length: int) =
template copyOut*(dest: pointer, item: WriteItem, length: int) =
if item.kind == Pointer:
let p = cast[pointer](cast[uint](item.data1) + uint(item.offset))
copyMem(dest, p, length)

View File

@ -171,7 +171,7 @@ proc tlsWriteLoop(stream: AsyncStreamWriter) {.async.} =
length = 0'u
var buf = sslEngineSendappBuf(engine, length)
let toWrite = min(int(length), item.size)
harvestItem(buf, item, toWrite)
copyOut(buf, item, toWrite)
if int(length) >= item.size:
# BearSSL is ready to accept whole item size.
sslEngineSendappAck(engine, uint(item.size))