Commit Graph

500 Commits

Author SHA1 Message Date
Mikel Astiz
60b2e58209 obexd: Remove obc_transfer_abort
Refactor the code to remove function obc_transfer_abort, which is used
only once and is anyway coupled to the D-Bus API.
2012-12-04 22:49:02 +01:00
Mikel Astiz
68b394a78b obexd: Fix possible unreplied D-Bus message
If a previous cancel request is in progress, a second cancel request
should fail.

This by the way fixes unreplied D-Bus messages.
2012-12-04 22:49:02 +01:00
Luiz Augusto von Dentz
a9a5fcd7db obexd: Fix using org.openobex.Error
In addition use define so it is easier to change this in future
2012-12-04 22:49:02 +01:00
Luiz Augusto von Dentz
8a296cfcbb obexd: Use session path as prefix for transfer path
This should make it easier to identify to which session the transfer
belongs.
2012-12-04 22:49:02 +01:00
Luiz Augusto von Dentz
dc3076af72 obexd: Fix not using connection passed to obc_transfer_register
Make use of the connection parameter instead of assuming the connection
will always be to the session bus.
2012-12-04 22:49:02 +01:00
Luiz Augusto von Dentz
2a7ec51f94 obexd: Rename Transfer interface to org.bluez.obex.Transfer 2012-12-04 22:49:02 +01:00
Luiz Augusto von Dentz
e3d1b527ca obexd: Rename MessageAccess interface to org.bluez.obex.MessageAccess 2012-12-04 22:49:02 +01:00
Luiz Augusto von Dentz
dea7c760ce obexd: Rename Synchronization interface to org.bluez.obex.Synchronization 2012-12-04 22:49:02 +01:00
Luiz Augusto von Dentz
6ae1745820 obexd: Rename PhonebookAccess interface to org.bluez.obex.PhonebookAccess 2012-12-04 22:49:02 +01:00
Luiz Augusto von Dentz
712f112619 obexd: Rename FileTransfer interface to org.bluez.obex.FileTransfer 2012-12-04 22:49:02 +01:00
Luiz Augusto von Dentz
f542d96735 obexd: Rename ObjectPush interface to org.bluez.obex.ObjectPush 2012-12-04 22:49:01 +01:00
Luiz Augusto von Dentz
7d565a9c07 obexd: Rename session interface to org.bluez.obex.Session
The base is also changed to /org/bluez/obex to follow the new namespace
2012-12-04 22:49:01 +01:00
Luiz Augusto von Dentz
27a14618b1 obexd: Change namespace to org.bluez.obex.client 2012-12-04 22:49:01 +01:00
Mikel Astiz
f44090ba4b obexd: Update copyright statement 2012-12-04 22:49:01 +01:00
Mikel Astiz
4b424100ef obexd: PhonebookAccess sessions return transfers
Return the D-Bus path of the transfer representing the operation.
2012-12-04 22:49:01 +01:00
Mikel Astiz
0a174f40c6 obexd: Synchronization sessions return transfers
Return the D-Bus path of the transfer representing the operation.
2012-12-04 22:49:01 +01:00
Mikel Astiz
d6f045dc5c obexd: FileTransfer sessions return transfers
Return the D-Bus path of the transfer representing the operation.
2012-12-04 22:49:01 +01:00
Mikel Astiz
6793dfe0d0 obexd: ObjectPush sessions return transfers
Return the D-Bus path of the transfer representing the operation.
2012-12-04 22:49:01 +01:00
Mikel Astiz
d3b779a77a obexd: Expose D-Bus data in internal transfer API
Expose in transfer API the D-Bus path and properties as should be
returned by transfer-initiating D-Bus methods.
2012-12-04 22:49:01 +01:00
Mikel Astiz
b5fe20a9a4 obexd: Support empty filename in obc_transfer_get
Passing an empty string as a filename for obc_transfer_get will be
similar to passing a NULL filename. This means a temporary file will be
created to store the content of the transfer.

NULL and "" are not exactly equivalent though: in case of NULL the file
will be automatically removed immediately after being open, which means
that the transfer initiator should also open the file to prevent it from
being removed (to be used from the modules). In this case, the filename
will not be exposed in D-Bus.

On the other hand, if "" is given, the file will be removed only in case
of error. So after success the transfer initiator should decide whether
the file should be removed or not.

This change is convenient in order to expose the same API in D-Bus.
2012-12-04 22:49:01 +01:00
Mikel Astiz
c8ec529a7c obexd: Make transfer filename optional
The property might not exist for certain transfers, typically when they
have been initiated internally.
2012-12-04 22:49:01 +01:00
Mikel Astiz
eae9cf3da1 obexd: Make FileTransfer.PutFile asynchronous
There is no reason to have inconsistent behavior between GetFile and
PutFile, in FileTransfer D-Bus API.

Before this change, PutFile reported success immediately after queueing
the transfer, even though the D-Bus signature includes the async flag.
2012-12-04 22:49:01 +01:00
Mikel Astiz
b91d48749b obexd: Expose all transfers in D-Bus
Relying on a internal policy (based on transfer type) to decide if a
transfer should be exposed or not in D-Bus has some limitations. The
simplest possible alternative to this is to expose all transfers in
D-Bus, assuming the overhead is not significant.
2012-12-04 22:49:00 +01:00
Mikel Astiz
b9f31ead5f obexd: Remove obsolete authentication code
After the removal of the agent, the implementation of the session can be
simplified by removing all authentication-related code.
2012-12-04 22:49:00 +01:00
Mikel Astiz
ef129dcce0 obexd: Remove internal transfer progress report
The new D-Bus API uses signals to report the progress updates, so the
internal progress callback is not needed any more.
2012-12-04 22:49:00 +01:00
Mikel Astiz
649a3ffdb8 obexd: Remove unused functions in transfer API
After the removal of the agent these functions are not useful any more.
2012-12-04 22:49:00 +01:00
Mikel Astiz
5e3bc6b93e obexd: Remove D-Bus agent
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.
2012-12-04 22:49:00 +01:00
Mikel Astiz
5119ebcc35 obexd: Use transfer owner instead of agent
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.
2012-12-04 22:49:00 +01:00
Mikel Astiz
ce7b4cbd4c obexd: Add transfer event-reporting signals
These signals replace the old agent-based notification mechanism.
2012-12-04 22:49:00 +01:00
Mikel Astiz
febb9caf52 obexd: Add progress property to transfer
The number of transferred bytes is exposed in D-Bus using a specific
property for this purpose.

