Open Source Telephony
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH 7/7] hfp_ag_bluez5: Remove emulator when disconnect
Date: Mon, 15 Apr 2013 07:30:47 -0500	[thread overview]
Message-ID: <516BF2F7.50508@gmail.com> (raw)
In-Reply-To: <1365799265-19946-8-git-send-email-paulo.borges@openbossa.org>

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

Hi Paulo,

On 04/12/2013 03:41 PM, Paulo Borges wrote:
> When a RequestDisconnect() is received, the emulator must be both
> disconnected and removed from the hash.
>
> But an emulator can also be disconnected and freed automatically if its
> GAtServer closes. In this case, the hash can hold an invalid pointer.
>
> So, after the emulator is registered, a function is set to be called
> when the emulator is about to be freed and this function removes the
> emulator from the hash.
> ---
>   plugins/hfp_ag_bluez5.c |   43 +++++++++++++++++++++++++++++++++++++++----
>   1 file changed, 39 insertions(+), 4 deletions(-)

Have you considered keeping track of the file descriptors instead?  e.g. 
simply adding a hash table of fds obtained from NewConnection() and 
g_io_add_watch()-ing on the 'HUP' condition?

Regards,
-Denis

  reply	other threads:[~2013-04-15 12:30 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-10 19:24 [PATCH 0/6] Clear the ground for AG implementation Paulo Borges
2013-04-10 19:24 ` [PATCH 1/6] include: Add ofono_emulator_set_removed_cb() Paulo Borges
2013-04-10 19:24 ` [PATCH 2/6] emulator: Add removed notification mechanism Paulo Borges
2013-04-11 21:50   ` Paulo Borges
2013-04-10 19:24 ` [PATCH 3/6] emulator: Change feature check to attend HFP 1.6 Paulo Borges
2013-04-10 19:24 ` [PATCH 4/6] hfp_ag_bluez5: Create a hash to store emulators Paulo Borges
2013-04-10 19:24 ` [PATCH 5/6] hfp_ag_bluez5: Store emulator when connect Paulo Borges
2013-04-10 19:24 ` [PATCH 6/6] hfp_ag_bluez5: Remove emulator when disconnect Paulo Borges
2013-04-12 20:40 ` [PATCH 0/7] Clear the ground for AG card implementation Paulo Borges
2013-04-12 20:40   ` [PATCH 1/7] emulator: Copy callback mechanism from atutil.h Paulo Borges
2013-04-12 20:41   ` [PATCH 2/7] include: Add ofono_emulator_set_removed_cb() Paulo Borges
2013-04-12 20:41   ` [PATCH 3/7] emulator: Add removed notification mechanism Paulo Borges
2013-04-12 20:41   ` [PATCH 4/7] emulator: Change feature check to attend HFP 1.6 Paulo Borges
2013-04-15 12:24     ` Denis Kenzior
2013-04-12 20:41   ` [PATCH 5/7] hfp_ag_bluez5: Create a hash to store emulators Paulo Borges
2013-04-12 20:41   ` [PATCH 6/7] hfp_ag_bluez5: Store emulator when connect Paulo Borges
2013-04-12 20:41   ` [PATCH 7/7] hfp_ag_bluez5: Remove emulator when disconnect Paulo Borges
2013-04-15 12:30     ` Denis Kenzior [this message]
2013-04-15 18:58       ` Paulo Borges

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=516BF2F7.50508@gmail.com \
    --to=denkenz@gmail.com \
    --cc=ofono@ofono.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox