diff --git a/src/session_p.h b/src/session_p.h index 0edf3e8..d1deabd 100644 --- a/src/session_p.h +++ b/src/session_p.h @@ -1,105 +1,105 @@ /* Copyright 2010 BetterInbox Author: Gregory Schlomoff This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef KSMTP_SESSION_P_H #define KSMTP_SESSION_P_H #include "session.h" #include #include #include #include #include class KJob; class QEventLoop; namespace KSmtp { class Job; class SessionThread; class ServerResponse; class KSMTP_EXPORT SessionPrivate : public QObject { Q_OBJECT friend class Session; public: explicit SessionPrivate(Session *session); ~SessionPrivate() override; void addJob(Job *job); void sendData(const QByteArray &data); void setState(Session::State s); void startSsl(QSsl::SslProtocol version); QSsl::SslProtocol negotiatedEncryption() const; public Q_SLOTS: void handleSslError(const KSslErrorUiData &data); void socketDisconnected(); void encryptionNegotiationResult(bool encrypted, QSsl::SslProtocol version); - void responseReceived(const KSmtp::ServerResponse &response); + void responseReceived(const ServerResponse &response); void socketConnected(); void setAuthenticationMethods(const QList &authMethods); private Q_SLOTS: void doStartNext(); void jobDone(KJob *job); void jobDestroyed(QObject *job); void onSocketTimeout(); private: void startHandshake(); void startNext(); void startSocketTimer(); void stopSocketTimer(); void restartSocketTimer(); Session *const q; // Smtp session Session::State m_state; SessionThread *m_thread = nullptr; SessionUiProxy::Ptr m_uiProxy; int m_socketTimerInterval = 0; QTimer m_socketTimer; QEventLoop *m_startLoop = nullptr; QSsl::SslProtocol m_sslVersion; // Jobs bool m_jobRunning = false; Job *m_currentJob = nullptr; QQueue m_queue; // Smtp info bool m_ehloRejected = false; int m_size = 0; bool m_allowsTls = false; QStringList m_authModes; QString m_customHostname; }; } #endif //KSMTP_SESSION_P_H diff --git a/src/sessionthread_p.h b/src/sessionthread_p.h index 0724754..852d694 100644 --- a/src/sessionthread_p.h +++ b/src/sessionthread_p.h @@ -1,86 +1,86 @@ /* Copyright 2010 BetterInbox Author: Christophe Laveault Gregory Schlomoff This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef KSMTP_SESSIONTHREAD_P_H #define KSMTP_SESSIONTHREAD_P_H #include #include #include #include #include class QFile; namespace KSmtp { class ServerResponse; class Session; class SessionThread : public QThread { Q_OBJECT public: explicit SessionThread(const QString &hostName, quint16 port, Session *session); ~SessionThread() override; Q_REQUIRED_RESULT QString hostName() const; Q_REQUIRED_RESULT quint16 port() const; void setUseNetworkProxy(bool useProxy); void handleSslErrorResponse(bool ignoreError); public Q_SLOTS: void reconnect(); void closeSocket(); void startSsl(QSsl::SslProtocol version); void sendData(const QByteArray &payload); Q_SIGNALS: void encryptionNegotiationResult(bool encrypted, QSsl::SslProtocol protocol); - void responseReceived(const KSmtp::ServerResponse &response); + void responseReceived(const ServerResponse &response); void sslError(const KSslErrorUiData &); protected: void run() override; private Q_SLOTS: void sslConnected(); void writeDataQueue(); void readResponse(); void doCloseSocket(); void doHandleSslErrorResponse(bool ignoreError); private: ServerResponse parseResponse(const QByteArray &response); std::unique_ptr m_socket; QMutex m_mutex; QQueue m_dataQueue; std::unique_ptr m_logFile; Session *m_parentSession = nullptr; QString m_hostName; quint16 m_port; bool m_useProxy; }; } #endif // KSMTP_SESSIONTHREAD_H