Re: stop reading long message problem

DINH Viet Hoa <[email protected]> Wed, 22 Mar 2006 00:55:52 +0100
Newsgroups gmane.mail.libetpan.user
Message-ID <etPan.44209288.496e3857.3048@utopia>
Marko Ivancic wrote :

> Is there any way to stop fetching a message from another thread.
> ( ex. when reading with mailmessage_fetch(..) and
> the internet connection is to slow)
> 
> I  could use fork() to create a process that fetches the message and than
> kill this process when the users wants, but it's there mybe an easier way ?
> I tried closing the mailstream but the code segfaults :)

you cannot close the mailstream from an other thread.
That implies concurrent access that is not predictable (1).
What you could do is to silently ignore the result of the fetch,
that's what most of mail user agent do.
That's not a clever way to communicate with the server to close the 
connection without notifying the server first (2).

fork() and kill the process solves the problem for (1) but not for (2).

-- 
DINH V. Hoa,

"Ma tuxitude me beastifie" -- sunZ
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQBEIJPk7w+pfAWHa3MRAvvnAJ92c4z107M0+ZCsJOQwdt50s2AingCfZzPi
T/2gTYxTYMeP8+LJEaKsmi8=
=CqMz
-----END PGP SIGNATURE-----