|
1 // Copyright (c) 2003-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 __CLOCALTESTSERVERSTREAMMANAGER_H__ |
|
17 #define __CLOCALTESTSERVERSTREAMMANAGER_H__ |
|
18 |
|
19 #include <e32base.h> |
|
20 #include <f32file.h> |
|
21 |
|
22 #include <minputstreamobserver.h> |
|
23 #include <moutputstreamobserver.h> |
|
24 class MInputStream; |
|
25 class MOutputStream; |
|
26 class CHTTPTestUtils; |
|
27 class CHttpClientTestParamArray; |
|
28 class CHttpClientTestParams; |
|
29 |
|
30 |
|
31 |
|
32 class CLocalTestServerStreamManager : public CBase, public MInputStreamObserver, |
|
33 public MOutputStreamObserver |
|
34 { |
|
35 public: |
|
36 static CLocalTestServerStreamManager* NewL(CHTTPTestUtils& aTestUtils, MInputStream* aInStream, MOutputStream* aOutStream, CHttpClientTestParamArray& aTestParamArray); |
|
37 ~CLocalTestServerStreamManager(); |
|
38 |
|
39 private: |
|
40 CLocalTestServerStreamManager(CHTTPTestUtils& aTestUtils, MInputStream* aInStream, MOutputStream* aOutStream, CHttpClientTestParamArray& aTestParamArray); |
|
41 // From MInputStreamObserver |
|
42 void ReceivedDataIndL(const TDesC8& aBuffer); |
|
43 void SecureServerCnf(); |
|
44 void InputStreamCloseInd(TInt aError); |
|
45 void MInputStreamObserver_Reserved(); |
|
46 MHttpResponse* CurrentResponse(); |
|
47 virtual void OnReceiveTimeOut(); |
|
48 |
|
49 // From MOutputStreamObserver |
|
50 void SendDataCnfL(); |
|
51 void SecureClientCnf(); |
|
52 void OutputStreamCloseInd(TInt aError); |
|
53 void MOutputStreamObserver_Reserved(); |
|
54 void OnSendTimeOut(); |
|
55 TInt SendTimeOutVal(); |
|
56 TPtrC8 GetLine(const TDesC8& aData); |
|
57 void ProcessRequestStreamL(); |
|
58 void ParseRequestStream(); |
|
59 |
|
60 void SendDataL(); |
|
61 private: |
|
62 CHTTPTestUtils& iTestUtils; |
|
63 MInputStream* iInputStream; // Not owned |
|
64 MOutputStream* iOutputStream; // Not owned |
|
65 HBufC8* iRequestStream; |
|
66 HBufC8* iResponseStream; |
|
67 CHttpClientTestParamArray& iTestParamArray; |
|
68 TBool iSendingBodyData; |
|
69 CHttpClientTestParams* iCurrentTestParam; |
|
70 TBool iWritingUploadFile; |
|
71 }; |
|
72 #endif // __CLOCALTESTSERVERSTREAMMANAGER_H__ |