[pkg-fso-commits] [SCM] GSM user space multiplexer branch, master, updated. 0.9.2-6-g95151f9

Michael 'Mickey' Lauer mickey at vanille-media.de
Sat Jan 10 11:30:59 UTC 2009


The following commit has been merged in the master branch:
commit 2edaa892361dab3001e9f2485bdd478298abbed3
Author: Paul Fertser <fercerpav at gmail.com>
Date:   Thu Dec 4 20:27:39 2008 +0300

    Fixed a bug with a 2048-sized transfer from modem
    
    As the circular buffer is used to hold the incoming data from the modem,
    its free size must be one byte less than is actually available or we'll get
    readp == writep and the buffer will be considered empty.

diff --git a/src/gsm0710muxd.c b/src/gsm0710muxd.c
index bb49d73..0b9e7ad 100644
--- a/src/gsm0710muxd.c
+++ b/src/gsm0710muxd.c
@@ -194,7 +194,7 @@ typedef struct Serial
  * tells how much free space there is in the buffer
  */
 //int gsm0710_buffer_free(GSM0710_Buffer *buf);
-#define gsm0710_buffer_free(buf) ((buf->readp > buf->writep) ? (buf->readp - buf->writep) : (GSM0710_BUFFER_SIZE - (buf->writep-buf->readp)))
+#define gsm0710_buffer_free(buf) ((buf->readp > buf->writep) ? (buf->readp - buf->writep) : (GSM0710_BUFFER_SIZE - (buf->writep-buf->readp)) - 1)
 
 ////////////////////////////////// constants & globals
 static unsigned char close_channel_cmd[] = { GSM0710_CONTROL_CLD | GSM0710_CR, GSM0710_EA | (0 << 1) };

-- 
GSM user space multiplexer



More information about the pkg-fso-commits mailing list