mirror of
https://github.com/lunarmodules/luasocket.git
synced 2025-07-16 22:09:48 +02:00
Almost ready for beta3
This commit is contained in:
@ -158,6 +158,7 @@ int buf_isempty(p_buf buf) {
|
||||
/*-------------------------------------------------------------------------*\
|
||||
* Sends a block of data (unbuffered)
|
||||
\*-------------------------------------------------------------------------*/
|
||||
#define STEPSIZE 8192
|
||||
static int sendraw(p_buf buf, const char *data, size_t count, size_t *sent) {
|
||||
p_io io = buf->io;
|
||||
p_tm tm = buf->tm;
|
||||
@ -165,7 +166,8 @@ static int sendraw(p_buf buf, const char *data, size_t count, size_t *sent) {
|
||||
int err = IO_DONE;
|
||||
while (total < count && err == IO_DONE) {
|
||||
size_t done;
|
||||
err = io->send(io->ctx, data+total, count-total, &done, tm);
|
||||
size_t step = (count-total <= STEPSIZE)? count-total: STEPSIZE;
|
||||
err = io->send(io->ctx, data+total, step, &done, tm);
|
||||
total += done;
|
||||
}
|
||||
*sent = total;
|
||||
|
Reference in New Issue
Block a user