Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

CHttpRequest Class Reference

#include <HttpRequest.h>

List of all members.

Public Member Functions

 CHttpRequest ()
virtual ~CHttpRequest ()
void Clear ()
CString GetURL ()
BOOL SetURL (LPCTSTR pszURL)
void SetUserAgent (LPCTSTR pszUserAgent)
void AddHeader (LPCTSTR pszKey, LPCTSTR pszValue)
void SetPostData (LPCVOID pBody, DWORD nBody)
void LimitContentLength (DWORD nLimit)
void SetNotify (HWND hWnd, UINT nMsg, WPARAM wParam=0)
int GetStatusCode ()
BOOL GetStatusSuccess ()
CString GetStatusString ()
CString GetHeader (LPCTSTR pszName)
CString GetResponseString (UINT nCodePage=CP_UTF8)
CBufferGetResponseBuffer ()
BOOL InflateResponse ()
BOOL Execute (BOOL bBackground)
BOOL IsPending ()
BOOL IsFinished ()
void Cancel ()

Static Public Member Functions

static void CloseThread (HANDLE *phThread, LPCTSTR pszName)

Protected Member Functions

int Run ()
void RunRequest ()
void RunResponse (HINTERNET hURL)

Static Protected Member Functions

static UINT ThreadStart (LPVOID lpParameter)

Protected Attributes

CCriticalSection m_pSection
HANDLE m_hThread
HINTERNET m_hInternet
BOOL m_bCancel
CString m_sURL
CString m_sUserAgent
CString m_sRequestHeaders
DWORD m_nLimit
int m_nStatusCode
CString m_sStatusString
CBufferm_pPost
CBufferm_pResponse
CMapStringToString m_pResponseHeaders
HWND m_hNotifyWnd
UINT m_nNotifyMsg
WPARAM m_nNotifyParam


Constructor & Destructor Documentation

CHttpRequest::CHttpRequest  ) 
 

Definition at line 34 of file HttpRequest.cpp.

References m_hInternet, m_hNotifyWnd, m_hThread, m_nLimit, m_nStatusCode, m_pPost, m_pResponse, m_sUserAgent, NULL, Settings, and CSettings::SmartAgent().

CHttpRequest::~CHttpRequest  )  [virtual]
 

Definition at line 46 of file HttpRequest.cpp.

References Clear().


Member Function Documentation

void CHttpRequest::AddHeader LPCTSTR  pszKey,
LPCTSTR  pszValue
 

Definition at line 95 of file HttpRequest.cpp.

References IsPending(), m_pSection, and m_sRequestHeaders.

Referenced by CSearchDetailPanel::ExecuteRequest(), and CTorrentTrackerDlg::OnRun().

void CHttpRequest::Cancel  ) 
 

Definition at line 261 of file HttpRequest.cpp.

References m_bCancel, m_hInternet, m_hThread, m_pSection, and NULL.

Referenced by CSearchDetailPanel::CancelPreview(), Clear(), Execute(), CTorrentTrackerDlg::OnDestroy(), CTorrentTrackerDlg::OnTorrentRefresh(), and CVersionChecker::Stop().

void CHttpRequest::Clear  ) 
 

Definition at line 54 of file HttpRequest.cpp.

References Cancel(), m_nLimit, m_nStatusCode, m_pPost, m_pResponse, m_pResponseHeaders, m_pSection, m_sRequestHeaders, m_sStatusString, m_sURL, and NULL.

Referenced by CSearchDetailPanel::ExecuteRequest(), CTorrentTrackerDlg::OnRun(), CVersionChecker::Start(), and ~CHttpRequest().

void CHttpRequest::CloseThread HANDLE *  phThread,
LPCTSTR  pszName
[static]
 

Definition at line 413 of file HttpRequest.cpp.

References CShareazaApp::Message(), MSG_DEBUG, NULL, and theApp.

Referenced by CTorrentTrackerDlg::OnDestroy(), CTorrentSeedDlg::OnDestroy(), CTorrentTrackerDlg::OnTimer(), CTorrentTrackerDlg::OnTorrentRefresh(), CBTClients::ShutdownRequests(), and CVersionChecker::Stop().

BOOL CHttpRequest::Execute BOOL  bBackground  ) 
 

Definition at line 224 of file HttpRequest.cpp.

References Cancel(), IsPending(), m_bCancel, m_hThread, m_nStatusCode, m_pPost, m_pResponse, m_pResponseHeaders, m_sURL, NULL, Run(), and ThreadStart().

