70 lines
2.0 KiB
C++
70 lines
2.0 KiB
C++
#ifndef _YPROXY_YPROXYTHREAD_HPP_
|
|
#define _YPROXY_YPROXYTHREAD_HPP_
|
|
#ifndef _SOCKET_SOCKET_HPP_
|
|
#include <socket/socket.hpp>
|
|
#endif
|
|
#ifndef _THREAD_MESSAGETHREAD_HPP_
|
|
#include <thread/mthread.hpp>
|
|
#endif
|
|
#ifndef _THREAD_EVENT_HPP_
|
|
#include <thread/event.hpp>
|
|
#endif
|
|
#ifndef _THREAD_THREADCALLBACK_HPP_
|
|
#include <thread/tcallbck.hpp>
|
|
#endif
|
|
#ifndef _NNTP_NNTPCLIENT_HPP_
|
|
#include <nntp/nntp.hpp>
|
|
#endif
|
|
|
|
class YProxyThread : private MessageThread
|
|
{
|
|
public:
|
|
YProxyThread();
|
|
virtual ~YProxyThread();
|
|
bool accept(Socket &socketControl,const String &host,const String &user,const String &password);
|
|
protected:
|
|
virtual void consoleMessage(const String &message);
|
|
virtual bool stringHandler(const String &string);
|
|
virtual void message(String message);
|
|
virtual void message(Block<String> &message);
|
|
private:
|
|
enum{AcceptMessage};
|
|
DWORD threadHandler(ThreadMessage &threadMessage);
|
|
void thAccept(ThreadMessage &threadMessage);
|
|
void sendConnectResponse(void);
|
|
void handleModeReader(const String &string);
|
|
void handleArticle(const String &string);
|
|
void handleBody(const String &string);
|
|
void handleGroup(const String &string);
|
|
void handleHead(const String &string);
|
|
void handleHelp(const String &string);
|
|
void handleIHave(const String &string);
|
|
void handleLast(const String &string);
|
|
void handleList(const String &string);
|
|
void handleNewGroups(const String &string);
|
|
void handleNewNews(const String &string);
|
|
void handleNext(const String &string);
|
|
void handlePost(const String &string);
|
|
void handleQuit(const String &string);
|
|
void handleSlave(const String &string);
|
|
void handleStat(const String &string);
|
|
void handleListGroup(const String &string);
|
|
void handleAuthInfoUser(const String &string);
|
|
void handleAuthInfoPass(const String &string);
|
|
void handleXOver(const String &string);
|
|
bool isDebug(void)const;
|
|
|
|
ThreadCallback<YProxyThread> mThreadHandler;
|
|
Socket mSocketControl;
|
|
Event mAcceptEvent;
|
|
String mThreadName;
|
|
NNTPClient mNNTPClient;
|
|
bool mIsDebug;
|
|
};
|
|
|
|
inline
|
|
bool YProxyThread::isDebug(void)const
|
|
{
|
|
return mIsDebug;
|
|
}
|
|
#endif |