Hans Leidekker : inetcomm: Add an implementation of ISMTPTransport2:: CommandDATA.
Alexandre Julliard
julliard at winehq.org
Tue Nov 4 07:29:30 CST 2008
Module: wine
Branch: master
Commit: de8dd504d7c1c92c0102029c2c842c2d58025269
URL: http://source.winehq.org/git/wine.git/?a=commit;h=de8dd504d7c1c92c0102029c2c842c2d58025269
Author: Hans Leidekker <hans at codeweavers.com>
Date: Tue Nov 4 11:34:54 2008 +0100
inetcomm: Add an implementation of ISMTPTransport2::CommandDATA.
---
dlls/inetcomm/smtptransport.c | 42 +++++++++++++++++++++++++++++++++++++++-
1 files changed, 40 insertions(+), 2 deletions(-)
diff --git a/dlls/inetcomm/smtptransport.c b/dlls/inetcomm/smtptransport.c
index 9e0a278..d704525 100644
--- a/dlls/inetcomm/smtptransport.c
+++ b/dlls/inetcomm/smtptransport.c
@@ -123,6 +123,40 @@ static void SMTPTransport_CallbackReadResponseDoNothing(IInternetTransport *ifac
InternetTransport_ReadLine(&This->InetTransport, SMTPTransport_CallbackDoNothing);
}
+static void SMTPTransport_CallbackProcessDATAResponse(IInternetTransport *iface, char *pBuffer, int cbBuffer)
+{
+ SMTPTransport *This = (SMTPTransport *)iface;
+ SMTPRESPONSE response = { 0 };
+ HRESULT hr;
+
+ TRACE("\n");
+
+ hr = SMTPTransport_ParseResponse(This, pBuffer, &response);
+ if (FAILED(hr))
+ {
+ /* FIXME: handle error */
+ return;
+ }
+
+ response.command = SMTP_DATA;
+ ISMTPCallback_OnResponse((ISMTPCallback *)This->InetTransport.pCallback, &response);
+
+ if (FAILED(response.rIxpResult.hrServerError))
+ {
+ ERR("server error: %s\n", debugstr_a(pBuffer));
+ /* FIXME: handle error */
+ return;
+ }
+}
+
+static void SMTPTransport_CallbackReadDATAResponse(IInternetTransport *iface, char *pBuffer, int cbBuffer)
+{
+ SMTPTransport *This = (SMTPTransport *)iface;
+
+ TRACE("\n");
+ InternetTransport_ReadLine(&This->InetTransport, SMTPTransport_CallbackProcessDATAResponse);
+}
+
static void SMTPTransport_CallbackProcessMAILResponse(IInternetTransport *iface, char *pBuffer, int cbBuffer)
{
SMTPTransport *This = (SMTPTransport *)iface;
@@ -843,8 +877,12 @@ static HRESULT WINAPI SMTPTransport_CommandRSET(ISMTPTransport2 *iface)
static HRESULT WINAPI SMTPTransport_CommandDATA(ISMTPTransport2 *iface)
{
- FIXME("()\n");
- return E_NOTIMPL;
+ SMTPTransport *This = (SMTPTransport *)iface;
+
+ TRACE("()\n");
+
+ return InternetTransport_DoCommand(&This->InetTransport, "DATA\n",
+ SMTPTransport_CallbackReadDATAResponse);
}
static HRESULT WINAPI SMTPTransport_CommandDOT(ISMTPTransport2 *iface)
More information about the wine-cvs
mailing list