diff options
author | Denis Kenzior <denkenz@gmail.com> | 2010-03-18 14:41:21 -0500 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2010-03-18 14:47:34 -0500 |
commit | 5d8bbb9e5f6cecc5ccddb7dd0364864e31b3551a (patch) | |
tree | e24a89bd8ac9aa6b86203a7cbe6f1f05f74c66fb | |
parent | 39805b3ea9b8019984090ad168e5271b0abfa1f6 (diff) | |
download | ofono-5d8bbb9e5f6cecc5ccddb7dd0364864e31b3551a.tar.bz2 |
Fix: Echo everything as soon as received
-rw-r--r-- | gatchat/gatserver.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c index 63c8d471..4df3f06f 100644 --- a/gatchat/gatserver.c +++ b/gatchat/gatserver.c @@ -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); |