2011-10-05 14:52:04

by Slawomir Bochenski

[permalink] [raw]
Subject: [PATCH obexd 1/2] Utilise os_set_response in check_put

---
src/obex.c | 11 +----------
1 files changed, 1 insertions(+), 10 deletions(-)

diff --git a/src/obex.c b/src/obex.c
index 2cabadb..b0a4183 100644
--- a/src/obex.c
+++ b/src/obex.c
@@ -1076,22 +1076,13 @@ static gboolean check_put(obex_t *obex, obex_object_t *obj)
switch (ret) {
case 0:
break;
- case -EPERM:
- OBEX_ObjectSetRsp(obj, OBEX_RSP_FORBIDDEN, OBEX_RSP_FORBIDDEN);
- return FALSE;
- case -EBADR:
- OBEX_ObjectSetRsp(obj, OBEX_RSP_BAD_REQUEST,
- OBEX_RSP_BAD_REQUEST);
- return FALSE;
case -EAGAIN:
OBEX_SuspendRequest(obex, obj);
os->obj = obj;
os->driver->set_io_watch(os->object, handle_async_io, os);
return TRUE;
default:
- DBG("Unhandled chkput error: %d", ret);
- OBEX_ObjectSetRsp(obj, OBEX_RSP_INTERNAL_SERVER_ERROR,
- OBEX_RSP_INTERNAL_SERVER_ERROR);
+ os_set_response(obj, ret);
return FALSE;

}
--
1.7.4.1



2011-10-05 14:41:10

by Johan Hedberg

[permalink] [raw]
Subject: Re: [PATCH obexd 1/2] Utilise os_set_response in check_put

Hi Slawek,

On Wed, Oct 05, 2011, Slawomir Bochenski wrote:
> ---
> src/obex.c | 11 +----------
> 1 files changed, 1 insertions(+), 10 deletions(-)

Both patches have been applied. Thanks.

Johan

2011-10-05 14:52:05

by Slawomir Bochenski

[permalink] [raw]
Subject: [PATCH obexd 2/2] Pass through error returned by open in PUTs

---
src/obex.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/obex.c b/src/obex.c
index b0a4183..59bbe7a 100644
--- a/src/obex.c
+++ b/src/obex.c
@@ -958,7 +958,7 @@ int obex_put_stream_start(struct obex_session *os, const char *filename)
(size_t *) &os->size : NULL, &err);
if (os->object == NULL) {
error("open(%s): %s (%d)", filename, strerror(-err), -err);
- return -EPERM;
+ return err;
}

os->path = g_strdup(filename);
--
1.7.4.1