comparison netio.c @ 1577:399d8eb961b5

get rid of unused packet_type in encrypted write queue
author Matt Johnston <matt@ucc.asn.au>
date Sun, 04 Mar 2018 14:57:18 +0800
parents 2f64cb3d3007
children 1f3fb83b0524
comparison
equal deleted inserted replaced
1576:0c8c2552b2f2 1577:399d8eb961b5
304 *iov_count = MIN(MIN(queue->count, IOV_MAX), *iov_count); 304 *iov_count = MIN(MIN(queue->count, IOV_MAX), *iov_count);
305 305
306 for (l = queue->head, i = 0; i < *iov_count; l = l->link, i++) 306 for (l = queue->head, i = 0; i < *iov_count; l = l->link, i++)
307 { 307 {
308 writebuf = (buffer*)l->item; 308 writebuf = (buffer*)l->item;
309 len = writebuf->len - 1 - writebuf->pos; 309 len = writebuf->len - writebuf->pos;
310 dropbear_assert(len > 0); 310 dropbear_assert(len > 0);
311 TRACE2(("write_packet writev #%d type %d len %d/%d", i, writebuf->data[writebuf->len-1], 311 TRACE2(("write_packet writev #%d len %d/%d", i,
312 len, writebuf->len-1)) 312 len, writebuf->len))
313 iov[i].iov_base = buf_getptr(writebuf, len); 313 iov[i].iov_base = buf_getptr(writebuf, len);
314 iov[i].iov_len = len; 314 iov[i].iov_len = len;
315 } 315 }
316 } 316 }
317 317
318 void packet_queue_consume(struct Queue *queue, ssize_t written) { 318 void packet_queue_consume(struct Queue *queue, ssize_t written) {
319 buffer *writebuf; 319 buffer *writebuf;
320 int len; 320 int len;
321 while (written > 0) { 321 while (written > 0) {
322 writebuf = (buffer*)examine(queue); 322 writebuf = (buffer*)examine(queue);
323 len = writebuf->len - 1 - writebuf->pos; 323 len = writebuf->len - writebuf->pos;
324 if (len > written) { 324 if (len > written) {
325 /* partial buffer write */ 325 /* partial buffer write */
326 buf_incrpos(writebuf, written); 326 buf_incrpos(writebuf, written);
327 written = 0; 327 written = 0;
328 } else { 328 } else {