diff options
author | Radoslaw Jablonski <ext-jablonski.radoslaw@nokia.com> | 2011-02-14 11:19:50 +0200 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2011-02-15 11:19:55 -0300 |
commit | ae6e7fe491c9d86682fbe379b967ab32cfbafb31 (patch) | |
tree | 3320a4651b8a8f79d1b49b2bf9ce2304b76439f5 /plugins/irmc.c | |
parent | 4170f13ece1f0218ad70ec2bc6c2536367eed922 (diff) | |
download | obexd-ae6e7fe491c9d86682fbe379b967ab32cfbafb31.tar.gz |
Introduction of phonebook_pull_read
Previosly reading from backend was initialized in phonebook_pull.
Now phonebook_pull should be used only for preparing request data
and phonebook_pull_read for 'real' reading vcards data from back-end.
The back-end can return data in one response or it can return data in
many parts. After obtaining one part, PBAP core need to call
phonebook_pull_read with the same request again to get more results.
Using that, PBAP core has control of its the buffer size - it can
ask for new parts of data when buffer is empty or when its size
will be lower than some level.
Diffstat (limited to 'plugins/irmc.c')
-rw-r--r-- | plugins/irmc.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/plugins/irmc.c b/plugins/irmc.c index e1e83f9..2cf673c 100644 --- a/plugins/irmc.c +++ b/plugins/irmc.c @@ -197,6 +197,7 @@ static void *irmc_connect(struct obex_session *os, int *err) { struct irmc_session *irmc; struct apparam_field *param; + int ret; DBG(""); @@ -224,6 +225,9 @@ static void *irmc_connect(struct obex_session *os, int *err) irmc->params = param; irmc->request = phonebook_pull("telecom/pb.vcf", irmc->params, phonebook_size_result, irmc, err); + ret = phonebook_pull_read(irmc->request); + if (err) + *err = ret; return irmc; } @@ -313,6 +317,13 @@ static void *irmc_open_pb(const char *name, struct irmc_session *irmc, DBG("phonebook_pull failed..."); goto fail; } + + ret = phonebook_pull_read(irmc->request); + if (ret < 0) { + DBG("phonebook_pull_read failed..."); + goto fail; + } + return irmc; } |