Reduce code duplication
This commit is contained in:
parent
b42cbe593c
commit
bb4ac298dd
1 changed files with 1 additions and 5 deletions
|
@ -185,16 +185,12 @@ tcp_write_queue(int fd, htsbuf_queue_t *q)
|
|||
void *p;
|
||||
|
||||
while((hd = TAILQ_FIRST(&q->hq_q)) != NULL) {
|
||||
TAILQ_REMOVE(&q->hq_q, hd, hd_link);
|
||||
|
||||
if (!r) {
|
||||
l = hd->hd_data_len - hd->hd_data_off;
|
||||
p = hd->hd_data + hd->hd_data_off;
|
||||
r = tvh_write(fd, p, l);
|
||||
}
|
||||
|
||||
free(hd->hd_data);
|
||||
free(hd);
|
||||
htsbuf_data_free(q, hd);
|
||||
}
|
||||
q->hq_size = 0;
|
||||
return r;
|
||||
|
|
Loading…
Add table
Reference in a new issue