Referenced by CSearchDetailPanel::ExecuteRequest(), CTorrentTrackerDlg::OnRun(), CBTTrackerRequest::Run(), and CVersionChecker::UndertakeRequest().

CString CHttpRequest::GetHeader LPCTSTR  pszName  ) 
 

Definition at line 165 of file HttpRequest.cpp.

References IsPending(), m_pResponseHeaders, and m_pSection.

Referenced by CSearchDetailPanel::ExecuteRequest(), and InflateResponse().

CBuffer * CHttpRequest::GetResponseBuffer  ) 
 

Definition at line 193 of file HttpRequest.cpp.

References IsPending(), m_pResponse, m_pSection, and NULL.

Referenced by CSearchDetailPanel::ExecuteRequest(), CTorrentTrackerDlg::OnRun(), and CBTTrackerRequest::Process().

CString CHttpRequest::GetResponseString UINT  nCodePage = CP_UTF8  ) 
 

Definition at line 180 of file HttpRequest.cpp.

References IsPending(), CBuffer::m_nLength, m_pResponse, m_pSection, NULL, and CBuffer::ReadString().

Referenced by CVersionChecker::UndertakeRequest().

int CHttpRequest::GetStatusCode  ) 
 

Definition at line 146 of file HttpRequest.cpp.

References IsPending(), m_nStatusCode, and m_pSection.

Referenced by CSearchDetailPanel::ExecuteRequest(), and CVersionChecker::UndertakeRequest().

CString CHttpRequest::GetStatusString  ) 
 

Definition at line 159 of file HttpRequest.cpp.

References m_pSection, and m_sStatusString.

BOOL CHttpRequest::GetStatusSuccess  ) 
 

Definition at line 152 of file HttpRequest.cpp.

References IsPending(), m_nStatusCode, and m_pSection.

Referenced by CSearchDetailPanel::ExecuteRequest().

CString CHttpRequest::GetURL  ) 
 

Definition at line 88 of file HttpRequest.cpp.

References m_pSection, and m_sURL.

BOOL CHttpRequest::InflateResponse  ) 
 

Definition at line 200 of file HttpRequest.cpp.

References GetHeader(), CBuffer::Inflate(), IsPending(), m_pResponse, m_pSection, NULL, and CBuffer::Ungzip().

Referenced by CTorrentTrackerDlg::OnRun(), and CBTTrackerRequest::Process().

BOOL CHttpRequest::IsFinished  ) 
 

Definition at line 256 of file HttpRequest.cpp.

References m_hInternet, m_nStatusCode, and NULL.

BOOL CHttpRequest::IsPending  ) 
 

Definition at line 251 of file HttpRequest.cpp.

References m_hInternet, and NULL.

Referenced by AddHeader(), Execute(), GetHeader(), GetResponseBuffer(), GetResponseString(), GetStatusCode(), GetStatusSuccess(), InflateResponse(), LimitContentLength(), SetPostData(), SetURL(), and SetUserAgent().

void CHttpRequest::LimitContentLength DWORD  nLimit  ) 
 

Definition at line 128 of file HttpRequest.cpp.

References IsPending(), m_nLimit, and m_pSection.

Referenced by CSearchDetailPanel::ExecuteRequest().

int CHttpRequest::Run  )  [protected]
 

Definition at line 305 of file HttpRequest.cpp.

References m_bCancel, m_hInternet, m_hNotifyWnd, m_nNotifyMsg, m_nNotifyParam, m_nStatusCode, m_pSection, m_sUserAgent, NULL, and RunRequest().

Referenced by Execute(), and ThreadStart().

void CHttpRequest::RunRequest  )  [protected]
 

Definition at line 334 of file HttpRequest.cpp.

References m_hInternet, m_sRequestHeaders, m_sURL, NULL, and RunResponse().

Referenced by Run().

void CHttpRequest::RunResponse HINTERNET  hURL  )  [protected]
 

Definition at line 347 of file HttpRequest.cpp.

References CBuffer::EnsureBuffer(), m_bCancel, CBuffer::m_nLength, m_nLimit, m_nStatusCode, CBuffer::m_pBuffer, m_pResponse, m_pResponseHeaders, m_sStatusString, and NULL.

Referenced by RunRequest().

void CHttpRequest::SetNotify HWND  hWnd,
UINT  nMsg,
WPARAM  wParam = 0
 

Definition at line 135 of file HttpRequest.cpp.

References m_hNotifyWnd, m_nNotifyMsg, m_nNotifyParam, and m_pSection.

void CHttpRequest::SetPostData LPCVOID  pBody,
DWORD  nBody
 