Internally, the value of this property does not necessarily match the
internal progress counter. In order to avoid D-Bus overhead, the
property will be updated once per second.
2012-12-04 22:49:00 +01:00
Mikel Astiz
5ac5f18a8b obexd: Add D-Bus helper library
No functionality changes. This is just about avoiding duplicated code.
2012-12-04 22:49:00 +01:00
Mikel Astiz
9250a662b3 obexd: Replace parameter dict with conventional ones 2012-12-04 22:49:00 +01:00
Mikel Astiz
3d7cfa6c5b obexd: Move GetCapabilities to session API 2012-12-04 22:49:00 +01:00
Mikel Astiz
1b6d5d12f3 obexd: Replace SendFiles with SendFile
The function is now asynchronous, since it will return only when the
transfer has been finished.
2012-12-04 22:49:00 +01:00
Mikel Astiz
0377b04bc8 obexd: Wrap OPP into specific session type 2012-12-04 22:49:00 +01:00
Mikel Astiz
8a1b3f32de obexd: Use constant instead of NULL variable
The filename will always be NULL for capability-requesting sessions, so
it doesn't make much sense to use such field.
2012-12-04 22:49:00 +01:00
Mikel Astiz
80a93e2a22 obexd: Simplify error-handling code
Refactor error-handling code to avoid duplicated code.
2012-12-04 22:48:59 +01:00
Mikel Astiz
1b0e0092dd obexd: Fix NULL dereference in case of error
obc_session_queue assumes that the given transfer is not NULL, so this
must be checked explicitly.
2012-12-04 22:48:59 +01:00
Lucas De Marchi
9692e783c3 obexd: Do not set signature and reply in GDBus tables
Use GDBUS_* macros, so signature and reply fields are not set in each
method/signal.
2012-12-04 22:48:59 +01:00
Lucas De Marchi
d67b588d2b obexd: Convert GDBus methods to use macro helpers
With these macro helpers we can separate in/out arguments and use their
own vector.
2012-12-04 22:48:59 +01:00
Marcel Holtmann
fc009dd49e obexd: Constify GDBus method tables
Constify method tables with the following command:

find . -name '*.[ch]' -exec \
         sed -i 's/\(GDBusMethodTable .* =\)/const \1/g' {} \;
2012-12-04 22:48:59 +01:00
Luiz Augusto von Dentz
1282ed28f0 obexd: Fix not checking if GoepL2capPsm contains a valid PSM
In case the PSM is not valid ignore it so we are still able to connect
to RFCOMM.
2012-12-04 22:48:59 +01:00
Luiz Augusto von Dentz
0cbb1f10f2 obexd: Use stack memory for application parameters in pbap module
The maximum amount needed is known and sufficiently small to be in the
stack which is much simpler to deal with.
2012-12-04 22:48:59 +01:00
Luiz Augusto von Dentz
fcd02ad59b obexd: Add obc_transfer_set_params to set application parameters
The parameters are optional and only used in a few occasions so it
doesn't make sense to have that directly in obc_transfer_get and
obc_transfer_put.
2012-12-04 22:48:59 +01:00
Mikel Astiz
9b883a0264 obexd: Create transfers in modules
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.
2012-12-04 22:48:59 +01:00
Mikel Astiz
02cc0066d9 obexd: Flip parameter order in transfer API
This minor change makes the transfer API more consistent with the
parameter-order used in the session API.
2012-12-04 22:48:59 +01:00
Mikel Astiz
c342f70d6b obexd: Buffer-passing changes in transfer 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.
2012-12-04 22:48:58 +01:00
Mikel Astiz
fea2985b14 obexd: Transfer API splits create and register
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.
2012-12-04 22:48:58 +01:00
Mikel Astiz
ec2a58fdae obexd: Split internal obc_transfer_register()
The creation process has been internally split into two steps: creation
and D-Bus registration. This is easier to understand and it also allows
to expose these two-steps in the transfer API.
2012-12-04 22:48:58 +01:00
Mikel Astiz
cc648c10fe obexd: Fix possible double free of params
obc_transfer_get() and obc_transfer_put() should only assume ownership
of the given params only in case of success. Otherwise some erros might
result in a double free of such memory.
2012-12-04 22:48:58 +01:00
Luiz Augusto von Dentz
68d8b41ec2 obexd: Add handler for SIGUSR2
This signal enables debug for obed so just do the same for obex-client
2012-12-04 22:48:58 +01:00
Luiz Augusto von Dentz
f9efbe9f80 obexd: Use signalfd to handle unix signals 2012-12-04 22:48:58 +01:00
Luiz Augusto von Dentz
b248e814f2 obexd: Fix codying style
Fix lines that are over 80 columns
2012-12-04 22:48:58 +01:00
Jaganath Kanakkassery
2971a64fa7 obexd: Wait for abort completion before Transfer.Cancel returns
A new callback is given to g_obex_cancel_transfer() which will be
called when abort completes and then only "Cancel" method reply will
be sent to user
2012-12-04 22:48:58 +01:00
Mikel Astiz
5c92e9b1cc obexd: Remove transfer from queue before callback
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.
2012-12-04 22:48:58 +01:00
Mikel Astiz
c59cab5341 obexd: Remove deprecated part of session API
Once the modules are using the new callback style, the session API can
be simplified and the old functions to access session->p removed.
2012-12-04 22:48:58 +01:00
Mikel Astiz
6fb9a7a84b obexd: Use new session callback style in modules
The session API now provides the transfer object in the callback, so
the modules can directly access the transfer object.
2012-12-04 22:48:58 +01:00
Mikel Astiz
b782daebcd obexd: Give transfer pointer in session callbacks
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.
2012-12-04 22:48:58 +01:00
Mikel Astiz
907d414d26 obexd: Avoid GObex dependency from transfer.h
This workaround makes it possible to include transfer.h from the
modules, without adding a dependency to GObex.
2012-12-04 22:48:58 +01:00
Mikel Astiz
f41c43a6e5 obexd: Minor buffer access API changes
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*
2012-12-04 22:48:57 +01:00
Luiz Augusto von Dentz
936153406b obexd: Return request id when generating a request in session API
This is more consistent with other functions and allow the caller to
cancel the request using obc_session_cancel.
2012-12-04 22:48:57 +01:00
Luiz Augusto von Dentz
4d0d679535 obexd: Fix not propagating GError in session API functions
The errors should be properly forward to the caller and not just convert
to generic error.
2012-12-04 22:48:57 +01:00
Luiz Augusto von Dentz
0f4eb3e5ce obexd: Remove file in case of error
If the transfer operation is GET and it has not complete by the time its
freed remove the file as its contents maybe corrupted/incomplete.
2012-12-04 22:48:57 +01:00
Luiz Augusto von Dentz
0977754be8 obexd: open file during transfer creation
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.
2012-12-04 22:48:57 +01:00
Mikel Astiz
272ef02090 obexd: transfers take gobex when starting
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.
2012-12-04 22:48:57 +01:00
Mikel Astiz
dd78f7c165 obexd: transfer api merges put and get
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.
2012-12-04 22:48:57 +01:00
Mikel Astiz
f3636d08a1 obexd: remove unused field
The errorcode field is set but never used, so it can safely be removed.
In addition there is no need for such a field, because errors can be
propagated using the available callback.
2012-12-04 22:48:57 +01:00
Luiz Augusto von Dentz
0cdd9bd069 obexd: Remove buffer based transfer
Simplify the code by using temporary files and eliminates reallocations.
2012-12-04 22:48:57 +01:00
Luiz Augusto von Dentz
05b22ad10b obexd: Fix possible memory leak on pbap module
16 bytes in 1 blocks are definitely lost in loss record 26 of 146
   at 0x4A075B2: realloc (vg_replace_malloc.c:525)
   by 0x3B5104B76D: g_realloc (in /lib64/libglib-2.0.so.0.3000.2)
   by 0x3B51064A96: ??? (in /lib64/libglib-2.0.so.0.3000.2)
   by 0x3B51065156: g_string_insert_len (in /lib64/libglib-2.0.so.0.3000.2)
   by 0x3B510305BC: ??? (in /lib64/libglib-2.0.so.0.3000.2)
   by 0x3B51031BE7: g_build_filename (in /lib64/libglib-2.0.so.0.3000.2)
   by 0x416FEE: pbap_select (pbap.c:254)
   by 0x406CCE: process_message (object.c:224)
   by 0x3B5301D9A0: ??? (in /lib64/libdbus-1.so.3.5.6)
   by 0x3B5300F92F: dbus_connection_dispatch (in /lib64/libdbus-1.so.3.5.6)
