From 00f7eef8f2265af94dadc72da6dac7287ac3eea2 Mon Sep 17 00:00:00 2001 From: Vinicius Costa Gomes Date: Mon, 1 Feb 2010 14:59:03 -0300 Subject: [PATCH] obexd: Fix the response of PUT requests for PBAP When the plugin doesn't implement the put callback the default behaviour is to respond with the NOT_IMPLEMENTED code. Making the chkput callback return -EINVAL we force the response to be BAD_REQUEST which is what the PBAP spec mandates. --- obexd/plugins/pbap.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/obexd/plugins/pbap.c b/obexd/plugins/pbap.c index 7461fd3e1..807e68fb5 100644 --- a/obexd/plugins/pbap.c +++ b/obexd/plugins/pbap.c @@ -558,6 +558,12 @@ static void pbap_disconnect(obex_t *obex) unregister_session(os->cid); } +static gint pbap_chkput(obex_t *obex, obex_object_t *obj) +{ + /* Rejects all PUTs */ + return -EINVAL; +} + struct obex_service_driver pbap = { .name = "Phonebook Access server", .service = OBEX_PBAP, @@ -568,7 +574,8 @@ struct obex_service_driver pbap = { .connect = pbap_connect, .get = pbap_get, .setpath = pbap_setpath, - .disconnect = pbap_disconnect + .disconnect = pbap_disconnect, + .chkput = pbap_chkput }; static int pbap_init(void) -- 2.47.3