mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-12-02 16:44:18 +08:00
obexd: Use size = 0 to indicate deletion (default as long as no body headers have been received)
This commit is contained in:
parent
e85678d16e
commit
30e3b9e9f2
@ -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);
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user