Re: [PATCH] obexd: Fix can't receive small files sent by windows

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear Xinpeng,


Thank you for the patch.

You can use `git format-patch`’s switch `--reroll-count` to denote that it’s replacing an earlier sent in patch. It’s also good practice to write the changes between the version below the `---` line, so it’s clear for the reviewer, what changed. For example:

v2: Fix typo in commit message summary

Am 23.03.22 um 06:21 schrieb xinpeng wang:
Windows devices use streaming mode to send files. If a small file is

What do you mean by Windows devices exactly? Windows phone or any computer?

sent,the first time processing data will be completed successfully,

Please add a space after the comma.

and the transfer_complete function will be called before the end to
clear os->path.At this time, the dbus signal is still pending, and

Please add a space after the dot/period.

the dbus method call requesting the file path has not been processed;
in this way, the upper-level program will not be able to obtain the
file path, resulting in failure to receive the file.
Therefore, the signal of Filename is generated, and it is forced to
be sent when status=active.

I’d also add a blank line between paragraphs.

How can your issue be reproduced, and the fix verified?

Signed-off-by: xinpeng wang <wangxinpeng@xxxxxxxxxxxxx>
---
  obexd/src/manager.c | 6 +++++-
  obexd/src/obex.c    | 1 +
  2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/obexd/src/manager.c b/obexd/src/manager.c
index 01741fe62..2c180dc44 100644
--- a/obexd/src/manager.c
+++ b/obexd/src/manager.c
@@ -533,8 +533,12 @@ void manager_emit_transfer_property(struct obex_transfer *transfer,
  void manager_emit_transfer_started(struct obex_transfer *transfer)
  {
  	transfer->status = TRANSFER_STATUS_ACTIVE;
+	if (!transfer->path)
+		return;
- manager_emit_transfer_property(transfer, "Status");
+	g_dbus_emit_property_changed_full(connection, transfer->path,
+					TRANSFER_INTERFACE, "Status",
+					G_DBUS_PROPERTY_CHANGED_FLAG_FLUSH);
  }
static void emit_transfer_completed(struct obex_transfer *transfer,
diff --git a/obexd/src/obex.c b/obexd/src/obex.c
index 3a68fd66c..c0d9e160a 100644
--- a/obexd/src/obex.c
+++ b/obexd/src/obex.c
@@ -720,6 +720,7 @@ int obex_put_stream_start(struct obex_session *os, const char *filename)
  		manager_emit_transfer_property(os->service_data, "Size");
os->path = g_strdup(filename);
+	manager_emit_transfer_property(os->service_data, "Filename");
return 0;
  }



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux