Re: Feature request

DINH Viet Hoa <[email protected]>
Newsgroups gmane.mail.libetpan.user
Message-ID <etPan.405a2b93.59b08fa1.c05@homer>
Rajko Albrecht wrote :

> But - what about a callback like the progress callback? eg., 
> 
> just like calling a 
> void progress(int,int) 
> a 
> void cancel_me(int*a)
> 
> when set?
> 
> if there the *a=1 is set the it means, that etpan should break communication 
> with the mailserver.
> 
> What about this idea?

cancellation is a difficult problem. My final idea is to use what I made 
in etpan, ie to integrate what I did for that in the library. That mean 
that threads will be run inside the library work. My idea is to avoid 
breaking connection even if the user cancelled an operation. For that,
I wait until the user finish his connection, then I just ignore the 
response. If threads are allowed on PDA, maybe you should do that (this 
will of course introduce other problems such as concurrency).

If you really want to break the connection because you don't want to 
wait for the end of the operation, the other dirty thing to do is to 
find the file descriptor of the stream (there is probably something such 
as mailstream_get_fd) and just close it, this will result in the end of 
the call, returning with an error code.

> Did I miss anything in documentation, I could not see how to setup this 
> progress callback for eg a pop3_storage :( eg. I can make of course a 
> pop3_mailstorage_init and mailstorage_connect and so on. But I didn't see 
> something, how to setup the callback. Should I do that direct via assignment 
> trough the data variables?

progress callback is an out of date API but this should still work
with many things. Then, you won't find any way to do this using
storage interface. You have to access by hand the low-level interface.

-- 
DINH V. Hoa,

etPan! - newsreader, mail user agent -- http://libetpan.sf.net/etpan
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQBAWi177w+pfAWHa3MRAlgQAJ9rSEjcVFaa1lSnNUyc9ZqaDbuFfgCeNhpg
T3fiKI0KJXDiNceSxlQwPiw=
=k300
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.