smtp_ref_ostream (CamelSmtpTransport *transport)
{
	CamelStream *stream;

	g_return_val_if_fail (CAMEL_IS_SMTP_TRANSPORT (transport), NULL);

	g_mutex_lock (&transport->stream_lock);

	if (transport->ostream)
		stream = g_object_ref (transport->ostream);
	else
		stream = NULL;

	g_mutex_unlock (&transport->stream_lock);

	return stream;
}
smtp_ref_ostream (CamelSmtpTransport *transport)
{
	CamelStream *stream;

	g_return_val_if_fail (CAMEL_IS_SMTP_TRANSPORT (transport), NULL);

	g_mutex_lock (&transport->stream_lock);

	if (transport->ostream)
		stream = g_object_ref (transport->ostream);
	else
		stream = NULL;

	g_mutex_unlock (&transport->stream_lock);

	return stream;
}