2012-12-04 22:48:57 +01:00
Luiz Augusto von Dentz
942bfc969d obexd: Fix regression when calling obc_session_shutdown within callback
Commit c07ddfbd019d3545cce2d7ec694143cdc55a2167 introduced the freeing of
the active pending request on obc_session_shutdown without checking if
the request was already processed/terminated.
2012-12-04 22:48:57 +01:00
Syam Sidhardhan
99f60e7937 obexd: Remove unused struct session_callback 2012-12-04 22:48:56 +01:00
Syam Sidhardhan
0315434a0e obexd: Fix memory leak during session connect 2012-12-04 22:48:56 +01:00
Mikel Astiz
a64765498f obexd: simplify obc_session_pull
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.
2012-12-04 22:48:55 +01:00
Mikel Astiz
687141b979 obexd: refactor naming convention in session api
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
2012-12-04 22:48:55 +01:00
Mikel Astiz
1fee4d9205 obexd: fix naming convention in transfer api
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.
2012-12-04 22:48:55 +01:00
Mikel Astiz
84d105d8e0 obexd: add obc_transfer_set_filename
This is just a setter for the filename field in transfers.
2012-12-04 22:48:55 +01:00
Luiz Augusto von Dentz
6d78da00e2 obexd: Remove unused public function
obex_io_error_quark is only used in session.c so can be static
2012-12-04 22:48:55 +01:00
Mikel Astiz
d381a6d934 obexd: free active transfer on session shutdown
The currently active request should be canceled just like any other
queued transfer. Otherwise obex timeout is reported.
2012-12-04 22:48:55 +01:00
Mikel Astiz
1eeaea6831 obexd: fix unreported canceled transfers
A session can be shut down from D-Bus, and therefore the pending
transfer callbacks must be reported.
2012-12-04 22:48:55 +01:00
Mikel Astiz
baa84b7232 obexd: fix canceling queued transfers
The Cancel() method in the D-Bus api should also abort queued transfers,
which should just be removed from the queue.
2012-12-04 22:48:55 +01:00
Mikel Astiz
19b460afbc obexd: terminate queued transfers properly
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.
2012-12-04 22:48:54 +01:00
Mikel Astiz
81cc887ccd obexd: make sure callback does not match size
Otherwise it can be interpreted as successfully finished, which has its
own code path.
2012-12-04 22:48:54 +01:00
Mikel Astiz
902f089da6 obexd: expose obc_transfer_set_callback
This will allow setting the callback before the transfer is started,
particularly to report queued transfer cancellations.
2012-12-04 22:48:54 +01:00
Mikel Astiz
5189cfee80 obexd: process transfer queue only if none active
session_process_queue should make sure there is no active operation, to
avoid starting a second one at the same time.
2012-12-04 22:48:54 +01:00
Mikel Astiz
ffb675e39a obexd: fix cancel when no agent present
The authorization check should consider the scenario of no agent being
assigned to the transfer.
2012-12-04 22:48:54 +01:00
Mikel Astiz
7b944e8f00 obexd: fix obc_session_get_buffer
Size 0 should be reported if no transfer exists. Some existing code
relies on this behavior.
2012-12-04 22:48:54 +01:00
Mikel Astiz
2e1ab9b75d obexd: queue transfers in pbap sessions
Previous implementation reported busy when trying to queue several
operations in the same session.
2012-12-04 22:48:54 +01:00
Mikel Astiz
2e6096423c obexd: queue transfers in ftp sessions
Previous implementation reported busy when trying to queue several
transfers in the same session.
2012-12-04 22:48:54 +01:00
Mikel Astiz
64e3360bf6 obexd: fix pbap select when same path given twice
If the same path is selected twice, the operation can be skipped but the
D-Bus response should still be sent.
2012-12-04 22:48:53 +01:00
Mikel Astiz
aae5348e9d obexd: fix incorrect error check
Previous statement always returned success.
2012-12-04 22:48:53 +01:00
Mikel Astiz
46e41cbc06 obexd: fix unreported error case
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.
2012-12-04 22:48:53 +01:00
Mikel Astiz
5655cb9c50 obexd: fix memory leak in obc_session_put
obc_session_put takes ownership of the given buffer, but did not free
the memory in case of error.
2012-12-04 22:48:53 +01:00
Luiz Augusto von Dentz
318dfd0916 obexd: Add L2CAP support in bluetooth module
This adds support for reading GoepL2capPsm attribute from sdp record
and connect to it.
2012-12-04 22:48:53 +01:00
Luiz Augusto von Dentz
8303363e6e obexd: Fix sending GET while SRM is active
If SRM is active remote will be generating responses automatically
2012-12-04 22:48:53 +01:00
Luiz Augusto von Dentz
922d181945 obexd: remove gobex dependency of session
Modules should no longer need to access gobex directly
2012-12-04 22:48:53 +01:00
Luiz Augusto von Dentz
fcc8068de6 obexd: remove use of gobex in ftp module
gobex should not be use directly as it can interfere with ongoing
requests of the session.
2012-12-04 22:48:53 +01:00
Luiz Augusto von Dentz
f5a5c95953 obexd: remove use of gobex in map module
gobex should not be use directly as it can interfere with ongoing
requests of the session.
2012-12-04 22:48:52 +01:00
Luiz Augusto von Dentz
c4b8c8adaf obexd: remove use of gobex in pbap module
gobex should not be use directly as it can interfere with ongoing
requests of the session.
2012-12-04 22:48:52 +01:00
Luiz Augusto von Dentz
5e8a10df92 obexd: introduce obc_session_cancel 2012-12-04 22:48:52 +01:00
Luiz Augusto von Dentz
514cc9d0bb obexd: introduce obc_session_delete 2012-12-04 22:48:52 +01:00
Luiz Augusto von Dentz
2e91048ed5 obexd: introduce obc_session_move 2012-12-04 22:48:52 +01:00
Luiz Augusto von Dentz
5c1c3c5d11 obexd: introduce obc_session_copy 2012-12-04 22:48:52 +01:00
Luiz Augusto von Dentz
aa38bd0529 obexd: introduce obc_session_mkdir 2012-12-04 22:48:52 +01:00
Luiz Augusto von Dentz
ed58b41924 obexd: introduce obc_session_setpath 2012-12-04 22:48:52 +01:00
Luiz Augusto von Dentz
5da12f4189 obexd: fix not queuing requests properly
OBEX does not support requests in parallel so they have to be queued
like in SendFiles.
2012-12-04 22:48:52 +01:00
Luiz Augusto von Dentz
65d9c7f8a5 obexd: remove unused field from obc_session 2012-12-04 22:48:52 +01:00
Luiz Augusto von Dentz
f427608f89 obexd: fix not checking session_request return
In case session_request return an error proceed to the next
2012-12-04 22:48:52 +01:00
Mikel Astiz
685ed406d0 obexd: Fix possible GLib assertion failure
In case of error there might be no io channel to shutdown.
2012-12-04 22:48:52 +01:00
Luiz Augusto von Dentz
4e4c8e2348 obexd: simplify handling of D-Bus pending calls in bluetooth.c
There is no much of point to have a user_data if it is always the same
type, besides this code is very inefficient and cause a lookup in the list
of pending calls everytime a reply is received.
2012-12-04 22:48:51 +01:00
Luiz Augusto von Dentz
bab4ca5f16 obexd: move bluetooth specific code from session.c to bluetooth.c
This simplifies session.c code quite a bit and enables supporting other
transports in the future.
2012-12-04 22:48:51 +01:00
Luiz Augusto von Dentz
8c97039f4e obexd: add bluetooth transport driver 2012-12-04 22:48:51 +01:00
Luiz Augusto von Dentz
6a3f42a5bc obexd: add support for transport drivers 2012-12-04 22:48:51 +01:00
Luiz Augusto von Dentz
3c51a36628 obexd: remove unused field 2012-12-04 22:48:51 +01:00
Luiz Augusto von Dentz
7aa89d5567 obexd: fix circular dependency of session and transfer
Currently the code has to to pass session to transfer via user data
(void *) only to be casted to session.
2012-12-04 22:48:51 +01:00
Luiz Augusto von Dentz
cb74e05c97 obexd: fix not being able to read apparams when transfer is complete
Transfer id/xfer is set to zero when it is completed which should not
prevent the profiles to read the apparam of the last response.
2012-12-04 22:48:51 +01:00
Luiz Augusto von Dentz
f435b5843e obexd: fix parsing of apparam on pbap driver
Both hdr and size need to be updated otherwise no parameters will be
parsed.
2012-12-04 22:48:51 +01:00
Johan Hedberg
9b2277a879 obexd: map: Rename GetMessagesListing to GetMessageListing 2012-12-04 22:48:50 +01:00
Bartosz Szatkowski
7ee7a67ce0 obexd: Add support for PullMessagesListing in MAP client
Just basic functionality for now, returning whole listing as a string
(no parsing) and no apparams handling.
2012-12-04 22:48:50 +01:00
Bartosz Szatkowski
8b15cbab9f obexd: Add basic support for MAP folder listing
For now just basic functionality - returning whole listing as a string
(no parsing for now) and no apparams handling.
2012-12-04 22:48:50 +01:00
Bartosz Szatkowski
76acb638b0 obexd: Add support for SetFolder in MAP client 2012-12-04 22:48:50 +01:00
Bartosz Szatkowski
9a9af3203b obexd: Add basic support for MAP client in obex-client 2012-12-04 22:48:50 +01:00
Jaganath Kanakkassery
320dc79f0f obexd: Fix file size issue in GetProperties
In SendFiles, If application calls GetProperties before
Request method returns then the file size is zero.
2012-12-04 22:48:49 +01:00
Bartosz Szatkowski
d6fdefe906 obexd: Fix app params memory management 2012-12-04 22:48:49 +01:00
Slawomir Bochenski
c0ad77f7e8 obexd: Fix crash on error in agent_request_reply
This fixes regression introduced by
63becff48820dc50a30ae495e286e858a886d9dd, causing obex-client to crash
in cases of e.g. remote site rejecting pushed file.

