From 30e3b9e9f2aa55fbe7fce6565a18552dce8ab984 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Fri, 4 Jul 2008 10:13:53 +0300 Subject: [PATCH] obexd: Use size = 0 to indicate deletion (default as long as no body headers have been received) --- obexd/src/ftp.c | 2 +- obexd/src/obex.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/obexd/src/ftp.c b/obexd/src/ftp.c index 4d7c52f62..95e8c2b23 100644 --- a/obexd/src/ftp.c +++ b/obexd/src/ftp.c @@ -249,7 +249,7 @@ gint ftp_chkput(obex_t *obex, obex_object_t *obj) if (os == NULL) return -EINVAL; - if (!os->size) + if (os->size < 0) return -EINVAL; return os_prepare_put(os); diff --git a/obexd/src/obex.c b/obexd/src/obex.c index b3bba3f81..b9ddf3115 100644 --- a/obexd/src/obex.c +++ b/obexd/src/obex.c @@ -106,7 +106,7 @@ static void os_reset_session(struct obex_session *os, gboolean aborted) os->buf = NULL; } os->offset = 0; - os->size = 0; + os->size = -1; } static void obex_session_free(struct obex_session *os) @@ -620,7 +620,7 @@ static gboolean check_put(obex_t *obex, obex_object_t *obj) break; case OBEX_HDR_BODY: - os->size = -1; + os->size = 0; break; case OBEX_HDR_LENGTH: @@ -871,6 +871,7 @@ gint obex_session_start(gint fd, struct server *server) os->rx_mtu = RX_MTU; os->tx_mtu = TX_MTU; os->fd = -1; + os->size = -1; obex = OBEX_Init(OBEX_TRANS_FD, obex_event, 0); if (!obex) {