22#define NONAMELESSUNION
68 WARN(
"parse error\n");
94 if (
This->type == POP3CMD_GET_POPID)
98 while (*
p ==
' ')
p++;
99 sscanf(
p,
"%u", &uidl->dwPopId);
102 while (*
p ==
' ')
p++;
114 if (
This->response[0] ==
'.' && !
This->response[1])
123 while (*
p ==
' ')
p++;
130 WARN(
"parse error\n");
141 stat->cbMessages = 0;
147 while (*
p ==
' ')
p++;
155 WARN(
"parse error\n");
170 if (
This->type == POP3CMD_GET_POPID)
174 while (*
p ==
' ')
p++;
185 if (
This->response[0] ==
'.' && !
This->response[1])
194 while (*
p ==
' ')
p++;
201 WARN(
"parse error\n");
217 WARN(
"parse error\n");
228 retr->fHeader =
FALSE;
230 retr->dwPopId =
This->msgid;
232 retr->pszLines =
This->response;
243 if (
This->response[0] ==
'.' && !
This->response[1])
245 retr->cbLines = retr->cbSoFar;
249 retr->fHeader =
TRUE;
250 if (!
This->response[0]) retr->fBody =
TRUE;
253 retr->cbSoFar +=
len;
254 retr->pszLines =
This->response;
262 WARN(
"parse error\n");
276 top->cPreviewLines =
This->preview_lines;
278 top->pszLines =
This->response;
289 if (
This->response[0] ==
'.' && !
This->response[1])
291 top->cbLines =
top->cbSoFar;
300 top->pszLines =
This->response;
308 WARN(
"parse error\n");
326 This->response = pszResponse;
332 switch (
This->command)
345 pResponse->command =
This->command;
347 pResponse->fValidInfo =
This->valid_info;
348 pResponse->rIxpResult.hrResult =
hr;
349 pResponse->rIxpResult.pszResponse = pszResponse;
350 pResponse->rIxpResult.uiServerError = 0;
351 pResponse->rIxpResult.hrServerError = pResponse->rIxpResult.hrResult;
353 pResponse->rIxpResult.pszProblem =
NULL;
356 if (
This->InetTransport.pCallback &&
This->InetTransport.fCommandLogging)
358 ITransportCallback_OnCommand(
This->InetTransport.pCallback, CMD_RESP,
359 pResponse->rIxpResult.pszResponse, pResponse->rIxpResult.hrServerError,
368 POP3RESPONSE response;
380 IPOP3Callback_OnResponse((
IPOP3Callback *)
This->InetTransport.pCallback, &response);
394 POP3RESPONSE response;
406 IPOP3Callback_OnResponse((
IPOP3Callback *)
This->InetTransport.pCallback, &response);
420 POP3RESPONSE response;
432 IPOP3Callback_OnResponse((
IPOP3Callback *)
This->InetTransport.pCallback, &response);
446 POP3RESPONSE response;
458 IPOP3Callback_OnResponse((
IPOP3Callback *)
This->InetTransport.pCallback, &response);
466 IPOP3Callback_OnResponse((
IPOP3Callback *)
This->InetTransport.pCallback, &response);
480 POP3RESPONSE response;
492 IPOP3Callback_OnResponse((
IPOP3Callback *)
This->InetTransport.pCallback, &response);
500 IPOP3Callback_OnResponse((
IPOP3Callback *)
This->InetTransport.pCallback, &response);
514 POP3RESPONSE response;
526 IPOP3Callback_OnResponse((
IPOP3Callback *)
This->InetTransport.pCallback, &response);
534 IPOP3Callback_OnResponse((
IPOP3Callback *)
This->InetTransport.pCallback, &response);
548 POP3RESPONSE response;
560 IPOP3Callback_OnResponse((
IPOP3Callback *)
This->InetTransport.pCallback, &response);
568 IPOP3Callback_OnResponse((
IPOP3Callback *)
This->InetTransport.pCallback, &response);
582 POP3RESPONSE response;
594 IPOP3Callback_OnResponse((
IPOP3Callback *)
This->InetTransport.pCallback, &response);
608 POP3RESPONSE response;
623 IPOP3Callback_OnResponse((
IPOP3Callback *)
This->InetTransport.pCallback, &response);
636 static const char pass[] =
"PASS ";
638 POP3RESPONSE response;
652 IPOP3Callback_OnResponse((
IPOP3Callback *)
This->InetTransport.pCallback, &response);
677 static const char user[] =
"USER ";
698 POP3RESPONSE response;
710 IPOP3Callback_OnResponse((
IPOP3Callback *)
This->InetTransport.pCallback, &response);
731 IPOP3Transport_AddRef(iface);
754 if (
This->InetTransport.pCallback) ITransportCallback_Release(
This->InetTransport.pCallback);
765 TRACE(
"(%p)\n", pInetServer);
777 FIXME(
"(%u)\n", isstate);
786 TRACE(
"(%p, %p)\n", pAccount, pInetServer);
791 LPINETSERVER pInetServer,
boolean fAuthenticate,
boolean fCommandLogging)
796 TRACE(
"(%p, %s, %s)\n", pInetServer, fAuthenticate ?
"TRUE" :
"FALSE", fCommandLogging ?
"TRUE" :
"FALSE");
817 return IPOP3Transport_CommandQUIT(iface);
848 FIXME(
"not using log file of %s, use Wine debug logging instead\n",
853 This->InetTransport.fInitialised =
TRUE;
859 DWORD dwPopId,
boolean fMarked)
861 FIXME(
"(%u, %u, %d)\n", marktype, dwPopId, fMarked);
867 FIXME(
"(%s)\n", pszAuthType);
873 static const char user[] =
"USER ";
896 static const char pass[] =
"PASS ";
920 static const char list[] =
"LIST %u\r\n";
921 static char list_all[] =
"LIST\r\n";
926 TRACE(
"(%u, %u)\n", cmdtype, dwPopId);
937 This->type = cmdtype;
947 static const char top[] =
"TOP %u %u\r\n";
952 TRACE(
"(%u, %u, %u)\n", cmdtype, dwPopId, cPreviewLines);
954 len =
sizeof(
top) + 20 + 2;
958 This->preview_lines = cPreviewLines;
960 This->type = cmdtype;
969 static const char command[] =
"QUIT\r\n";
982 static const char stat[] =
"STAT\r\n";
994 static const char noop[] =
"NOOP\r\n";
1006 static const char rset[] =
"RSET\r\n";
1019 static const char uidl[] =
"UIDL %u\r\n";
1020 static char uidl_all[] =
"UIDL\r\n";
1025 TRACE(
"(%u, %u)\n", cmdtype, dwPopId);
1029 len =
sizeof(uidl) + 10 + 2;
1036 This->type = cmdtype;
1046 static const char dele[] =
"DELE %u\r\n";
1051 TRACE(
"(%u, %u)\n", cmdtype, dwPopId);
1053 len =
sizeof(dele) + 10 + 2;
1058 This->type = cmdtype;
1068 static const char retr[] =
"RETR %u\r\n";
1073 TRACE(
"(%u, %u)\n", cmdtype, dwPopId);
1075 len =
sizeof(retr) + 10 + 2;
1080 This->type = cmdtype;
1134 IPOP3Transport_AddRef(*ppTransport);
1146 IClassFactory_AddRef(iface);
1179 hr = IPOP3Transport_QueryInterface(pPop3Transport,
riid,
ppv);
1180 IPOP3Transport_Release(pPop3Transport);
1187 FIXME(
"(%d)\n",fLock);
char * strcat(char *DstString, const char *SrcString)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
ACPI_SIZE strlen(const char *String)
char * strcpy(char *DstString, const char *SrcString)
char * strchr(const char *String, int ch)
#define InterlockedIncrement
#define InterlockedDecrement
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
void user(int argc, const char *argv[])
const GUID IID_IClassFactory
static __inline const char * debugstr_an(const char *s, int n)
#define HeapFree(x, y, z)
static void *static void *static LPDIRECTPLAY IUnknown * pUnk
FxPnpStateCallbackInfo * pCallback
GLdouble GLdouble GLdouble GLdouble top
enum tagIXPSTATUS IXPSTATUS
_Check_return_ _CRTIMP int __cdecl sscanf(_In_z_ const char *_Src, _In_z_ _Scanf_format_string_ const char *_Format,...)
HRESULT InternetTransport_InetServerFromAccount(InternetTransport *This, IImnAccount *pAccount, LPINETSERVER pInetServer) DECLSPEC_HIDDEN
HRESULT InternetTransport_DropConnection(InternetTransport *This) DECLSPEC_HIDDEN
HRESULT InternetTransport_DoCommand(InternetTransport *This, LPCSTR pszCommand, INETXPORT_COMPLETION_FUNCTION fnCompletion) DECLSPEC_HIDDEN
HRESULT InternetTransport_GetServerInfo(InternetTransport *This, LPINETSERVER pInetServer) DECLSPEC_HIDDEN
HRESULT InternetTransport_GetStatus(InternetTransport *This, IXPSTATUS *pCurrentStatus) DECLSPEC_HIDDEN
HRESULT InternetTransport_ReadLine(InternetTransport *This, INETXPORT_COMPLETION_FUNCTION fnCompletion) DECLSPEC_HIDDEN
HRESULT InternetTransport_Init(InternetTransport *This) DECLSPEC_HIDDEN
HRESULT InternetTransport_HandsOffCallback(InternetTransport *This) DECLSPEC_HIDDEN
HRESULT InternetTransport_Connect(InternetTransport *This, LPINETSERVER pInetServer, boolean fAuthenticate, boolean fCommandLogging) DECLSPEC_HIDDEN
HRESULT InternetTransport_ChangeStatus(InternetTransport *This, IXPSTATUS Status) DECLSPEC_HIDDEN
#define sprintf(buf, format,...)
static void init_parser(POP3Transport *This, POP3COMMAND command)
static void POP3Transport_CallbackRecvQUITResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)
static void POP3Transport_CallbackProcessUIDLResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)
static void POP3Transport_CallbackProcessQUITResponse(IInternetTransport *iface, char *pBuffer, int cbBuffer)
static HRESULT WINAPI POP3Transport_CommandUIDL(IPOP3Transport *iface, POP3CMDTYPE cmdtype, DWORD dwPopId)
static HRESULT parse_dele_response(POP3Transport *This, DWORD *dwPopId)
static ULONG WINAPI POP3Transport_Release(IPOP3Transport *iface)
static HRESULT WINAPI POP3Transport_QueryInterface(IPOP3Transport *iface, REFIID riid, void **ppv)
static const IPOP3TransportVtbl POP3TransportVtbl
static void POP3Transport_CallbackRecvRETRResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)
static HRESULT parse_uidl_response(POP3Transport *This, POP3UIDL *uidl)
static ULONG WINAPI POP3TransportCF_AddRef(LPCLASSFACTORY iface)
HRESULT WINAPI CreatePOP3Transport(IPOP3Transport **ppTransport)
static HRESULT WINAPI POP3Transport_CommandQUIT(IPOP3Transport *iface)
static void POP3Transport_CallbackRecvDELEResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)
static HRESULT WINAPI POP3Transport_MarkItem(IPOP3Transport *iface, POP3MARKTYPE marktype, DWORD dwPopId, boolean fMarked)
static void POP3Transport_CallbackRecvPASSResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)
static HRESULT POP3Transport_ParseResponse(POP3Transport *This, char *pszResponse, POP3RESPONSE *pResponse)
static HRESULT WINAPI POP3Transport_CommandPASS(IPOP3Transport *iface, LPSTR password)
static HRESULT WINAPI POP3Transport_DropConnection(IPOP3Transport *iface)
static void POP3Transport_CallbackProcessDELEResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)
static HRESULT parse_top_response(POP3Transport *This, POP3TOP *top)
static void POP3Transport_CallbackProcessNOOPResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)
static void POP3Transport_CallbackSendUSERCmd(IInternetTransport *iface, char *pBuffer, int cbBuffer)
static void POP3Transport_CallbackRecvRSETResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)
static HRESULT WINAPI POP3Transport_CommandAUTH(IPOP3Transport *iface, LPSTR pszAuthType)
static HRESULT WINAPI POP3TransportCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pUnk, REFIID riid, LPVOID *ppv)
static void POP3Transport_CallbackRecvUIDLResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)
static HRESULT WINAPI POP3Transport_InitNew(IPOP3Transport *iface, LPSTR pszLogFilePath, IPOP3Callback *pCallback)
static void POP3Transport_CallbackProcessTOPResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)
static HRESULT WINAPI POP3Transport_Disconnect(IPOP3Transport *iface)
static HRESULT parse_retr_response(POP3Transport *This, POP3RETR *retr)
static HRESULT WINAPI POP3Transport_HandsOffCallback(IPOP3Transport *iface)
static HRESULT parse_list_response(POP3Transport *This, POP3LIST *list)
static HRESULT WINAPI POP3Transport_InetServerFromAccount(IPOP3Transport *iface, IImnAccount *pAccount, LPINETSERVER pInetServer)
static HRESULT WINAPI POP3Transport_GetServerInfo(IPOP3Transport *iface, LPINETSERVER pInetServer)
static void POP3Transport_CallbackRecvUSERResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)
static HRESULT WINAPI POP3TransportCF_LockServer(LPCLASSFACTORY iface, BOOL fLock)
static HRESULT WINAPI POP3Transport_IsState(IPOP3Transport *iface, IXPISSTATE isstate)
static ULONG WINAPI POP3TransportCF_Release(LPCLASSFACTORY iface)
HRESULT POP3TransportCF_Create(REFIID riid, LPVOID *ppv)
static void POP3Transport_CallbackProcessSTATResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)
static HRESULT WINAPI POP3TransportCF_QueryInterface(LPCLASSFACTORY iface, REFIID riid, LPVOID *ppv)
static void POP3Transport_CallbackRecvTOPResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)
static HRESULT WINAPI POP3Transport_CommandTOP(IPOP3Transport *iface, POP3CMDTYPE cmdtype, DWORD dwPopId, DWORD cPreviewLines)
static HRESULT parse_response(POP3Transport *This)
static void POP3Transport_CallbackProcessRSETResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)
static HRESULT WINAPI POP3Transport_CommandRSET(IPOP3Transport *iface)
static HRESULT WINAPI POP3Transport_CommandNOOP(IPOP3Transport *iface)
static void POP3Transport_CallbackProcessPASSResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)
static ULONG WINAPI POP3Transport_AddRef(IPOP3Transport *iface)
static HRESULT WINAPI POP3Transport_Connect(IPOP3Transport *iface, LPINETSERVER pInetServer, boolean fAuthenticate, boolean fCommandLogging)
static HRESULT WINAPI POP3Transport_CommandDELE(IPOP3Transport *iface, POP3CMDTYPE cmdtype, DWORD dwPopId)
static IXPTYPE WINAPI POP3Transport_GetIXPType(IPOP3Transport *iface)
static void POP3Transport_CallbackRecvLISTResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)
static const IClassFactoryVtbl * POP3TransportCF
static HRESULT WINAPI POP3Transport_CommandRETR(IPOP3Transport *iface, POP3CMDTYPE cmdtype, DWORD dwPopId)
static void POP3Transport_CallbackProcessRETRResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)
static HRESULT WINAPI POP3Transport_CommandUSER(IPOP3Transport *iface, LPSTR username)
static void POP3Transport_CallbackRecvSTATResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)
static void POP3Transport_CallbackProcessUSERResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)
static const IClassFactoryVtbl POP3TransportCFVtbl
static void POP3Transport_CallbackRecvNOOPResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)
static HRESULT WINAPI POP3Transport_CommandLIST(IPOP3Transport *iface, POP3CMDTYPE cmdtype, DWORD dwPopId)
static HRESULT WINAPI POP3Transport_GetStatus(IPOP3Transport *iface, IXPSTATUS *pCurrentStatus)
static HRESULT WINAPI POP3Transport_CommandSTAT(IPOP3Transport *iface)
static HRESULT parse_stat_response(POP3Transport *This, POP3STAT *stat)
static void POP3Transport_CallbackProcessLISTResp(IInternetTransport *iface, char *pBuffer, int cbBuffer)
#define IsEqualIID(riid1, riid2)
InternetTransport InetTransport
#define CLASS_E_NOAGGREGATION
int PASCAL FAR WSAGetLastError(void)