Rename harvestItem to copyOut.
This commit is contained in:
parent
9ce7141087
commit
368502c10b
|
@ -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)
|
||||
|
|
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue