| 7e7ab3e0 |
obexd: Fix for handling emails in pull call history queries
Previously only emails of one type at a time were listed
in call history for given contact. With this fix every
email for contact will be displayed in pull call history
result. |
Radoslaw Jablonski |
13 years ago |
1 file, +69, -30 |
| 1e73e0a7 |
obexd: Fix for handling addresses in pull call history queries
Previously only addresses of one type (by example only HOME addresses)
were listed. Now every address for contacts will be included in call
history results. |
Radoslaw Jablonski |
13 years ago |
1 file, +58, -26 |
| b021c1d4 |
obexd: Remove unnecessary "?_key" variable in call history queries
This "?_key" variable need to be filled only in pull phonebook
queries(for sorting results). In call history queries it is
unnecessary. |
Radoslaw Jablonski |
13 years ago |
1 file, +0, -10 |
| d51596d8 |
obexd: Simplify add numbers/emails/addresses logic in PBAP
There were 3 different functions for doing the same -- checking if some
field is already added. Now using only function named "find_field" for
that purpose. |
Radoslaw Jablonski |
13 years ago |
1 file, +8, -38 |
| 457e4f51 |
obexd: Remove unused columns in PBAP queries
Application for filling contact's data does not use
"contact:" for attaching email, phones, and addresses
without context. This fix removes columns for getting
mentioned data from "contact:" context - they are no
longer needed (all phone, email and addresses are now
fetched from "affilation" structures). |
Radoslaw Jablonski |
13 years ago |
1 file, +18, -166 |
| 13f5796a |
obexd: Remove unnecessary ordering from single vCard query
Previously ordering for query called CONTACTS_QUERY_FROM_URI was applied.
It is not needed since always only one vCard (with id specified)
is fetched. |
Rafal Michalski |
13 years ago |
1 file, +3, -6 |
| 41f45780 |
obexd: Fix for handling fax and cell phone numbers in PBAP
Application which stores contacts data in database has been
optimized - fax and cell phones are now stored in "affilation"
structures for better performance. So queries used in
phonebook-tracker need to be changed to handle this properly.
Without that cell and fax phone numbers are not listed in pull
phonebook results. |
Radoslaw Jablonski |
13 years ago |
1 file, +29, -32 |
| c7d7d477 |
obexd: Fix phonebook size issue
Previously, when only empty default owner vCard was available, phonebook
default size equal to 1 was received and it was always counted when
phonebook size requested. This patch makes that it is equal to 0 as it
should be and it is not counted anymore when phonebook size requested. |
Rafal Michalski |
13 years ago |
1 file, +1, -2 |
| 368bec15 |
obexd: unused and unnecessary code removed
destroy function is not used anymore and therefore removed pending_reply.
obj->request = NULL is removed from vobject_close as unnecessary. |
Dmitriy Paliy |
13 years ago |
2 files, +6, -16 |
| f82b81e0 |
obexd: New NewMissedCalls added for phonebook_pull.
NewMissedCalls is added to MCH phone book pull function for tracker
back-end (see PBAP specification pp.25,41). A new query is added to
phonebook-tracker.c result of which is at most 40 sorted by time and
date phone numbers from missed calls history with read/not read flags.
New missed calls are acquired from the list locally. This query is
submitted always first in order to have data for the first OBEX packet
(see PBAP specification p.33).
Canceling of pending D-Bus call was changed to conform introduced
modifications. More specifically, phonebook_pull, phonebook_get_entry,
phonebook_create_cache functions return pointer to phonebook_data
structure that holds D-Bus pending call instead of pointer to the call.
phonebook_data memory deallocation is moved to finalize function. This
data is not freed after each query since two successive queries may be
carried out and this structure holds pointer to the corresponding requests.
pbap.c and obex.c are updated to add NewMissedCalls application parameter
to first response OBEX packet. It is done only in the case when number of
new missed calls is larger than 0. Therefore, other than tracker phone
book back-ends are not affected.
mimetype.h, filesystem.c, irmc.c, nokia-backup.c, syncevolution.c are
updated to return flag parameter. OBEX_FL_FIT_ONE_PACKET flag is set only
for PBAP if number of new missed calls larger than 0 when pulling
phone book.
write_offset field is added to struct obex_session in obex-priv.h. It
holds write offset for TX OBEX packet and cannot be larger than tx_mtu.
It is used in obex.c when writing to a stream packets that may contain
headers of different types marked with OBEX_FL_FIT_ONE_PACKET flag. |
Dmitriy Paliy |
13 years ago |
9 files, +223, -48 |
| 7f669ccf |
obexd: Merge phonebook_data and cache_data
phonebook_data and cache_data are merged in phonebook-tracker.c.
Single structure is used in successive patches to keep reference
to pending D-Bus call. |
Dmitriy Paliy |
13 years ago |
1 file, +13, -19 |
| 6558f82d |
obexd: tracker-query update for addr fields
This is needed to display many addresses of the same type
(WORK/HOME/OTHER) in different rows in pbap pull response.
Currently in that case all addresses of the same type
were displayed in the same row. |
Radoslaw Jablonski |
13 years ago |
1 file, +6, -6 |
| ce3d4bf8 |
obexd: Further optimalization of PBAP tracker queries
Now emails, addresses and telephone numbers of the same type
(work/home/other) are concatenated into sigle strings - this
gains huge difference in speed of queries when there are a lot
of contacts in database. Also changed functions for splitting
these fields on our backend side. |
Radoslaw Jablonski |
13 years ago |
1 file, +711, -530 |
| 3b05d5ea |
obexd: Add handing of backend pending request
Add phonebook_req_finalize function prototype in phonebook.h that
deallocates resources associated to asynchronous request, and
cancels the request if it is not completed. It unrefs pointer to
pending request if such is applicable.
It does the following, depending on phonebook backend:
- for phonebook-tracker.c backend driver, it cancels pending DBus call,
- for phonebook-dummy.c, it removes GSource with a given id,
- for phonebook-ebook.c, it cancels last, still running, asynchronous
operation.
The following modifcations are donein the code. Phonebook request
pointer is added in PBAP object and IRMC session data to provide
reference for pending call. Phonebook callbacks are updated in PBAP
and IRMC to unref request upon completion and clear pointers, if such
is applicable.
PBAP and IRMC are updated to cancel pending request, if any, when OBEX
object is closed.
Phonebook_pull, phonebook_get_entry, phonebook_create_cache functions
are updated to return void pointer to backend specific request and error
code. All backend drivers updated accordingly to the modified API, which
are phonebook-tracker.c, phonebook-dummy.c, and phonebook-ebook.c, to be
specific.
In phonebook-tracker.c, query_tracker is updated to return pending DBus
call request. Allocated pending_reply and phonebook_data are destroyed
after call is unrefed. For this purpose new query_free_data function is
created.
Call is unrefed either if request succeeded or in
phonebook_req_finalize if terminated.
Such fix prevents obexd crash on unexpected OBEX session close. E.g.,
OBEX session is closed before reply comes from phonebook backend. In
that case, both session and object are destroyed, and dereferencing of
object in associated callback function causes crash. |
Dmitriy Paliy |
13 years ago |
6 files, +310, -96 |
| c852bd29 |
obexd: Unified ebook data structures
Query data structures are unified in phonebook-ebook.c to have a
unique identifier for ebook async operation. Purpose of this
modification is next commit where pending async operation can be
cancelled. |
Dmitriy Paliy |
13 years ago |
1 file, +16, -20 |
| 156374a0 |
obexd: Change obex_service_driver put() signature
This API change is needed for implementing Message Access Profile, as
MAP uses application parameters in puts also (for example
SetMessageStatus function, see MAP specification, chapter 5.7) and in
order to access application parameters headers, access to obex object
is required. |
Slawomir Bochenski |
13 years ago |
5 files, +9, -5 |
| 1c55bb34 |
obexd: long, empty lines, indentation
Lines longer 80 symbols and empty lines removed. Indentation in
generate_response function corrected. |
Dmitriy Paliy |
13 years ago |
1 file, +8, -9 |
| 932949fe |
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. |
Luiz Augusto von Dentz |
13 years ago |
4 files, +14, -11 |
| 8abc6c72 |
obexd: Add aparams to pbap_object in pbap.c
aparams is added to pbap_object to handle application parameters
header separately from body header when assembling OBEX packet.
This modification is used in successive patch where headers of
different types can be added to a single OBEX packet.
append_aparam_header and array_read functions are created as a result
of such modification. |
Dmitriy Paliy |
13 years ago |
1 file, +56, -24 |
| 2dca9e43 |
obexd: Fix regression causing crash in 3-way calling
Fix obexd crash in 3-way calling scenario. Crash happens when there
is redialed second incoming call. Cache for the PBAP session is
already created at that moment, but PBAP object is destroyed. Crash
happens when object is dereferenced in vobject_list_open.
Therefore, PBAP object has to be created before any attempt to write
cached data to buffer associated to this object.
However, cache_ready_notify function, which is invoked in
vobject_vcard_open for valid cache case, sends also PBAP object data
via callback function to obex.c and written to OBEX stream as GET
response in handle_async_io handler function.
A new response is sent to OBEX stream after cache_ready_notify exists
to vobject_list_open function, which is callback function for
obex_mime_type_driver. Such leads to undefined befavior. Therefore,
cache_ready_notify is splitted in two cache_ready_notify and
generate_response functions.
generate_response fills data to buffer and returns error, if any,
while cache_ready_notify notifies OBEX core to write this data to
stream.
In order to avoid writing to stream twice, cache_ready_notify is
replaced by generate_response in vobject_list_open. As a result,
PBAP buffer data is generated from existing cache and sent to
stream upon start of OBEX stream after vobject_list_open exits. |
Dmitriy Paliy |
13 years ago |
1 file, +54, -44 |
| 127fe7b3 |
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. |
Luiz Augusto von Dentz |
13 years ago |
4 files, +6, -6 |
| 22d757b9 |
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. |
Luiz Augusto von Dentz |
13 years ago |
1 file, +2, -1 |
| 894363ba |
obexd: Optimize tracker queries for PBAP
Now data from tracker is fetched without redundand fields. Also
determining which type has phone, address and email (work or home) is
done in backend code - no tracker sub-query is used for that case. Now
queries are about 6 times faster for any amount of data( call history
queries, which were heavy loaded with OPTIONAL sub-queries are even 10
times faster than before) |
Radoslaw Jablonski |
13 years ago |
1 file, +166, -348 |
| d57b8fa9 |
obexd: Fix problem with fetching 0.vcf vCard entry
Previously after attempting to get single 0.vcf vCard entry from phonebook
("telecom/pb/0.vcf") "Not Found" status was received and this entry wasn't
downloaded. Now "OK" status is received and valid 0.vcf vCard entry is
downloaded. |
Rafal Michalski |
13 years ago |
1 file, +1, -1 |
| c7b2f7ab |
obexd: Fix fetching contact photo file name
Previously photo id was fetched. File name may be further converted to
binary data (actual image) if such behavior would be desired in the future. |
Bartosz Szatkowski |
13 years ago |
1 file, +54, -6 |
| 4aef1e35 |
obexd: Fix queries for contact with only one affiliation
Previously some fields may be omitted for contacts with only one
affiliation, when querying for call history. |
Bartosz Szatkowski |
13 years ago |
1 file, +54, -29 |
| c1faa669 |
obexd: Using field names instead of numbers in PBAP
Previously addressing via field numbers and field names were mixed in PBAP
query replies. Now there is defined name for each data base reply field. |
Bartosz Szatkowski |
13 years ago |
1 file, +77, -27 |
| a8eb063b |
obexd: Fix pull phonebook with non-zero offset parameter
For non-zero liststartoffset parameter, contacts which index was before
offset were indexed more than once (e.g. when contact had more than one
phone number or address etc.), so pulling was started earlier - before
offset index was reached. This patch fix this problem and each contact
is indexed only once. |
Rafal Michalski |
13 years ago |
1 file, +8, -1 |
| 4ace40ce |
obexd: Make string_free private to filesystem plugin
string_free is a callback function specific to filesystem plugin only.
It is used by OBEX drivers when closing OBEX object and not API
exposed to other plugins. g_string_free can be used instead of it when
required. |
Dmitriy Paliy |
13 years ago |
2 files, +1, -2 |
| a963d4fe |
obexd: Split up object and session in pbap.c
Object and session data is separated in PBAP plugin. Reason is that
when OBEX session firstly makes disconnect of service_data, which
corresponds to session in pbap.c, it than closes object, which also
corresponds to session in pbap.c.
Memory is deallocated after PBAP session is disconnected. When OBEX
driver closes the object, it is trying to dereference the deallocated
memory in order to free pbap->buffer data.
Here object and session are separated, while pointers are created to
make one-to-one mapping. pbap_object is created in vobject_..._open
functions after query to tracker submitted. Session and object are
handled separately when freed. |
Dmitriy Paliy |
13 years ago |
1 file, +59, -35 |
| 0c2ddc0d |
obexd: Code clean up: cache->folder removed
cache->folder is not used anywhere and therefore removed. |
Dmitriy Paliy |
13 years ago |
1 file, +0, -2 |
| a527425f |
obexd: Use g_string_free instead of string_free in IRMC
g_string_free instead of string_free shall be used in IRMC plugin.
string_free is a callback function specific to filesystem plugin
only and used by OBEX drivers to close an OBEX object. |
Dmitriy Paliy |
13 years ago |
1 file, +4, -6 |
| 0802456c |
obexd: Split pull_contacts to smaller functions
Parts of pull_contact responsible for filling contact fields moved
to new functions. |
Bartosz Szatkowski |
13 years ago |
1 file, +109, -67 |
| e5e3a222 |
obexd: Code clean up: pbap->params = params removed
pbap->params = params; removed due to the fact that this assignment is
already used in the same function. |
Dmitriy Paliy |
13 years ago |
1 file, +0, -1 |
| fd20b489 |
obexd: Fix proper type handling in contact_query_from_uri
Previously all phone numbers, addresses and emails was considered to be "work".
Now there are three working types for emails and addresses: "work", "home",
"other" and four for phone numbers - these three as well as "cell". |
Bartosz Szatkowski |
13 years ago |
1 file, +26, -12 |
| 9b814bfb |
obexd: Fix proper type handling in combined_calls_query
Previously all phone numbers, addresses and emails was considered to be "work".
Now there are three working types for emails and addresses: "work", "home",
"other" and four for phone numbers - these three as well as "cell". |
Bartosz Szatkowski |
13 years ago |
1 file, +119, -33 |
| bed65642 |
obexd: Fix proper type handling in outgoing_calls_query
Previously all phone numbers, addresses and emails was considered to be "work".
Now there are three working types for emails and addresses: "work", "home",
"other" and four for phone numbers - these three as well as "cell". |
Bartosz Szatkowski |
13 years ago |
1 file, +65, -20 |
| 9f93fc82 |
obexd: Fix proper type handling in incoming_calls_query
Previously all phone numbers, addresses and emails was considered to be "work".
Now there are three working types for emails and addresses: "work", "home",
"other" and four for phone numbers - these three as well as "cell". |
Bartosz Szatkowski |
13 years ago |
1 file, +64, -19 |
| 78a12708 |
obexd: Changed number of fields selected via pbap queries
After fixing type handling in PBAP, there are more fields selected in each
query, contacts_other_query_from_uri needed to be adjusted. |
Bartosz Szatkowski |
13 years ago |
1 file, +1, -0 |
| 19207509 |
obexd: Fix proper type handling in missed_calls_query
Previously all phone numbers, addresses and emails was considered to be "work".
Now there are three working types for emails and addresses: "work", "home",
"other" and four for phone numbers - these three as well as "cell". |
Bartosz Szatkowski |
13 years ago |
1 file, +65, -19 |
| aad247a4 |
obexd: Fix proper type handling in contacts_query_all
Previously all phone numbers, addresses and emails was considered to be "work".
Now there are three working types for emails and addresses: "work", "home",
"other" and four for phone numbers - these three as well as "cell". |
Bartosz Szatkowski |
13 years ago |
1 file, +44, -17 |
| a3ee4929 |
obexd: Fix pull phonebook reply if filter not set
According to the PBAP specification if filter is not set or is set to
0x00000000 in the application parameters header all attributes of the vCard
should be returned. Previously only mandatory attributes were returned in
phonebook pull reply. This patch fix this and now all currently supported
vCards attributes will be returned. |
Lukasz Pawlik |
13 years ago |
1 file, +8, -2 |
| b58862b2 |
obexd: Fix folder listing not able to use name header to list sub folders |
Luiz Augusto von Dentz |
13 years ago |
1 file, +0, -3 |
| 21e6214c |
obexd: Fix various coding style issues in phonebook-tracker code |
Johan Hedberg |
13 years ago |
1 file, +21, -26 |
| 65e2e085 |
obexd: Fix handling nco affiliation fields
Previously when contact record was divided into separate replies,
phonebook-tracker would use first reply and merge only phone numbers,
addresses and emails from next. Now it's merging all fields dependent on
the nco:hasAffiliation as well. |
Lukasz Pawlik |
13 years ago |
1 file, +17, -0 |
| b2652ad7 |
obexd: Remove redundant code in phonebook module
Some extra code is redundant and not needed anymore. It is an effect
of call history queries optimization. |
Rafal Michalski |
13 years ago |
1 file, +2, -16 |
| a093dead |
obexd: Optimize call history queries
This patch optimizes call history queries - now there is no redundant
results of invoking them. |
Rafal Michalski |
13 years ago |
1 file, +35, -39 |
| 0c00430f |
obexd: Add separate queries for listing size in PBAP
Previosly to get phonebook-size or call history size, full phonebook
query was used and a lot of unnecessary operations need to be done on
that returned data. Now separate query is used to get size of each
listing so performance for "getPhonebookSize" operations improved a lot. |
Radoslaw Jablonski |
13 years ago |
1 file, +103, -2 |
| 6bc7e010 |
obexd: Provide extra query for vCard single call
This patch makes that additional circumstance is recognized - after
making a call with number that is out of phonebook it can be downloaded
as a single vCard containing number with OTHER type. |
Rafal Michalski |
13 years ago |
1 file, +17, -2 |
| 05993688 |
obexd: Fix history listing queries in phonebook-tracker
Now we are able to display contact's name in vcard-listing when
contact has entry in phonebook available. |
Radoslaw Jablonski |
13 years ago |
1 file, +118, -22 |