| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
In addition use define so it is easier to change this in future
|
|
|
|
|
| |
This should make it easier to identify to which session the transfer
belongs.
|
|
|
|
| |
The base is also changed to /org/bluez/obex to follow the new namespace
|
| |
|
|
|
|
|
| |
After the removal of the agent, the implementation of the session can be
simplified by removing all authentication-related code.
|
|
|
|
|
| |
The new D-Bus API uses signals to report the progress updates, so the
internal progress callback is not needed any more.
|
|
|
|
|
|
| |
The authorization mechanism is entirely removed from the session, and
thus transfers are automatically started (once popped from the queue)
without confirmation and without any name/filename change.
|
|
|
|
|
| |
The security checks in the transfers' D-Bus API will consider check for
the transfer owner's path (session owner) instead of the agent path.
|
|
|
|
| |
No functionality changes. This is just about avoiding duplicated code.
|
| |
|
|
|
|
|
| |
Use GDBUS_* macros, so signature and reply fields are not set in each
method/signal.
|
|
|
|
|
| |
With these macro helpers we can separate in/out arguments and use their
own vector.
|
|
|
|
|
|
|
| |
Constify method tables with the following command:
find . -name '*.[ch]' -exec \
sed -i 's/\(GDBusMethodTable .* =\)/const \1/g' {} \;
|
|
|
|
|
|
|
|
| |
After this patch the modules are responsible for creating the transfers,
and these objects must be queued using the session API.
This way the transfer initiator has full access to the transfer object,
in case for example it wants to access some member variable.
|
|
|
|
|
| |
This minor change makes the transfer API more consistent with the
parameter-order used in the session API.
|
|
|
|
|
|
| |
Transfer API now takes const buffers (both params and contents) and
internally copies the memory as necessary. This new API is safer to use,
which is convenient if the modules would start using it directly.
|
|
|
|
|
|
|
|
|
| |
The transfer-creating functions (obc_transfer_get and obc_transfer_put)
no longer register the transfer automatically.
This separation makes it possible that the modules would create the
transfers and then pass the object to the session, which would be
responsible for the registration.
|
|
|
|
|
|
|
|
|
|
|
| |
It is safer to remove the transfer from the internal queue (including
session->p) before calling the transfer callback. This makes sure the
callback will not manipulate the session in a way that the transfer is
removed more than once.
This was previously protected with session->p->id != 0 checks, but once
the new callbacks have been adopted in session API, this logic can be
removed.
|
|
|
|
|
| |
Once the modules are using the new callback style, the session API can
be simplified and the old functions to access session->p removed.
|
|
|
|
|
|
|
|
|
|
| |
Operations involving a transfer object will receive a pointer to such
transfer in the callback.
Note that the ownership of this object is not changed in any way,
meaning that the session is still responsible for it. However this
pointer can be useful during the execution of the callback, in order to
access data members of the transfer.
|
|
|
|
|
|
|
| |
Trivial changes in buffer getters in both session and transfer,
regarding the access of transfer parameters:
- const qualifiers added, to avoid unwanted frees
- Buffers are now returned as void* instead of guint8*
|
|
|
|
|
| |
This is more consistent with other functions and allow the caller to
cancel the request using obc_session_cancel.
|
|
|
|
|
| |
The errors should be properly forward to the caller and not just convert
to generic error.
|
|
|
|
|
|
|
|
| |
This simplify the API a bit by not having to call obc_transfer_set_file
to open the file.
In addition to that split transfer creation/registration function so
GET/PUT can have more specific logic and different paramenters.
|
|
|
|
|
| |
gobex api should not be used by a transfer until it is started. This
seems more explicit if the pointer is not passed during creation.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A new enum type is used to distinguish put and get transfers.
This is more convenient since it is done when registering the transfer,
and not when it is actually started. The main benefits would be:
- Some actions can be taken during creation, such as opening files.
- session.c gets simplified.
- The size of a put transfer can be exposed in D-Bus, while queued.
- The transfer operation (put or get) can be exposed in D-Bus.
None of these D-Bus changes are included in this patch.
|
|
|
|
| |
Simplify the code by using temporary files and eliminates reallocations.
|
|
|
|
|
|
| |
Commit c07ddfbd019d3545cce2d7ec694143cdc55a2167 introduced the freeing of
the active pending request on obc_session_shutdown without checking if
the request was already processed/terminated.
|
| |
|
| |
|
|
|
|
|
|
|
| |
Functions obc_session_get and obc_session_pull nearly share the same
code, so the later can be achieved by just calling the first one.
The session api is not modified in this patch.
|
|
|
|
|
|
|
|
|
|
| |
The terms "name", "filename" and "targetname" are used in session.h that
can be confusing. This patch proposes to follow the terminology in the
D-Bus api:
- Name: the remote name of the object being transferred
- Filename: the local filesystem name of a file being sent
- Targetfile: the local filesystem name of a file being
received
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The terms can be quite misleading, so this patch proposes to follow the
terminology in the D-Bus api:
- Name: the remote name of the object being transferred
- Filename: the name of the file in local the filesystem
Both values can be NULL independently.
This fixes the problem of using the terms differently in get and put
operations. The result was that the properties "Name" and "Filename" were
swapped in D-Bus in the case of get.
Once the fields map to obex fields, the interpretation of the response
from the agent becomes more complicated. Depending on the transfer type,
either the name or the filename field must be updated.
|
|
|
|
| |
obex_io_error_quark is only used in session.c so can be static
|
|
|
|
|
| |
The currently active request should be canceled just like any other
queued transfer. Otherwise obex timeout is reported.
|
|
|
|
|
| |
A session can be shut down from D-Bus, and therefore the pending
transfer callbacks must be reported.
|
|
|
|
|
|
| |
Previous implementation of session_terminate_transfer assumed that the
transfer being terminated would always be the active one. However, it
should be possible to cancel any queued transfer using the D-Bus api.
|
|
|
|
|
| |
This will allow setting the callback before the transfer is started,
particularly to report queued transfer cancellations.
|
|
|
|
|
| |
session_process_queue should make sure there is no active operation, to
avoid starting a second one at the same time.
|
|
|
|
|
| |
Size 0 should be reported if no transfer exists. Some existing code
relies on this behavior.
|
|
|
|
|
|
| |
The authorization request of a queued transfer could fail, and this
needs to be reported to the transfer initiator. Otherwise it would
likely result in D-Bus timeouts.
|
|
|
|
|
| |
obc_session_put takes ownership of the given buffer, but did not free
the memory in case of error.
|
|
|
|
|
| |
This adds support for reading GoepL2capPsm attribute from sdp record
and connect to it.
|
|
|
|
| |
Modules should no longer need to access gobex directly
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|