Use send()/recv() on sockets

and apply it to the right branch this time
This commit is contained in:
Eion Robb 2015-10-24 11:11:42 +13:00
parent 8562eb342c
commit a8bad2e361

View file

@ -392,7 +392,7 @@ static void try_write (struct connection *c) {
// debug ("try write: fd = %d\n", c->fd);
int x = 0;
while (c->out_head) {
int r = write (c->fd, c->out_head->rptr, c->out_head->wptr - c->out_head->rptr);
int r = send (c->fd, (const char *)c->out_head->rptr, c->out_head->wptr - c->out_head->rptr, 0);
if (r >= 0) {
x += r;
c->out_head->rptr += r;
@ -468,7 +468,7 @@ static void try_read (struct connection *c) {
#endif
int x = 0;
while (1) {
int r = read (c->fd, c->in_tail->wptr, c->in_tail->end - c->in_tail->wptr);
int r = recv (c->fd, (char *)c->in_tail->wptr, c->in_tail->end - c->in_tail->wptr, 0);
if (r > 0) {
c->last_receive_time = tglt_get_double_time ();
stop_ping_timer (c);