Fix: Echo everything as soon as received

This commit is contained in:
Denis Kenzior 2010-03-18 14:41:21 -05:00
parent 39805b3ea9
commit 5d8bbb9e5f
1 changed files with 5 additions and 4 deletions

View File

@ -393,9 +393,6 @@ static void new_bytes(GAtServer *p)
gsize rbytes = MIN(len - p->read_so_far, wrap - p->read_so_far);
result = server_feed(p, (char *)buf, &rbytes);
if (p->v250.echo)
send_common(p, (char *)buf, rbytes);
buf += rbytes;
p->read_so_far += rbytes;
@ -473,8 +470,12 @@ static gboolean received_data(GIOChannel *channel, GIOCondition cond,
total_read += rbytes;
if (rbytes > 0)
if (rbytes > 0) {
if (server->v250.echo)
send_common(server, (char *)buf, rbytes);
ring_buffer_write_advance(server->read_buf, rbytes);
}
} while (err == G_IO_ERROR_NONE && rbytes > 0 &&
read_count < server->max_read_attempts);