The req->function set by user of agent API may request agent object
deletion. This in turn checks if agent->pending is set and if it is,
it tries to cancel the pending call and frees pending call data. As at
this point we are already handling call response and we are going to
free this pending call data, agent->pending can be set to NULL prior to
calling req->function, thus preventing premature freeing of later
dereferenced req.
2012-12-04 22:48:46 +01:00
Slawomir Bochenski
9857369dc8 obexd: Fix missing format in call to g_error_new 2012-12-04 22:48:45 +01:00
Luiz Augusto von Dentz
230e706f80 obexd: Fix possible crash when indicating progress
The amount of transferred bytes should only be updated after it has
been sent.
2012-12-04 22:48:45 +01:00
Luiz Augusto von Dentz
9d1f970eb2 obexd: fix possible crash on GetFile
Invalid read of size 8
   at 0x413DA1: get_file_callback (ftp.c:184)
   by 0x40A74E: transfer_complete (gobex-transfer.c:73)
   by 0x40AB91: transfer_response (gobex-transfer.c:172)
   by 0x40847A: handle_response (gobex.c:629)
   by 0x408C06: incoming_data (gobex.c:811)
   by 0x3E01043DBC: g_main_context_dispatch (in /lib64/libglib-2.0.so.0.2910.0)
   by 0x3E010445A7: ??? (in /lib64/libglib-2.0.so.0.2910.0)
   by 0x3E01044AF4: g_main_loop_run (in /lib64/libglib-2.0.so.0.2910.0)
   by 0x404CD4: main (main.c:102)
 Address 0x8 is not stack'd, malloc'd or (recently) free'd
