summaryrefslogtreecommitdiff
path: root/client/session.c
Commit message (Collapse)AuthorAgeFilesLines
* client: Fix using org.openobex.ErrorLuiz Augusto von Dentz2012-06-111-5/+5
| | | | In addition use define so it is easier to change this in future
* client: Use session path as prefix for transfer pathLuiz Augusto von Dentz2012-06-071-2/+2
| | | | | This should make it easier to identify to which session the transfer belongs.
* client-api: Rename session interface to org.bluez.obex.SessionLuiz Augusto von Dentz2012-06-051-2/+2
| | | | The base is also changed to /org/bluez/obex to follow the new namespace
* client: Update copyright statementMikel Astiz2012-06-051-0/+1
|
* client: Remove obsolete authentication codeMikel Astiz2012-05-311-60/+26
| | | | | After the removal of the agent, the implementation of the session can be simplified by removing all authentication-related code.
* client: Remove internal transfer progress reportMikel Astiz2012-05-311-19/+6
| | | | | The new D-Bus API uses signals to report the progress updates, so the internal progress callback is not needed any more.
* client: Remove D-Bus agentMikel Astiz2012-05-311-216/+2
| | | | | | 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.
* client: Use transfer owner instead of agentMikel Astiz2012-05-311-7/+2
| | | | | 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.
* client: Add D-Bus helper libraryMikel Astiz2012-05-311-37/+5
| | | | No functionality changes. This is just about avoiding duplicated code.
* client: Move GetCapabilities to session APIMikel Astiz2012-05-231-0/+68
|
* Do not set signature and reply in GDBus tablesLucas De Marchi2012-05-181-3/+3
| | | | | Use GDBUS_* macros, so signature and reply fields are not set in each method/signal.
* Convert GDBus methods to use macro helpersLucas De Marchi2012-05-181-3/+9
| | | | | With these macro helpers we can separate in/out arguments and use their own vector.
* Constify GDBus method tablesMarcel Holtmann2012-05-171-1/+1
| | | | | | | Constify method tables with the following command: find . -name '*.[ch]' -exec \ sed -i 's/\(GDBusMethodTable .* =\)/const \1/g' {} \;
* client: Create transfers in modulesMikel Astiz2012-05-141-74/+12
| | | | | | | | 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.
* client: Flip parameter order in transfer APIMikel Astiz2012-05-141-2/+2
| | | | | This minor change makes the transfer API more consistent with the parameter-order used in the session API.
* client: Buffer-passing changes in transfer APIMikel Astiz2012-05-141-17/+6
| | | | | | 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.
* client: Transfer API splits create and registerMikel Astiz2012-05-141-18/+15
| | | | | | | | | 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.
* client: Remove transfer from queue before callbackMikel Astiz2012-05-031-11/+9
| | | | | | | | | | | 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.
* client: Remove deprecated part of session APIMikel Astiz2012-05-031-40/+0
| | | | | Once the modules are using the new callback style, the session API can be simplified and the old functions to access session->p removed.
* client: Give transfer pointer in session callbacksMikel Astiz2012-05-031-16/+18
| | | | | | | | | | 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.
* client: Minor buffer access API changesMikel Astiz2012-05-031-10/+7
| | | | | | | 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*
* client: Return request id when generating a request in session APILuiz Augusto von Dentz2012-04-261-14/+14
| | | | | This is more consistent with other functions and allow the caller to cancel the request using obc_session_cancel.
* client: Fix not propagating GError in session API functionsLuiz Augusto von Dentz2012-04-261-35/+46
| | | | | The errors should be properly forward to the caller and not just convert to generic error.
* client: open file during transfer creationLuiz Augusto von Dentz2012-04-241-25/+25
| | | | | | | | 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.
* client: transfers take gobex when startingMikel Astiz2012-04-241-13/+7
| | | | | 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.
* client: transfer api merges put and getMikel Astiz2012-04-241-46/+21
| | | | | | | | | | | | | 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.
* client: Remove buffer based transferLuiz Augusto von Dentz2012-04-241-17/+17
| | | | Simplify the code by using temporary files and eliminates reallocations.
* client: Fix regression when calling obc_session_shutdown within callbackLuiz Augusto von Dentz2012-04-161-1/+3
| | | | | | Commit c07ddfbd019d3545cce2d7ec694143cdc55a2167 introduced the freeing of the active pending request on obc_session_shutdown without checking if the request was already processed/terminated.
* client: Remove unused struct session_callbackSyam Sidhardhan2012-04-131-5/+0
|
* client: Fix memory leak during session connectSyam Sidhardhan2012-04-131-1/+4
|
* client: simplify obc_session_pullMikel Astiz2012-03-081-21/+1
| | | | | | | 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.
* client: refactor naming convention in session apiMikel Astiz2012-03-081-15/+14
| | | | | | | | | | 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
* client: fix naming convention in transfer apiMikel Astiz2012-03-081-6/+10
| | | | | | | | | | | | | | | | | 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.
* client: Remove unused public functionLuiz Augusto von Dentz2012-02-291-1/+1
| | | | obex_io_error_quark is only used in session.c so can be static
* client: free active transfer on session shutdownMikel Astiz2012-02-291-0/+8
| | | | | The currently active request should be canceled just like any other queued transfer. Otherwise obex timeout is reported.
* client: fix unreported canceled transfersMikel Astiz2012-02-291-1/+14
| | | | | A session can be shut down from D-Bus, and therefore the pending transfer callbacks must be reported.
* client: terminate queued transfers properlyMikel Astiz2012-02-271-4/+26
| | | | | | 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.
* client: expose obc_transfer_set_callbackMikel Astiz2012-02-261-2/+7
| | | | | This will allow setting the callback before the transfer is started, particularly to report queued transfer cancellations.
* client: process transfer queue only if none activeMikel Astiz2012-02-261-0/+3
| | | | | session_process_queue should make sure there is no active operation, to avoid starting a second one at the same time.
* client: fix obc_session_get_bufferMikel Astiz2012-02-261-1/+5
| | | | | Size 0 should be reported if no transfer exists. Some existing code relies on this behavior.
* client: fix unreported error caseMikel Astiz2012-02-171-1/+14
| | | | | | 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.
* client: fix memory leak in obc_session_putMikel Astiz2012-02-171-2/+6
| | | | | obc_session_put takes ownership of the given buffer, but did not free the memory in case of error.
* client: Add L2CAP support in bluetooth moduleLuiz Augusto von Dentz2012-02-141-1/+11
| | | | | This adds support for reading GoepL2capPsm attribute from sdp record and connect to it.
* client: remove gobex dependency of sessionLuiz Augusto von Dentz2012-02-081-5/+0
| | | | Modules should no longer need to access gobex directly
* client: introduce obc_session_cancelLuiz Augusto von Dentz2012-02-081-0/+21
|
* client: introduce obc_session_deleteLuiz Augusto von Dentz2012-02-081-0/+29
|
* client: introduce obc_session_moveLuiz Augusto von Dentz2012-02-081-0/+30
|
* client: introduce obc_session_copyLuiz Augusto von Dentz2012-02-081-0/+30
|
* client: introduce obc_session_mkdirLuiz Augusto von Dentz2012-02-081-0/+64
|
* client: introduce obc_session_setpathLuiz Augusto von Dentz2012-02-081-6/+144
|