diff options
| author | Diego Nehab <diego@tecgraf.puc-rio.br> | 2003-11-27 00:30:54 +0000 |
|---|---|---|
| committer | Diego Nehab <diego@tecgraf.puc-rio.br> | 2003-11-27 00:30:54 +0000 |
| commit | 3febb302ad28fd25de51cbc686739469b92d8921 (patch) | |
| tree | 0a8d9a1070a7c1f2566c22562693fb27963037d9 /src/buffer.c | |
| parent | 9bc4e0648ab4a177293a94425594bdc54c9a84fa (diff) | |
| download | luasocket-3febb302ad28fd25de51cbc686739469b92d8921.tar.gz luasocket-3febb302ad28fd25de51cbc686739469b92d8921.tar.bz2 luasocket-3febb302ad28fd25de51cbc686739469b92d8921.zip | |
Killed a few bugs found by Tomas.
Diffstat (limited to 'src/buffer.c')
| -rw-r--r-- | src/buffer.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/buffer.c b/src/buffer.c index c860f35..04419e7 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -138,7 +138,8 @@ int sendraw(p_buf buf, const char *data, size_t count, size_t *sent) | |||
| 138 | int err = IO_DONE; | 138 | int err = IO_DONE; |
| 139 | while (total < count && err == IO_DONE) { | 139 | while (total < count && err == IO_DONE) { |
| 140 | size_t done; | 140 | size_t done; |
| 141 | err = io->send(io->ctx, data+total, count-total, &done, tm_get(tm)); | 141 | err = io->send(io->ctx, data+total, count-total, &done, |
| 142 | tm_getsuccess(tm)); | ||
| 142 | total += done; | 143 | total += done; |
| 143 | } | 144 | } |
| 144 | *sent = total; | 145 | *sent = total; |
| @@ -239,7 +240,8 @@ int buf_get(p_buf buf, const char **data, size_t *count) | |||
| 239 | p_tm tm = buf->tm; | 240 | p_tm tm = buf->tm; |
| 240 | if (buf_isempty(buf)) { | 241 | if (buf_isempty(buf)) { |
| 241 | size_t got; | 242 | size_t got; |
| 242 | err = io->recv(io->ctx, buf->data, BUF_SIZE, &got, tm_get(tm)); | 243 | err = io->recv(io->ctx, buf->data, BUF_SIZE, &got, |
| 244 | tm_getsuccess(tm)); | ||
| 243 | buf->first = 0; | 245 | buf->first = 0; |
| 244 | buf->last = got; | 246 | buf->last = got; |
| 245 | } | 247 | } |
