classpath-inetlib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Classpath-inetlib] Sending SMTP message gets stuck upon exception


From: Chris Burdess
Subject: Re: [Classpath-inetlib] Sending SMTP message gets stuck upon exception
Date: Sun, 25 Jan 2004 09:13:31 +0100

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Øyvind Harboe wrote:
If an exception is thrown while an SMTP message body is being written,
the subsequent "QUIT" command is ignored because it is considered part of the
message body by the SMTP server. This eventually causes the app to wait
indefinitely for the QUIT command to complete.

The patch attached is incomplete and is only intended for illustrative purposes.

// application level code
try
{
        transport.sendMessage(message, message.getAllRecipients());
}
finally
{
        // executes QUIT command , but will hang indefinitely if
        // SMPTTransport.java mimeMessage.writeTo() throws e.g. a
        // runtime exception.
        transport.close();
}

You cannot assume that you can safely call any method on the transport, including close(), after an I/O error. If you can provide a good reason why you think we /should/ be able to recover from such errors, let me know and I'll look into it. - -- Chris Burdess
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)

iD8DBQFAE3qv6dl1DEqHgrgRAhV6AJ91SCtzyoqGxFSSdHNi2BttfDpcaQCeIb2E
ax26ouuWP12ysMmRNZZwyOw=
=PdYG
-----END PGP SIGNATURE-----





reply via email to

[Prev in Thread] Current Thread [Next in Thread]