All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] GPRS patches
@ 2011-03-24 12:32 Mika Liljeberg
  2011-03-24 12:32 ` [PATCH 1/2] gprs: fix memory leak Mika Liljeberg
  2011-03-24 12:32 ` [PATCH 2/2] test: add a script to set any GPRS context property Mika Liljeberg
  0 siblings, 2 replies; 5+ messages in thread
From: Mika Liljeberg @ 2011-03-24 12:32 UTC (permalink / raw)
  To: ofono

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

Hi,

Here's a memory leak fix and a new test script for GPRS.

Br,

	MikaL

[PATCH 1/2] gprs: fix memory leak
[PATCH 2/2] test: add a script to set any GPRS context property

 Makefile.am               |    3 ++-
 src/gprs.c                |    2 ++
 test/set-context-property |   38 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 42 insertions(+), 1 deletions(-)

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

* [PATCH 1/2] gprs: fix memory leak
  2011-03-24 12:32 [PATCH 0/2] GPRS patches Mika Liljeberg
@ 2011-03-24 12:32 ` Mika Liljeberg
  2011-03-24 18:23   ` Denis Kenzior
  2011-03-24 12:32 ` [PATCH 2/2] test: add a script to set any GPRS context property Mika Liljeberg
  1 sibling, 1 reply; 5+ messages in thread
From: Mika Liljeberg @ 2011-03-24 12:32 UTC (permalink / raw)
  To: ofono

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

---
 src/gprs.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/gprs.c b/src/gprs.c
index 00f6d6d..f9e327a 100644
--- a/src/gprs.c
+++ b/src/gprs.c
@@ -865,6 +865,7 @@ static void pri_activate_callback(const struct ofono_error *error, void *data)
 				telephony_error_to_str(error));
 		__ofono_dbus_pending_reply(&ctx->pending,
 					__ofono_error_failed(ctx->pending));
+		context_settings_free(ctx->context_driver->settings);
 		release_context(ctx);
 		return;
 	}
@@ -1841,6 +1842,7 @@ static void gprs_deactivate_for_remove(const struct ofono_error *error,
 		return;
 	}
 
+	pri_reset_context_settings(ctx);
 	release_context(ctx);
 
 	if (gprs->settings) {
-- 
1.7.1


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

* [PATCH 2/2] test: add a script to set any GPRS context property
  2011-03-24 12:32 [PATCH 0/2] GPRS patches Mika Liljeberg
  2011-03-24 12:32 ` [PATCH 1/2] gprs: fix memory leak Mika Liljeberg
@ 2011-03-24 12:32 ` Mika Liljeberg
  2011-03-24 18:25   ` Denis Kenzior
  1 sibling, 1 reply; 5+ messages in thread
From: Mika Liljeberg @ 2011-03-24 12:32 UTC (permalink / raw)
  To: ofono

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

---
 Makefile.am               |    3 ++-
 test/set-context-property |   38 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 40 insertions(+), 1 deletions(-)
 create mode 100755 test/set-context-property

diff --git a/Makefile.am b/Makefile.am
index b0cbcd7..fce9cd8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -506,7 +506,8 @@ test_scripts = test/backtrace \
 		test/test-sms \
 		test/test-message-waiting \
 		test/cdma-connman-disable \
-		test/cdma-connman-enable
+		test/cdma-connman-enable \
+		test/set-context-property
 
 if TEST
 testdir = $(pkglibdir)/test
diff --git a/test/set-context-property b/test/set-context-property
new file mode 100755
index 0000000..8ea0e3a
--- /dev/null
+++ b/test/set-context-property
@@ -0,0 +1,38 @@
+#!/usr/bin/python
+
+import sys
+import dbus
+
+if len(sys.argv) < 4:
+	print "Usage: set-context-property <context> <name> <value>"
+	sys.exit(1)
+
+bus = dbus.SystemBus()
+
+manager = dbus.Interface(bus.get_object('org.ofono', '/'),
+						'org.ofono.Manager')
+
+modems = manager.GetModems()
+
+for path, properties in modems:
+	if "org.ofono.ConnectionManager" not in properties["Interfaces"]:
+		continue
+
+	connman = dbus.Interface(bus.get_object('org.ofono', path),
+					'org.ofono.ConnectionManager')
+
+	contexts = connman.GetContexts()
+
+	if (len(contexts) == 0):
+		print "No context available"
+		sys.exit(1)
+
+	path = contexts[int(sys.argv[1])][0]
+	context = dbus.Interface(bus.get_object('org.ofono', path),
+					'org.ofono.ConnectionContext')
+
+	try:
+		context.SetProperty(sys.argv[2], sys.argv[3])
+	except dbus.DBusException, e:
+		print "Error setting context %s property %s: %s" % (path, sys.argv[2], str(e))
+		exit(2)
-- 
1.7.1


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

* Re: [PATCH 1/2] gprs: fix memory leak
  2011-03-24 12:32 ` [PATCH 1/2] gprs: fix memory leak Mika Liljeberg
@ 2011-03-24 18:23   ` Denis Kenzior
  0 siblings, 0 replies; 5+ messages in thread
From: Denis Kenzior @ 2011-03-24 18:23 UTC (permalink / raw)
  To: ofono

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

Hi Mika,

On 03/24/2011 07:32 AM, Mika Liljeberg wrote:
> ---
>  src/gprs.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 

Good catch.  Patch has been applied, thanks.

Regards,
-Denis

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

* Re: [PATCH 2/2] test: add a script to set any GPRS context property
  2011-03-24 12:32 ` [PATCH 2/2] test: add a script to set any GPRS context property Mika Liljeberg
@ 2011-03-24 18:25   ` Denis Kenzior
  0 siblings, 0 replies; 5+ messages in thread
From: Denis Kenzior @ 2011-03-24 18:25 UTC (permalink / raw)
  To: ofono

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

Hi Mika,

On 03/24/2011 07:32 AM, Mika Liljeberg wrote:
> ---
>  Makefile.am               |    3 ++-
>  test/set-context-property |   38 ++++++++++++++++++++++++++++++++++++++
>  2 files changed, 40 insertions(+), 1 deletions(-)
>  create mode 100755 test/set-context-property

Patch has been applied, thanks.

Regards,
-Denis

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

end of thread, other threads:[~2011-03-24 18:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-24 12:32 [PATCH 0/2] GPRS patches Mika Liljeberg
2011-03-24 12:32 ` [PATCH 1/2] gprs: fix memory leak Mika Liljeberg
2011-03-24 18:23   ` Denis Kenzior
2011-03-24 12:32 ` [PATCH 2/2] test: add a script to set any GPRS context property Mika Liljeberg
2011-03-24 18:25   ` Denis Kenzior

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.