home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / mfc / internet / httpsvr / request.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-03-27  |  1.2 KB  |  62 lines

  1. // Request.cpp : implementation of the CRequest class
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1997-1998 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and related
  9. // electronic documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12.  
  13. #include "stdafx.h"
  14.  
  15. #include "HttpSvr.h"
  16. #include "Request.h"
  17.  
  18. #ifdef _DEBUG
  19. #define new DEBUG_NEW
  20. #undef THIS_FILE
  21. static char THIS_FILE[] = __FILE__;
  22. #endif
  23.  
  24. IMPLEMENT_DYNCREATE(CRequest, CObject)
  25.  
  26. CRequest::CRequest( void )
  27. {
  28.     m_nRefs = 1;
  29.     m_bDone = FALSE;
  30.     m_dwExecute = 0;
  31.     m_cbBody = 0;
  32.     m_dwAttr = 0;
  33.     m_uStatus = 0;
  34.     m_cbSent = 0;
  35.     m_timeReq = CTime::GetCurrentTime();
  36. }
  37.  
  38. CRequest::~CRequest( void )
  39. {
  40. }
  41.  
  42. CString CRequest::GetHeaderValue( CString strName )
  43. {
  44.     CString strValue;
  45.     strName.MakeLower();
  46.     m_mapHeaders.Lookup( strName, strValue );
  47.     return strValue;
  48. }
  49.  
  50. int CRequest::AddRef( void )
  51. {
  52.     return ++m_nRefs;
  53. }
  54.  
  55. int CRequest::Release( void )
  56. {
  57.     int nRefs = --m_nRefs;
  58.     if ( nRefs == 0 )
  59.         delete this;
  60.     return nRefs;
  61. }
  62.