All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ] gobex: Print error if data cannot be written
@ 2022-02-14 23:42 Luiz Augusto von Dentz
  2022-02-15  2:31 ` [BlueZ] " bluez.test.bot
  0 siblings, 1 reply; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2022-02-14 23:42 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

This makes sure that if the data cannot be written it fails and the
error is properly printed.
---
 gobex/gobex.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/gobex/gobex.c b/gobex/gobex.c
index 54e3b0814..185eed4d7 100644
--- a/gobex/gobex.c
+++ b/gobex/gobex.c
@@ -419,6 +419,8 @@ static gboolean write_data(GIOChannel *io, GIOCondition cond,
 							gpointer user_data)
 {
 	GObex *obex = user_data;
+	struct pending_pkt *p = NULL;
+	GError *err = NULL;
 
 	if (cond & G_IO_NVAL)
 		return FALSE;
@@ -427,9 +429,9 @@ static gboolean write_data(GIOChannel *io, GIOCondition cond,
 		goto stop_tx;
 
 	if (obex->tx_data == 0) {
-		struct pending_pkt *p = g_queue_pop_head(obex->tx_queue);
 		ssize_t len;
 
+		p = g_queue_pop_head(obex->tx_queue);
 		if (p == NULL)
 			goto stop_tx;
 
@@ -480,8 +482,19 @@ encode:
 		return FALSE;
 	}
 
-	if (!obex->write(obex, NULL))
+	if (!obex->write(obex, &err)) {
+		g_obex_debug(G_OBEX_DEBUG_ERROR, "%s", err->message);
+
+		if (p) {
+			if (p->rsp_func)
+				p->rsp_func(obex, err, NULL, p->rsp_data);
+
+			pending_pkt_free(p);
+		}
+
+		g_error_free(err);
 		goto stop_tx;
+	}
 
 done:
 	if (obex->tx_data > 0 || g_queue_get_length(obex->tx_queue) > 0)
-- 
2.34.1


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

* RE: [BlueZ] gobex: Print error if data cannot be written
  2022-02-14 23:42 [PATCH BlueZ] gobex: Print error if data cannot be written Luiz Augusto von Dentz
@ 2022-02-15  2:31 ` bluez.test.bot
  2022-02-15 21:44   ` Luiz Augusto von Dentz
  0 siblings, 1 reply; 3+ messages in thread
From: bluez.test.bot @ 2022-02-15  2:31 UTC (permalink / raw)
  To: linux-bluetooth, luiz.dentz

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

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=614288

---Test result---

Test Summary:
CheckPatch                    PASS      1.43 seconds
GitLint                       PASS      1.04 seconds
Prep - Setup ELL              PASS      45.12 seconds
Build - Prep                  PASS      0.78 seconds
Build - Configure             PASS      9.33 seconds
Build - Make                  PASS      1298.30 seconds
Make Check                    PASS      12.01 seconds
Make Check w/Valgrind         PASS      462.64 seconds
Make Distcheck                PASS      243.49 seconds
Build w/ext ELL - Configure   PASS      9.23 seconds
Build w/ext ELL - Make        PASS      1278.19 seconds
Incremental Build with patchesPASS      0.00 seconds



---
Regards,
Linux Bluetooth


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

* Re: [BlueZ] gobex: Print error if data cannot be written
  2022-02-15  2:31 ` [BlueZ] " bluez.test.bot
@ 2022-02-15 21:44   ` Luiz Augusto von Dentz
  0 siblings, 0 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2022-02-15 21:44 UTC (permalink / raw)
  To: linux-bluetooth

Hi,

On Mon, Feb 14, 2022 at 6:31 PM <bluez.test.bot@gmail.com> wrote:
>
> This is automated email and please do not reply to this email!
>
> Dear submitter,
>
> Thank you for submitting the patches to the linux bluetooth mailing list.
> This is a CI test results with your patch series:
> PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=614288
>
> ---Test result---
>
> Test Summary:
> CheckPatch                    PASS      1.43 seconds
> GitLint                       PASS      1.04 seconds
> Prep - Setup ELL              PASS      45.12 seconds
> Build - Prep                  PASS      0.78 seconds
> Build - Configure             PASS      9.33 seconds
> Build - Make                  PASS      1298.30 seconds
> Make Check                    PASS      12.01 seconds
> Make Check w/Valgrind         PASS      462.64 seconds
> Make Distcheck                PASS      243.49 seconds
> Build w/ext ELL - Configure   PASS      9.23 seconds
> Build w/ext ELL - Make        PASS      1278.19 seconds
> Incremental Build with patchesPASS      0.00 seconds
>
>
>
> ---
> Regards,
> Linux Bluetooth
>

Pushed.

-- 
Luiz Augusto von Dentz

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

end of thread, other threads:[~2022-02-15 21:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-14 23:42 [PATCH BlueZ] gobex: Print error if data cannot be written Luiz Augusto von Dentz
2022-02-15  2:31 ` [BlueZ] " bluez.test.bot
2022-02-15 21:44   ` Luiz Augusto von Dentz

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.