Use send()/recv() on sockets
and apply it to the right branch this time
This commit is contained in:
parent
8562eb342c
commit
a8bad2e361
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue