From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH v4 1/3] hfp_ag_bluez5: Create a hash to store connections
Date: Fri, 19 Apr 2013 10:36:42 -0500 [thread overview]
Message-ID: <5171648A.8000109@gmail.com> (raw)
In-Reply-To: <1366383661-26950-1-git-send-email-paulo.borges@openbossa.org>
[-- Attachment #1: Type: text/plain, Size: 1059 bytes --]
Hi Paulo,
On 04/19/2013 10:00 AM, Paulo Borges wrote:
> We need to store active connections so we can disconnect them at
> RequestDisconnect().
>
> When we remove a connection from the hash, we also close it.
> ---
> plugins/hfp_ag_bluez5.c | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
>
> diff --git a/plugins/hfp_ag_bluez5.c b/plugins/hfp_ag_bluez5.c
> index c171c87..edc76e6 100644
> --- a/plugins/hfp_ag_bluez5.c
> +++ b/plugins/hfp_ag_bluez5.c
> @@ -48,6 +48,17 @@
> static guint modemwatch_id;
> static GList *modems;
> static GHashTable *sim_hash = NULL;
> +static GHashTable *connection_hash;
> +
> +static void connection_removed_notify(gpointer data)
> +{
> + int fd = GPOINTER_TO_INT(data);
> +
> + DBG("%d", fd);
> +
> + shutdown(fd, SHUT_RDWR);
> + close(fd);
> +}
I will be a bit nit-picky here, but shutdown() does not belong here.
You only want to do this inside the RequestDisconnection() implementation.
Also, please name this function connection_destroy().
Regards,
-Denis
prev parent reply other threads:[~2013-04-19 15:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-19 15:00 [PATCH v4 1/3] hfp_ag_bluez5: Create a hash to store connections Paulo Borges
2013-04-19 15:00 ` [PATCH v4 2/3] hfp_ag_bluez5: Add watch for G_IO_HUP when connect Paulo Borges
2013-04-19 15:01 ` [PATCH v4 3/3] hfp_ag_bluez5: Implement RequestDisconnection() Paulo Borges
2013-04-19 15:36 ` Denis Kenzior [this message]
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=5171648A.8000109@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