mirror of git://git.sysmocom.de/ofono
gatchat: Fix handling of WRITE_SCHEDULER_DEBUG
This commit is contained in:
parent
c2e58405ee
commit
f83233d295
|
@ -835,6 +835,9 @@ static gboolean can_write_data(gpointer data)
|
||||||
gsize len;
|
gsize len;
|
||||||
char *cr;
|
char *cr;
|
||||||
gboolean wakeup_first = FALSE;
|
gboolean wakeup_first = FALSE;
|
||||||
|
#ifdef WRITE_SCHEDULER_DEBUG
|
||||||
|
int limiter;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Grab the first command off the queue and write as
|
/* Grab the first command off the queue and write as
|
||||||
* much of it as we can
|
* much of it as we can
|
||||||
|
@ -886,13 +889,20 @@ static gboolean can_write_data(gpointer data)
|
||||||
towrite = cr - (cmd->cmd + chat->cmd_bytes_written) + 1;
|
towrite = cr - (cmd->cmd + chat->cmd_bytes_written) + 1;
|
||||||
|
|
||||||
#ifdef WRITE_SCHEDULER_DEBUG
|
#ifdef WRITE_SCHEDULER_DEBUG
|
||||||
if (towrite > 5)
|
limiter = towrite;
|
||||||
towrite = 5;
|
|
||||||
|
if (limiter > 5)
|
||||||
|
limiter = 5;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bytes_written = g_at_io_write(chat->io,
|
bytes_written = g_at_io_write(chat->io,
|
||||||
cmd->cmd + chat->cmd_bytes_written,
|
cmd->cmd + chat->cmd_bytes_written,
|
||||||
towrite);
|
#ifdef WRITE_SCHEDULER_DEBUG
|
||||||
|
limiter
|
||||||
|
#else
|
||||||
|
towrite
|
||||||
|
#endif
|
||||||
|
);
|
||||||
|
|
||||||
if (bytes_written == 0)
|
if (bytes_written == 0)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
Loading…
Reference in New Issue