|
1 // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef __REDIRECT_H__ |
|
17 #define __REDIRECT_H__ |
|
18 |
|
19 #include <http/mhttpfilter.h> |
|
20 #include <http/rhttpsession.h> |
|
21 #include <http/cecomfilter.h> |
|
22 #include "timerlogger.h" |
|
23 |
|
24 class CDelimitedPath8; |
|
25 class CDelimitedQuery8; |
|
26 |
|
27 //##ModelId=3B1E52A00353 |
|
28 class CRedirectFilter : public CEComFilter, public MHTTPFilter |
|
29 { |
|
30 public: |
|
31 static CEComFilter* InstallFilterL(TAny* aSession); |
|
32 |
|
33 //##ModelId=3B1E52A0039D |
|
34 ~CRedirectFilter(); |
|
35 |
|
36 public: // Methods from MHTTPFilterBase |
|
37 |
|
38 // @see MHTTPFilterBase::MHFRunL |
|
39 //##ModelId=3B1E52A0039A |
|
40 virtual void MHFRunL(RHTTPTransaction aTransaction, const THTTPEvent& aEvent); |
|
41 |
|
42 // @see MHTTPFilterBase::MHFSessionRunL |
|
43 virtual void MHFSessionRunL(const THTTPSessionEvent& aEvent); |
|
44 |
|
45 // @see MHTTPFilterBase::MHFRunError |
|
46 //##ModelId=3B1E52A00391 |
|
47 virtual TInt MHFRunError(TInt aError, RHTTPTransaction aTransaction, |
|
48 const THTTPEvent& aEvent); |
|
49 |
|
50 // @see MHTTPFilterBase::MHFSessionRunError |
|
51 virtual TInt MHFSessionRunError(TInt aError, const THTTPSessionEvent& aEvent); |
|
52 |
|
53 public: // Methods from MHTTPFilter |
|
54 |
|
55 // @see MHTTPFilter::MHFUnload |
|
56 //##ModelId=3B1E52A00389 |
|
57 virtual void MHFUnload(RHTTPSession aSession, THTTPFilterHandle aHandle); |
|
58 |
|
59 // @see MHTTPFilter::MHFLoad |
|
60 //##ModelId=3B1E52A00386 |
|
61 virtual void MHFLoad(RHTTPSession aSession, THTTPFilterHandle aHandle); |
|
62 |
|
63 private: |
|
64 |
|
65 //##ModelId=3B1E52A00385 |
|
66 CRedirectFilter(RHTTPSession aSession); |
|
67 //ContructL also Installs the filter. |
|
68 //##ModelId=3B1E52A0037F |
|
69 void ConstructL(RHTTPSession aSession); |
|
70 |
|
71 // Function to handle the receipt of 301 Moved Permanently, 302 Found, 307 Moved Temporarily or 303 See Other |
|
72 //##ModelId=3B1E52A0037D |
|
73 void HandleRedirectL(RHTTPTransaction aTransaction,THTTPEvent::TTransactionWarning aWarningEvent); |
|
74 |
|
75 // Handle a 305 Use Proxy response |
|
76 //##ModelId=3B1E52A0037B |
|
77 void HandleUseProxyL(RHTTPTransaction aTransaction); |
|
78 |
|
79 // Sets the uri of aRequest to aUri. If aUri is relative then complete it |
|
80 // using the host information from the request uri. |
|
81 // Note: according to the http spec a redirect should not use a relative uri |
|
82 // but that does not stop some sites from doing it. |
|
83 void SetRedirectUriL(RHTTPRequest aRequest, const TUriC8& aUri) const; |
|
84 |
|
85 void EscapeEncodeUriL ( CUri8& aUri ) const; |
|
86 |
|
87 |
|
88 |
|
89 |
|
90 private: |
|
91 // A count to make sure we delete at the right time. |
|
92 //##ModelId=3B1E52A00373 |
|
93 TInt iLoadCount; |
|
94 //##ModelId=3BA6003B0264 |
|
95 RStringPool iStringPool; |
|
96 |
|
97 //##ModelId=3BA6003B0250 |
|
98 RHTTPSession iSession; |
|
99 |
|
100 const TStringTable& iStringTable; |
|
101 __DECLARE_PERFORMANCE_LOG |
|
102 }; |
|
103 |
|
104 #endif //__REDIRECT_H_ |