Definition at line 106 of file HttpRequest.cpp.

References CBuffer::Add(), IsPending(), m_pPost, m_pSection, and NULL.

BOOL CHttpRequest::SetURL LPCTSTR  pszURL  ) 
 

Definition at line 79 of file HttpRequest.cpp.

References IsPending(), m_pSection, m_sURL, and NULL.

Referenced by CSearchDetailPanel::ExecuteRequest(), CTorrentTrackerDlg::OnRun(), and CVersionChecker::UndertakeRequest().

void CHttpRequest::SetUserAgent LPCTSTR  pszUserAgent  ) 
 

Definition at line 121 of file HttpRequest.cpp.

References IsPending(), m_pSection, and m_sUserAgent.

UINT CHttpRequest::ThreadStart LPVOID  lpParameter  )  [static, protected]
 

Definition at line 299 of file HttpRequest.cpp.

References Run().

Referenced by Execute().


Member Data Documentation

BOOL CHttpRequest::m_bCancel [protected]
 

Definition at line 64 of file HttpRequest.h.

Referenced by Cancel(), Execute(), Run(), and RunResponse().

HINTERNET CHttpRequest::m_hInternet [protected]
 

Definition at line 63 of file HttpRequest.h.

Referenced by Cancel(), CHttpRequest(), IsFinished(), IsPending(), Run(), and RunRequest().

HWND CHttpRequest::m_hNotifyWnd [protected]
 

Definition at line 76 of file HttpRequest.h.

Referenced by CHttpRequest(), Run(), and SetNotify().

HANDLE CHttpRequest::m_hThread [protected]
 

Definition at line 62 of file HttpRequest.h.

Referenced by Cancel(), CHttpRequest(), and Execute().

DWORD CHttpRequest::m_nLimit [protected]
 

Definition at line 69 of file HttpRequest.h.

Referenced by CHttpRequest(), Clear(), LimitContentLength(), and RunResponse().

UINT CHttpRequest::m_nNotifyMsg [protected]
 

Definition at line 77 of file HttpRequest.h.

Referenced by Run(), and SetNotify().

WPARAM CHttpRequest::m_nNotifyParam [protected]
 

Definition at line 78 of file HttpRequest.h.

Referenced by Run(), and SetNotify().

int CHttpRequest::m_nStatusCode [protected]
 

Definition at line 70 of file HttpRequest.h.

Referenced by CHttpRequest(), Clear(), Execute(), GetStatusCode(), GetStatusSuccess(), IsFinished(), Run(), and RunResponse().

CBuffer* CHttpRequest::m_pPost [protected]
 

Definition at line 72 of file HttpRequest.h.

Referenced by CHttpRequest(), Clear(), Execute(), and SetPostData().

CBuffer* CHttpRequest::m_pResponse [protected]
 

Definition at line 73 of file HttpRequest.h.

Referenced by CHttpRequest(), Clear(), Execute(), GetResponseBuffer(), GetResponseString(), InflateResponse(), and RunResponse().

CMapStringToString CHttpRequest::m_pResponseHeaders [protected]
 

Definition at line 74 of file HttpRequest.h.

Referenced by Clear(), Execute(), GetHeader(), and RunResponse().

CCriticalSection CHttpRequest::m_pSection [protected]
 

Definition at line 61 of file HttpRequest.h.

Referenced by AddHeader(), Cancel(), Clear(), GetHeader(), GetResponseBuffer(), GetResponseString(), GetStatusCode(), GetStatusString(), GetStatusSuccess(), GetURL(), InflateResponse(), LimitContentLength(), Run(), SetNotify(), SetPostData(), SetURL(), and SetUserAgent().

CString CHttpRequest::m_sRequestHeaders [protected]
 

Definition at line 68 of file HttpRequest.h.

Referenced by AddHeader(), Clear(), and RunRequest().

CString CHttpRequest::m_sStatusString [protected]
 

Definition at line 71 of file HttpRequest.h.

Referenced by Clear(), GetStatusString(), and RunResponse().

CString CHttpRequest::m_sURL [protected]
 

Definition at line 66 of file HttpRequest.h.

Referenced by Clear(), Execute(), GetURL(), RunRequest(), and SetURL().

CString CHttpRequest::m_sUserAgent [protected]
 

Definition at line 67 of file HttpRequest.h.

Referenced by CHttpRequest(), Run(), and SetUserAgent().


The documentation for this class was generated from the following files:
Generated on Thu Dec 15 10:40:08 2005 for Shareaza 2.2.1.0 by  doxygen 1.4.2