From: "Łukasz Rymanowski" <lukasz.rymanowski@codecoup.pl>
To: linux-bluetooth@vger.kernel.org
Cc: "Łukasz Rymanowski" <lukasz.rymanowski@codecoup.pl>
Subject: [PATCH v3 5/9] shared/gatt-server: Fix handle error on execute write
Date: Fri, 18 Mar 2016 14:08:14 +0100 [thread overview]
Message-ID: <1458306498-28151-6-git-send-email-lukasz.rymanowski@codecoup.pl> (raw)
In-Reply-To: <1458306498-28151-1-git-send-email-lukasz.rymanowski@codecoup.pl>
If there is an error during execute write we should drop all
outstanding prep_write data. This patch fix that.
---
src/shared/gatt-server.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/shared/gatt-server.c b/src/shared/gatt-server.c
index ba668e3..c41273a 100644
--- a/src/shared/gatt-server.c
+++ b/src/shared/gatt-server.c
@@ -1204,6 +1204,9 @@ static void exec_next_prep_write(struct bt_gatt_server *server,
err = BT_ATT_ERROR_UNLIKELY;
error:
+ queue_remove_all(server->prep_queue, NULL, NULL,
+ prep_write_data_destroy);
+
bt_att_send_error_rsp(server->att, BT_ATT_OP_EXEC_WRITE_REQ,
ehandle, err);
}
@@ -1248,6 +1251,8 @@ static void exec_write_cb(uint8_t opcode, const void *pdu,
return;
error:
+ queue_remove_all(server->prep_queue, NULL, NULL,
+ prep_write_data_destroy);
bt_att_send_error_rsp(server->att, opcode, 0, ecode);
}
--
2.5.0
next prev parent reply other threads:[~2016-03-18 13:08 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-18 13:08 [PATCH v3 0/9] shared/gatt: Couple fixes and improvements Łukasz Rymanowski
2016-03-18 13:08 ` [PATCH v3 1/9] unit/test-gatt: Fix long write testcases Łukasz Rymanowski
2016-03-18 13:08 ` [PATCH v3 2/9] unit/test-gatt: Modify small-db Łukasz Rymanowski
2016-03-18 13:08 ` [PATCH v3 3/9] unit/test-gatt: Extend large-db Łukasz Rymanowski
2016-03-18 13:08 ` [PATCH v3 4/9] unit/test-gatt: Fix long write test Łukasz Rymanowski
2016-03-18 13:08 ` Łukasz Rymanowski [this message]
2016-03-18 13:08 ` [PATCH v3 6/9] shared/gatt-server: Add support for long write Łukasz Rymanowski
2016-03-22 15:03 ` Luiz Augusto von Dentz
2016-03-25 14:15 ` Łukasz Rymanowski
2016-03-18 13:08 ` [PATCH v3 7/9] shared/gatt-server: Support for reliable session nested with long Łukasz Rymanowski
2016-03-18 13:08 ` [PATCH v3 8/9] shared/gatt-db: Add API to get extended prop Łukasz Rymanowski
2016-03-18 13:08 ` [PATCH v3 9/9] shared/gatt-server: Check for ext. charact. prop. on reliable session Łukasz Rymanowski
2016-03-22 14:57 ` [PATCH v3 0/9] shared/gatt: Couple fixes and improvements Luiz Augusto von Dentz
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=1458306498-28151-6-git-send-email-lukasz.rymanowski@codecoup.pl \
--to=lukasz.rymanowski@codecoup.pl \
--cc=linux-bluetooth@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).