Rob Shearman : inetcomm: Add an implementation of ISMTPTransport2:: CommandQUIT.
Alexandre Julliard
julliard at winehq.org
Fri Oct 31 09:24:20 CDT 2008
Module: wine
Branch: master
Commit: fe56d3195feda1e961cdaaf4043196bc9cb386f9
URL: http://source.winehq.org/git/wine.git/?a=commit;h=fe56d3195feda1e961cdaaf4043196bc9cb386f9
Author: Rob Shearman <rob at codeweavers.com>
Date: Fri Oct 31 13:50:23 2008 +0100
inetcomm: Add an implementation of ISMTPTransport2::CommandQUIT.
---
dlls/inetcomm/smtptransport.c | 40 ++++++++++++++++++++++++++++++++++++----
1 files changed, 36 insertions(+), 4 deletions(-)
diff --git a/dlls/inetcomm/smtptransport.c b/dlls/inetcomm/smtptransport.c
index d7a3c30..c32321e 100644
--- a/dlls/inetcomm/smtptransport.c
+++ b/dlls/inetcomm/smtptransport.c
@@ -212,6 +212,33 @@ static void SMTPTransport_CallbackSendHello(IInternetTransport *iface, char *pBu
HeapFree(GetProcessHeap(), 0, pszCommand);
}
+static void SMTPTransport_CallbackDisconnect(IInternetTransport *iface, char *pBuffer, int cbBuffer)
+{
+ SMTPTransport *This = (SMTPTransport *)iface;
+ SMTPRESPONSE response;
+ HRESULT hr;
+
+ TRACE("\n");
+
+ if (pBuffer)
+ {
+ hr = SMTPTransport_ParseResponse(This, pBuffer, &response);
+ if (FAILED(hr))
+ {
+ /* FIXME: handle error */
+ return;
+ }
+
+ if (FAILED(response.rIxpResult.hrServerError))
+ {
+ ERR("server error: %s\n", debugstr_a(pBuffer));
+ /* FIXME: handle error */
+ return;
+ }
+ }
+ InternetTransport_DropConnection(&This->InetTransport);
+}
+
static void SMTPTransport_CallbackMessageProcessResponse(IInternetTransport *iface, char *pBuffer, int cbBuffer)
{
SMTPTransport *This = (SMTPTransport *)iface;
@@ -473,8 +500,8 @@ static HRESULT WINAPI SMTPTransport_HandsOffCallback(ISMTPTransport2 *iface)
static HRESULT WINAPI SMTPTransport_Disconnect(ISMTPTransport2 *iface)
{
- FIXME("()\n");
- return E_NOTIMPL;
+ TRACE("()\n");
+ return ISMTPTransport2_CommandQUIT(iface);
}
static HRESULT WINAPI SMTPTransport_DropConnection(ISMTPTransport2 *iface)
@@ -613,8 +640,13 @@ static HRESULT WINAPI SMTPTransport_CommandAUTH(ISMTPTransport2 *iface,
static HRESULT WINAPI SMTPTransport_CommandQUIT(ISMTPTransport2 *iface)
{
- FIXME("()\n");
- return E_NOTIMPL;
+ SMTPTransport *This = (SMTPTransport *)iface;
+
+ TRACE("()\n");
+
+ InternetTransport_ChangeStatus(&This->InetTransport, IXP_DISCONNECTING);
+ return InternetTransport_DoCommand(&This->InetTransport, "QUIT\n",
+ SMTPTransport_CallbackDisconnect);
}
static HRESULT WINAPI SMTPTransport_CommandRSET(ISMTPTransport2 *iface)
More information about the wine-cvs
mailing list