void POP3ClientConnection::EnqueueWrite_(const String &sData) { LogPOP3String_(sData, true); EnqueueWrite(sData + "\r\n"); }
bool POP3ClientConnection::ParseFirstBinary_(std::shared_ptr<ByteBuffer> pBuf) { // Locate the first line const char *pText = pBuf->GetCharBuffer(); const char *pEndOfLine = StringParser::Search(pText, pBuf->GetSize(), "\r\n"); if (!pEndOfLine) { // Wait for more data return false; } // Skip passed the end of the line pEndOfLine += 2; size_t iLineLength = pEndOfLine - pText; // Copy the first line from the binary buffer. AnsiString sLine; sLine.append(pText, iLineLength); LogPOP3String_(sLine, false); ParseRETRResponse_(sLine); size_t iRemaining = pBuf->GetSize() - iLineLength; pBuf->Empty(iRemaining); return true; }
bool POP3ClientConnection::InternalParseData(const String &sRequest) { // This code is temporary home of ETRN client settings in GUI // It checks External Account for ETRN domain.com for name // and if found uses that info to perform ETRN client connections String sAccountName = account_->GetName(); if (sAccountName.StartsWith(_T("ETRN"))) { HandleEtrn_(sRequest, sAccountName); return true; } else { // No sense in indenting code below inward as this is temp // and it'd just have to be moved back. // **** Don't miss } below when removing the above code! **** LogPOP3String_(sRequest, false); bool bRetVal = true; switch (current_state_) { case StateConnected: ParseStateConnected_(sRequest); return true; case StateCAPASent: ParseStateCAPASent_(sRequest); return true; case StateSTLSSent: return ParseStateSTLSSent_(sRequest); case StateUsernameSent: ParseUsernameSent_(sRequest); return true; case StatePasswordSent: ParsePasswordSent_(sRequest); return true; case StateUIDLRequestSent: ParseUIDLResponse_(sRequest); return true; case StateQUITSent: return ParseQuitResponse_(sRequest); case StateDELESent: ParseDELEResponse_(sRequest); return true; } // This will be removed too when ETRN code is moved } return true; }