2012-12-04 22:48:44 +01:00
Johan Hedberg
081807736b obexd: Remove g_obex_packet_find_header
This was exactly the same as g_obex_packet_get_header.
2012-12-04 22:48:44 +01:00
Luiz Augusto von Dentz
0e31d0f56b obexd: port to gobex
This remove gwobex dependency of the client using gobex instead.

Based on initial work by Johan Hedberg <johan.hedberg@intel.com>
2012-12-04 22:48:43 +01:00
Luiz Augusto von Dentz
6b7b19c972 obexd: add FileTransfer.CopyFile implementation 2012-12-04 22:48:43 +01:00
Luiz Augusto von Dentz
501fa35265 obexd: add FileTransfer.MoveFile implementation 2012-12-04 22:48:43 +01:00
Luiz Augusto von Dentz
3fbffebe57 obexd: add sync target
sync target implements sync driver
2012-12-04 22:48:42 +01:00
Luiz Augusto von Dentz
e976fc0a57 obexd: add pbap target
pbap target implements phonebook access driver
2012-12-04 22:48:42 +01:00
Luiz Augusto von Dentz
044d002f1f obexd: add ftp target
ftp target implements file transfer and Nokia Pc Suite drivers.
2012-12-04 22:48:42 +01:00
Luiz Augusto von Dentz
9e64065e4f obexd: add opp target
opp target implements object push driver
2012-12-04 22:48:42 +01:00
Luiz Augusto von Dentz
29eb13b108 obexd: make use of obc_ prefix for public functions
This should indicate more clearer which function are public to the
drivers.
2012-12-04 22:48:42 +01:00
Luiz Augusto von Dentz
590fd450bb obexd: add target driver support
This simplify target matching to a single place making it easier to add
new targets/profiles.

Matching is done by either friendly name e.g. opp, ftp... or Bluetooth
UUID.

Drivers are probed when a session is established and removed when the
session is destroyed.
2012-12-04 22:48:42 +01:00
Luiz Augusto von Dentz
ec0e7836cf obexd: move __obex_log_init before manager_init
This enables us to log target during initialization
2012-12-04 22:48:42 +01:00
Luiz Augusto von Dentz
7605e6c809 obexd: add target module vtable
New targets/profiles can be introduced by just adding an entry to the
table and register their drivers similarly to a plugin.
2012-12-04 22:48:42 +01:00
Luiz Augusto von Dentz
c3dee209a0 obexd: separate manager interface code from main
Move manager interface code to it own file.
2012-12-04 22:48:41 +01:00
Luiz Augusto von Dentz
22c7e9f390 obexd: separate agent code from session
This should improve modularization of code
2012-12-04 22:48:41 +01:00
Luiz Augusto von Dentz
fd15f3a28a obexd: separate ftp code from session
This should improve modularization of code
2012-12-04 22:48:41 +01:00
Luiz Augusto von Dentz
b5c28914a1 obexd: make transfer structure private
This make it easier to modularize obex-client
2012-12-04 22:48:41 +01:00
Luiz Augusto von Dentz
d06d20882a obexd: make session structure private
Session data should not be acessible directly otherwise it cause too
much dependency by profile specific code which is quite inefficient in
the long term.
2012-12-04 22:48:41 +01:00
Dmitriy Paliy
b17209a9b4 obexd: Add adapter ReleaseSession to obex-client
Release of adapter session is added to obex-client when closing OBEX
transfer.
2012-12-04 22:48:39 +01:00
Dmitriy Paliy
821da85bb6 obexd: Add handling of system D-Bus method calls
Sending system D-Bus method calls (DefaultAdapter, FindAdapter
and RequestSession) and handling of pending D-Bus calls is added
to obex-client.
2012-12-04 22:48:39 +01:00
Dmitriy Paliy
d89ad62c05 obexd: Split up session_create in separate functions
Connection of RFCOMM and SDP are extracted from session_create function
into session_connect. Such allows making asynchronous calls before
creating connections.
2012-12-04 22:48:39 +01:00
Dmitriy Paliy
bbcc0f34da obexd: Add system bus connection in obex-client
Connection to system bus is added in obex-client. Purpose is to carry
out OBEX transfers within a single adapter's session.
2012-12-04 22:48:39 +01:00
Dmitriy Paliy
d8d19199e8 obexd: remove unnecessary brackets 2012-12-04 22:48:38 +01:00
Bartosz Szatkowski
bca372b405 obexd: Fix endian conversion for appparams in pbap client 2012-12-04 22:48:36 +01:00
Luiz Augusto von Dentz
50071dde9c obexd: add support for reusing session for the same client
If the a client owning a session attempt to send a new file just reuse
the same session instead of trying to connect again.
2012-12-04 22:48:36 +01:00
Luiz Augusto von Dentz
4780531beb obexd: fix not canceling connection request if client exit bus
There is no point on proceeding with sdp/rfcomm connections if client
exit the bus.
2012-12-04 22:48:36 +01:00
Luiz Augusto von Dentz
553f3949b5 obexd: remove unused variable 2012-12-04 22:48:35 +01:00
Luiz Augusto von Dentz
932949fe49 obexd: Add support for stat files bigger than 2GB on 32-bit systems
From stat documentation:

"(stat())  path  refers to a file whose size cannot be represented in the
type off_t.  This can occur when an application compiled on a 32-bit
platform without -D_FILE_OFFSET_BITS=64 calls stat() on a file whose size
exceeds (2<<31)-1 bits."

