gobex: fix setting final bit on PUT requests

Final bit should not be set when creating new request packets for PUT
since it may be not be the end of the body.
This commit is contained in:
Luiz Augusto von Dentz 2011-08-26 12:49:32 +03:00 committed by Marcel Holtmann
parent 1e00bd8f5e
commit c96d0645b3

View File

@ -170,10 +170,14 @@ static void transfer_response(GObex *obex, GError *err, GObexPacket *rsp,
return;
}
req = g_obex_packet_new(transfer->opcode, TRUE, G_OBEX_HDR_INVALID);
if (transfer->opcode == G_OBEX_OP_PUT)
if (transfer->opcode == G_OBEX_OP_PUT) {
req = g_obex_packet_new(transfer->opcode, FALSE,
G_OBEX_HDR_INVALID);
g_obex_packet_add_body(req, put_get_data, transfer);
} else {
req = g_obex_packet_new(transfer->opcode, TRUE,
G_OBEX_HDR_INVALID);
}
transfer->req_id = g_obex_send_req(obex, req, -1, transfer_response,
transfer, &err);