All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix more-messages-to-send indicator
@ 2010-05-26 15:43 Aki Niemi
  2010-05-26 16:17 ` Denis Kenzior
  0 siblings, 1 reply; 3+ messages in thread
From: Aki Niemi @ 2010-05-26 15:43 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1241 bytes --]

Set the mms indicator based on remaining segment count and not on the
message transmit queue status alone.
---
 src/sms.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/sms.c b/src/sms.c
index 3a1cff0..7d4a099 100644
--- a/src/sms.c
+++ b/src/sms.c
@@ -58,7 +58,6 @@ struct ofono_sms {
 	unsigned int next_msg_id;
 	guint ref;
 	GQueue *txq;
-	time_t last_mms;
 	gint tx_source;
 	struct ofono_message_waiting *mw;
 	unsigned int mw_watch;
@@ -331,7 +330,6 @@ static void tx_finished(const struct ofono_error *error, int mr, void *data)
 static gboolean tx_next(gpointer user_data)
 {
 	struct ofono_sms *sms = user_data;
-	time_t ts;
 	int send_mms = 0;
 	struct tx_queue_entry *entry = g_queue_peek_head(sms->txq);
 	struct pending_pdu *pdu = &entry->pdus[entry->cur_pdu];
@@ -346,10 +344,8 @@ static gboolean tx_next(gpointer user_data)
 	if (!entry)
 		return FALSE;
 
-	ts = time(NULL);
-
-	if ((g_queue_get_length(sms->txq) > 1) &&
-			((ts - sms->last_mms) > 60))
+	if (g_queue_get_length(sms->txq) > 1
+		|| entry->cur_pdu < entry->num_pdus - 1)
 		send_mms = 1;
 
 	sms->driver->submit(sms, pdu->pdu, pdu->pdu_len, pdu->tpdu_len, send_mms,
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread
* [PATCH] Fix more-messages-to-send indicator
@ 2010-05-25  7:56 Aki Niemi
  0 siblings, 0 replies; 3+ messages in thread
From: Aki Niemi @ 2010-05-25  7:56 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1244 bytes --]

Set the mms indicator based on remaining segment count and not on the
message transmit queue status.
---
 src/sms.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/sms.c b/src/sms.c
index 3a1cff0..9a03b0a 100644
--- a/src/sms.c
+++ b/src/sms.c
@@ -58,7 +58,6 @@ struct ofono_sms {
 	unsigned int next_msg_id;
 	guint ref;
 	GQueue *txq;
-	time_t last_mms;
 	gint tx_source;
 	struct ofono_message_waiting *mw;
 	unsigned int mw_watch;
@@ -331,7 +330,6 @@ static void tx_finished(const struct ofono_error *error, int mr, void *data)
 static gboolean tx_next(gpointer user_data)
 {
 	struct ofono_sms *sms = user_data;
-	time_t ts;
 	int send_mms = 0;
 	struct tx_queue_entry *entry = g_queue_peek_head(sms->txq);
 	struct pending_pdu *pdu = &entry->pdus[entry->cur_pdu];
@@ -346,10 +344,8 @@ static gboolean tx_next(gpointer user_data)
 	if (!entry)
 		return FALSE;
 
-	ts = time(NULL);
-
-	if ((g_queue_get_length(sms->txq) > 1) &&
-			((ts - sms->last_mms) > 60))
+	/* Set mms unless this is the last segment */
+	if (1 + entry->cur_pdu < entry->num_pdus)
 		send_mms = 1;
 
 	sms->driver->submit(sms, pdu->pdu, pdu->pdu_len, pdu->tpdu_len, send_mms,
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-05-26 16:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-26 15:43 [PATCH] Fix more-messages-to-send indicator Aki Niemi
2010-05-26 16:17 ` Denis Kenzior
  -- strict thread matches above, loose matches on Subject: below --
2010-05-25  7:56 Aki Niemi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.