To fix this now size header is omitted when the file is over 32-bit, but
it is able to transfer it by using 64-bit variables. In addition to that
folder-listing now should report such big sizes properly.
2012-12-04 22:48:32 +01:00
Luiz Augusto von Dentz
127fe7b3cf obexd: Fix logging for obex-client
Since obex-client and obexd share the same log code they both were using
obexd for openlog which makes it very confusing when reading the logs.

To fix this now __obex_log_init takes the binary name so that each daemon
can be properly labeled.
2012-12-04 22:48:31 +01:00
Luiz Augusto von Dentz
22d757b954 obexd: Fix possible crash when processing session callback
If the callback removes the pending data it cause this:

==20639== Invalid read of size 4
==20639==    at 0x80553E9: free_pending (session.c:112)
==20639==    by 0x8056C83: session_request_reply (session.c:837)
==20639==    by 0x412F7E0: ??? (in /lib/libdbus-1.so.3.5.2)
==20639==    by 0x411D975: ??? (in /lib/libdbus-1.so.3.5.2)
==20639==    by 0x4120B81: dbus_connection_dispatch (in /lib/libdbus-1.so.3.5.2)
==20639==    by 0x804C27F: message_dispatch (mainloop.c:80)
==20639==    by 0x407EFCB: ??? (in /lib/libglib-2.0.so.0.2600.1)
==20639==    by 0x407E854: g_main_context_dispatch (in /lib/libglib-2.0.so.0.2600.1)
==20639==    by 0x4082667: ??? (in /lib/libglib-2.0.so.0.2600.1)
==20639==    by 0x4082BA6: g_main_loop_run (in /lib/libglib-2.0.so.0.2600.1)
==20639==    by 0x8055171: main (main.c:625)
==20639==  Address 0x4363c88 is 0 bytes inside a block of size 12 free'd
==20639==    at 0x40257ED: free (vg_replace_malloc.c:366)
==20639==    by 0x4087485: g_free (in /lib/libglib-2.0.so.0.2600.1)
==20639==    by 0x80553FE: free_pending (session.c:115)
==20639==    by 0x805543C: agent_free (session.c:127)
==20639==    by 0x80566A6: session_free (session.c:149)
==20639==    by 0x8056BCA: session_terminate_transfer (session.c:914)
==20639==    by 0x8056F61: session_prepare_put (session.c:1397)
==20639==    by 0x8056C74: session_request_reply (session.c:835)
==20639==    by 0x412F7E0: ??? (in /lib/libdbus-1.so.3.5.2)
==20639==    by 0x411D975: ??? (in /lib/libdbus-1.so.3.5.2)
==20639==    by 0x4120B81: dbus_connection_dispatch (in /lib/libdbus-1.so.3.5.2)
==20639==    by 0x804C27F: message_dispatch (mainloop.c:80)

To fix this agent->pending is now reset to NULL before calling the
callback, so even if the session is terminated it won't cause a free to
pending data, which is fine since it is latter freed on callback return.
2012-12-04 22:48:31 +01:00
Luiz Augusto von Dentz
972f88aa1c obexd: Make use of transfer->err to store transfer errors 2012-12-04 22:48:28 +01:00
Daniel Orstadius
fc5c121427 obexd: Fix process pending request if transfer canceled
If the call to the Request method of the obex client agent returns
with an error (for example if the transfer is rejected), call
function session_terminate_transfer instead of unregister_transfer
to both unregister the transfer and handle the pending request.
2012-12-04 22:48:28 +01:00
Luiz Augusto von Dentz
4a54d91c7d obexd: Fix possible NULL pointer deference
Variable "transfer" tracked as NULL was passed to function
"transfer_unregister" that dereferences it.
2012-12-04 22:48:27 +01:00
Luiz Augusto von Dentz
9fcc33bfb8 obexd: Fix not detecting errors on small files
Make use of gw_obex_xfer_close instead of gw_obex_xfer_flush since the
former not only flushes the remaining data but also wait for the response
catching errors that gw_obex_xfer_flush doesn't.
2012-12-04 22:48:27 +01:00
Luiz Augusto von Dentz
8702ac21b9 obexd: Fix not detecting errors when transferring the last part of the buffer
The last part has to be flushed in order to sent the remaining buffer as
a obex packet and detect possible errors.
2012-12-04 22:48:27 +01:00
Johan Hedberg
ca5d2090f6 obexd: Fix format string warnings for g_dbus_create_error
This patch fixes gcc warnings for "format not a string literal and no
format arguments".
2012-12-04 22:48:25 +01:00
Luiz Augusto von Dentz
1759d7153c obexd: Make sure errors are reported properly to applications
Error message were most of the time empty.

Thanks for Vitja Makarov <vitja.makarov@gmail.com> for reporting this.
2012-12-04 22:48:24 +01:00
Luiz Augusto von Dentz
27906878d9 obexd: Fix not closing socket when connection attempt fails
When connection attempt fails the socket were left opened as it is not
assigned to the session, also when the connection does succeed the socket
is closed twice when the session is removed.

To fix those issues session now holds a reference to the GIOChannel
returned bt bt_io_connect so that the connection can properly close when
releasing, in addiction to that it also is marked to not close the socket
when the connection succeeds so that when removing the session it doesn't
close the socket twice.

