projects
/
platform
/
upstream
/
ofono.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c6f4d05
)
Fix: Don't allocate buffers if we don't need to
author
Denis Kenzior
<denkenz@gmail.com>
Fri, 26 Feb 2010 22:16:46 +0000
(16:16 -0600)
committer
Denis Kenzior
<denkenz@gmail.com>
Fri, 26 Feb 2010 22:16:46 +0000
(16:16 -0600)
gatchat/gatserver.c
patch
|
blob
|
history
diff --git
a/gatchat/gatserver.c
b/gatchat/gatserver.c
index
5b5e2f7
..
05392e9
100644
(file)
--- a/
gatchat/gatserver.c
+++ b/
gatchat/gatserver.c
@@
-136,7
+136,12
@@
static void send_common(GAtServer *server, const char *buf, unsigned int len)
buf + bytes_written,
wbytes);
- if (ring_buffer_avail(write_buf) == 0)
+ /*
+ * Make sure we don't allocate a buffer if we've written
+ * everything out already
+ */
+ if (ring_buffer_avail(write_buf) == 0 &&
+ bytes_written < towrite)
write_buf = allocate_next(server);
}