* [PATCH BlueZ v2] obexd: support to reply folder name to store file
@ 2023-04-19 3:07 Aaron_shen
2023-04-19 4:36 ` [BlueZ,v2] " bluez.test.bot
2023-04-19 7:12 ` [PATCH BlueZ v2] " Paul Menzel
0 siblings, 2 replies; 3+ messages in thread
From: Aaron_shen @ 2023-04-19 3:07 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Aaron_shen
The obex agent usually reply the filename by getting the default filename
from the filename property of the transfer object which is not convenient.
The patch helps that the obex agent can reply folder name or new filename
or null which will use the default filename if new_name is NULL and the
default folder if the new_folder is NULL in opp_chkput().
---
doc/obex-agent-api.txt | 9 +++++----
obexd/src/manager.c | 10 ++++++----
2 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/doc/obex-agent-api.txt b/doc/obex-agent-api.txt
index 3923da6df..322531009 100644
--- a/doc/obex-agent-api.txt
+++ b/doc/obex-agent-api.txt
@@ -46,10 +46,11 @@ Methods void Release()
This method gets called when the service daemon
needs to accept/reject a Bluetooth object push request.
- Returns the full path (including the filename) where
- the object shall be stored. The tranfer object will
- contain a Filename property that contains the default
- location and name that can be returned.
+ Returns the full path (including the filename) or
+ folder name suffiexed with '/' where the object shall
+ be stored. The transfer object will contain a Filename
+ property that contains the default location and name
+ that can be returned.
Possible errors: org.bluez.obex.Error.Rejected
org.bluez.obex.Error.Canceled
diff --git a/obexd/src/manager.c b/obexd/src/manager.c
index 849928603..73fd6b9af 100644
--- a/obexd/src/manager.c
+++ b/obexd/src/manager.c
@@ -632,8 +632,7 @@ static void agent_reply(DBusPendingCall *call, void *user_data)
if (dbus_error_has_name(&derr, DBUS_ERROR_NO_REPLY))
agent_cancel();
-
- if (dbus_error_has_name(&derr, OBEX_ERROR_REJECT))
+ else if (dbus_error_has_name(&derr, OBEX_ERROR_REJECT))
agent->auth_reject = TRUE;
dbus_error_free(&derr);
@@ -651,7 +650,10 @@ static void agent_reply(DBusPendingCall *call, void *user_data)
agent->new_name = g_strdup(name);
agent->new_folder = NULL;
} else {
- agent->new_name = g_strdup(slash + 1);
+ if (strlen(slash) == 1)
+ agent->new_name = NULL;
+ else
+ agent->new_name = g_strdup(slash + 1);
agent->new_folder = g_strndup(name, slash - name);
}
}
@@ -722,7 +724,7 @@ int manager_request_authorization(struct obex_transfer *transfer,
dbus_pending_call_unref(call);
- if (!agent || !agent->new_name || agent->auth_reject)
+ if (!agent || agent->auth_reject)
return -EPERM;
*new_folder = agent->new_folder;
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [BlueZ,v2] obexd: support to reply folder name to store file
2023-04-19 3:07 [PATCH BlueZ v2] obexd: support to reply folder name to store file Aaron_shen
@ 2023-04-19 4:36 ` bluez.test.bot
2023-04-19 7:12 ` [PATCH BlueZ v2] " Paul Menzel
1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2023-04-19 4:36 UTC (permalink / raw)
To: linux-bluetooth, aarongt.shen
[-- Attachment #1: Type: text/plain, Size: 949 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=741164
---Test result---
Test Summary:
CheckPatch PASS 0.40 seconds
GitLint PASS 0.27 seconds
BuildEll PASS 35.88 seconds
BluezMake PASS 1255.38 seconds
MakeCheck PASS 13.43 seconds
MakeDistcheck PASS 198.60 seconds
CheckValgrind PASS 321.01 seconds
CheckSmatch PASS 445.69 seconds
bluezmakeextell PASS 132.88 seconds
IncrementalBuild PASS 1027.23 seconds
ScanBuild PASS 1453.87 seconds
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH BlueZ v2] obexd: support to reply folder name to store file
2023-04-19 3:07 [PATCH BlueZ v2] obexd: support to reply folder name to store file Aaron_shen
2023-04-19 4:36 ` [BlueZ,v2] " bluez.test.bot
@ 2023-04-19 7:12 ` Paul Menzel
1 sibling, 0 replies; 3+ messages in thread
From: Paul Menzel @ 2023-04-19 7:12 UTC (permalink / raw)
To: aarongt.shen; +Cc: linux-bluetooth
Dear Aaron,
Thank you for your patch.
Am 19.04.23 um 05:07 schrieb Aaron_shen:
[…]
One cosmetic remark: Your name is shown as Aaron_shen. More common is
probably Aaron Shen? I think you can improve that with:
$ git config --global user.name "Aaron Shen"
$ git commit --amend --author="Aaron Shen <aarongt.shen@gmail.com>"
Then you can send v3.
Kind regards,
Paul
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-04-19 7:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-19 3:07 [PATCH BlueZ v2] obexd: support to reply folder name to store file Aaron_shen
2023-04-19 4:36 ` [BlueZ,v2] " bluez.test.bot
2023-04-19 7:12 ` [PATCH BlueZ v2] " Paul Menzel
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.