Thanks for Vitja Makarov <vitja.makarov@gmail.com> for reporting this.
2012-12-04 22:48:23 +01:00
Luiz Augusto von Dentz
bb30d00920 obexd: reuse code when reading buffered data
This should also improve speed since now file transfer also tries to read
all buffered data before continue, so each progress will probably be
around the MTU size rather than buffer size.
2012-12-04 22:48:23 +01:00
Luiz Augusto von Dentz
15130f0c06 obexd: fix not reading all buffered data 2012-12-04 22:48:23 +01:00
Luiz Augusto von Dentz
8a504f047d obexd: fix strerr option 2012-12-04 22:48:22 +01:00
Marcel Holtmann
cf7c506246 obexd: More cleanup for the logging code 2012-12-04 22:48:22 +01:00
Luiz Augusto von Dentz
dea41fe55c obexd: Fix security requirements for legacy devices (< 2.1)
Make use of security low so that services like opp do not request bonding
when connecting to legacy devices.
2012-12-04 22:48:22 +01:00
Luiz Augusto von Dentz
11c141b636 obexd: Make use of BtIO on obex-client 2012-12-04 22:48:21 +01:00
Luiz Augusto Von Dentz
537072e41d obexd: Fix transfer for empty name/mimetype specific 2012-12-04 22:48:21 +01:00
Luiz Augusto Von Dentz
0493343137 obexd: Fix not unregistering transfer when completed 2012-12-04 22:48:21 +01:00
Luiz Augusto Von Dentz
0dff3b37be obexd: Fix memory leak when freeing transfer parameters 2012-12-04 22:48:21 +01:00
Luiz Augusto Von Dentz
4e5782eb00 obexd: Fix crash on pbap client when message was already replied/freed 2012-12-04 22:48:21 +01:00
Luiz Augusto Von Dentz
757db74df7 obexd: Fix not replying error when transfer could not be started 2012-12-04 22:48:21 +01:00
Luiz Augusto Von Dentz
fc180e2f74 obexd: Replace uses of debug with DBG 2012-12-04 22:48:21 +01:00
Luiz Augusto von Dentz
97c6683e95 obexd: Add dynamic debug feature 2012-12-04 22:48:21 +01:00
Luiz Augusto von Dentz
6ba70b4e55 obexd: Fix possible memory leak 2012-12-04 22:48:21 +01:00
Vinicius Costa Gomes
e85450cc32 obexd: Fix PullBusinessCard ignoring the file argument
These five commits should solve the issue reported by Daniel Abraham
on the mailing list.
2012-12-04 22:48:16 +01:00
Vinicius Costa Gomes
15820b3ab5 obexd: Fix not passing filename for pull requests
Now we can store the received response somewhere.
2012-12-04 22:48:16 +01:00
Vinicius Costa Gomes
6b28669b92 obexd: Fix misuse of the listing callback
The listing callback was being used for anything that included a type
header.
2012-12-04 22:48:16 +01:00
Vinicius Costa Gomes
1a6def174f obexd: Fix sending the reply for pull requests too early
This reply was being sent too early and it was being sent on the complete
callback anyway. This was causing the sender to exit the bus too soon.
Which was causing the daemon to close the connection.
2012-12-04 22:48:16 +01:00
Luiz Augusto Von Dentz
b77a1769c2 obexd: Fix PullBusinessCard not return transfer errors 2012-12-04 22:48:12 +01:00
Luiz Augusto Von Dentz
408fb342d8 obexd: Fix RemoveSession argument to be object path instead of string 2012-12-04 22:48:12 +01:00
Luiz Augusto Von Dentz
9ce74b2d68 obexd: Move transfer implementation to its own file 2012-12-04 22:48:12 +01:00
Luiz Augusto Von Dentz
296e697160 obexd: Fix agent not being released after transfers complete
This requession was introduced by d57bffe46b71e17a640c11b389dd6da95f933729
that add another reference to the session for the agent.

To fix this a rework on refcount was done so that transfer now hold
references to the session and once done they release the references one
by one.
2012-12-04 22:48:12 +01:00
Luiz Augusto Von Dentz
170dcc96a5 obexd: Fix not releasing the watches when a session is freed 2012-12-04 22:48:11 +01:00
Luiz Augusto Von Dentz
b87eef8860 obexd: Fix sending packets before they are full
Packets should be full, expect the last piece, before they can be send to
achieve faster transfer speeds.
2012-12-04 22:48:08 +01:00
Vinicius Costa Gomes
be404857ea obexd: Fix file corruption during PUT
In some cases file corruption would occur, because the order of
the arguments to memmove was inverted.
2012-12-04 22:48:08 +01:00
Vinicius Costa Gomes
71f571dc65 obexd: the session is shutdown when the agent exits the bus 2012-12-04 22:48:08 +01:00
Vinicius Costa Gomes
b2b8fbbec2 obexd: Improve the error message when setting up the bus name 2012-12-04 22:48:08 +01:00
Vinicius Costa Gomes
7480d4761f obexd: Add support for using the logging infrastructure from obexd 2012-12-04 22:48:07 +01:00
Vinicius Costa Gomes
35d124c8b8 obexd: Fix handling of the response of the Request() method
The response was being ignored, now this will allow the agent to cancel
operations it doesn't want anymore and to change the name of the
object being sent.
2012-12-04 22:48:07 +01:00
Vinicius Costa Gomes
f4e714d814 obexd: Fix issue when opening the file fails during SendFiles
When this happens we must somehow inform the user that it has failed.
2012-12-04 22:48:07 +01:00
Marcel Holtmann
c081792026 obexd: Update Intel copyrights 2012-12-04 22:48:07 +01:00
Marcel Holtmann
4174e904a2 obexd: Update copyright information 2012-12-04 22:48:07 +01:00
Vinicius Costa Gomes
3b67aba1b3 obexd: Fix the types of session->size and session->transferred
These were represented as ssize_t which represent the maximum size
of the addressable memory, so they are 32bits in 32bit machines. We
were expecting them to be 64bits.
2012-12-04 22:48:06 +01:00
Claudio Takahasi
1b4bf20d6a obexd: Fixed SendFiles to use "Source" argument.
SendFiles was ignoring "Source" argument and using the default adapter
always.
2012-12-04 22:48:04 +01:00
Marcel Holtmann
6541461762 obexd: Fix handling of strict-aliasing rules 2012-12-04 22:48:04 +01:00
Luiz Augusto von Dentz
6a40f1133f obexd: Add Channel property.
Channel can be used to connect to specific channel without resolving target
record.
2012-12-04 22:48:04 +01:00
Vinicius Costa Gomes
83f47d59fc obexd: Fix the registration of the Transfer interface for FTP sessions
When the type of the transfer was NULL, which is the case for most
GET's, the Transfer interface was not registered.
2012-12-04 22:48:03 +01:00
Marcel Holtmann
ac08e32b2a obexd: Allow compilation with -Wsign-compare 2012-12-04 22:48:01 +01:00
Forrest Zhao
fba78dbad8 obexd: add support for Sync Putphonebook 2012-12-04 22:48:00 +01:00
Forrest Zhao
2077c66ccf obexd: add support for Sync Getphonebook 2012-12-04 22:48:00 +01:00
Marcel Holtmann
e356b2e9ff obexd: Fix compiler warning 2012-12-04 22:48:00 +01:00
Forrest Zhao
6a19f9408f obexd: add initial framework support for SYNC client 2012-12-04 22:48:00 +01:00
Forrest Zhao
ee7b55d29c obexd: use session_get_data(), session_set_data() to access 'priv' field of struct session_data 2012-12-04 22:48:00 +01:00
Forrest Zhao
5e9fcefe1a obexd: rename pbapdata in struct session_data to priv, so that it could be reused by Sync client 2012-12-04 22:48:00 +01:00
Marcel Holtmann
e8aa19fec7 obexd: Update copyright information 2012-12-04 22:48:00 +01:00
Luiz Augusto von Dentz
04235bf3f7 obexd: Introduce GetCapabilities support to client API. 2012-12-04 22:48:00 +01:00
Marcel Holtmann
2a776169f4 obexd: Return if function type is not provided 2012-12-04 22:48:00 +01:00
Raymond Liu
d184f1d0e1 obexd: Rename SetFilters/GetFilters/ListAllFilters to SetFilter/GetFilter/ListFilterFields 2012-12-04 22:47:59 +01:00
Raymond Liu
df080bdba5 obexd: Add SetFilters and remove AddFilter, RemoveFilter for PBAP client 2012-12-04 22:47:59 +01:00
Raymond Liu
ecd621b972 obexd: Bug fix on session_get, do not register transfer twice 2012-12-04 22:47:59 +01:00
Raymond Liu
99be1da31c obexd: Minor bug fix on Pull Search Function 2012-12-04 22:47:59 +01:00
Raymond Liu
3a1e6b3e8d obexd: Implement Filter related function for PBAP client 2012-12-04 22:47:59 +01:00
Raymond Liu
6172e3e51f obexd: Implement List and Search function for PBAP client 2012-12-04 22:47:59 +01:00
Raymond Liu
6497c0dd5c obexd: add Pull function for PBAP client 2012-12-04 22:47:59 +01:00
Raymond Liu
690e25c5a0 obexd: add GetSize function for PBAP client 2012-12-04 22:47:59 +01:00
Raymond Liu
ebd3eccc79 obexd: add PullAll function for PBAP client 2012-12-04 22:47:59 +01:00
Raymond Liu
bd34b83f81 obexd: Add SetFormat and SetOrder function for PBAP client 2012-12-04 22:47:59 +01:00
Raymond Liu
75d32c6b3a obexd: Implement Select function for PBAP Client 2012-12-04 22:47:59 +01:00
Raymond Liu
70f6779621 obexd: Export session_get and minior fix on get_xfer_listing_progess 2012-12-04 22:47:58 +01:00
Raymond Liu
331ea6fd14 obexd: Do not send NULL to g_str_equal for compare 2012-12-04 22:47:58 +01:00
Raymond Liu
258e3f73b0 obexd: Unregister service and session interfaces in session_unref 2012-12-04 22:47:58 +01:00
Marcel Holtmann
081dcc327d obexd: Fix PBAP interface registration 2012-12-04 22:47:57 +01:00
Raymond Liu
cf27f8d323 obexd: Add framework code for pbap client 2012-12-04 22:47:57 +01:00
Vinicius Costa Gomes
7eccdecbda obexd: Use the right types when appending the folder listing data 2012-12-04 22:47:57 +01:00
Vinicius Costa Gomes
0206932131 obexd: Sending a error message when some error occurs during folder listing 2012-12-04 22:47:56 +01:00
Vinicius Costa Gomes
ce64bca4cf obexd: Separate getting a folder listing from getting a file
As there are some special conditions involving a folder listing as
no object size, storing everything inside a buffer, this is better left
apart from the "normal" case.
2012-12-04 22:47:56 +01:00
Vinicius Costa Gomes
7bf74c35d9 obexd: Sends a final Progress message when the transfer is complete 2012-12-04 22:47:56 +01:00
Vinicius Costa Gomes
bec136fcac obexd: Adds support for dynamic buffers 2012-12-04 22:47:56 +01:00
Vinicius Costa Gomes
3570c2513e obexd: Checks for errors in write when receiving a object 2012-12-04 22:47:56 +01:00
Vinicius Costa Gomes
79c7ab0e3e obexd: Fixes the dbus signature of the folder listing method 2012-12-04 22:47:56 +01:00
Vinicius Costa Gomes
09364c9d3f obexd: Do not remove owner watch in the disconnect remove watch callback 2012-12-04 22:47:56 +01:00
Vinicius Costa Gomes
90bd741085 obexd: Separate Session and Transfer properties 2012-12-04 22:47:56 +01:00
Vinicius Costa Gomes
789fcf9ad3 obexd: Removes the owner disconnect watch when removing closing the session 2012-12-04 22:47:55 +01:00
Vinicius Costa Gomes
9929152403 obexd: Dealing with folder listings
When the object size is unknown ends the transfer as soon as the first
packet arrives.
2012-12-04 22:47:55 +01:00
Vinicius Costa Gomes
91b2a8d879 obexd: Do not try to send a error notification if the path is invalid 2012-12-04 22:47:55 +01:00
Vinicius Costa Gomes
cceb761559 obexd: Closes the session when the client leaves the bus 2012-12-04 22:47:55 +01:00
Vinicius Costa Gomes
2874ef9574 obexd: Adds Session Close method 2012-12-04 22:47:55 +01:00
Vinicius Costa Gomes
2632843b83 obexd: Check for allocation failure when sending messages to the agent 2012-12-04 22:47:55 +01:00
Vinicius Costa Gomes
0e00848363 obexd: A little simplification
Moving transfer termination (closing and freeing it)
inside unregister_tranfer, to avoid repeated code.
2012-12-04 22:47:55 +01:00
Vinicius Costa Gomes
cc219ecc36 obexd: Removes memory leaks when the transfer ends 2012-12-04 22:47:55 +01:00
Vinicius Costa Gomes
128371fa69 obexd: Implements CreateFolder 2012-12-04 22:47:55 +01:00
Vinicius Costa Gomes
fb567c8a20 obexd: Adds Error to Agent methods
We needed a way to inform the agent that some error happened
during a transfer.
2012-12-04 22:47:55 +01:00
Johan Hedberg
59f1b41543 obexd: Remove unecessary variable 2012-12-04 22:47:55 +01:00
Claudio Takahasi
d1356b6aac obexd: Ignore NULL sent in x-obex/folder-listing replies
Some broken implementations send send NULL at the ending
of the listing.
2012-12-04 22:47:55 +01:00
Claudio Takahasi
41f9926c59 obexd: Fixed segmentation fault: ListFolder doesn't register transfer path 2012-12-04 22:47:55 +01:00
Claudio Takahasi
8cd6bfd802 obexd: Added Delete method for Transfer interface 2012-12-04 22:47:55 +01:00