equal
deleted
inserted
replaced
1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of "Eclipse Public License v1.0" |
4 // under the terms of "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
11 // Contributors: |
11 // Contributors: |
12 // |
12 // |
13 // Description: |
13 // Description: |
14 // |
14 // |
15 |
15 |
|
16 #include "OstTraceDefinitions.h" |
|
17 #ifdef OST_TRACE_COMPILER_IN_USE |
|
18 #include "CLWSPPduHandlerTraces.h" |
|
19 #endif |
|
20 |
16 #include "CLWSPPduHandler.h" |
21 #include "CLWSPPduHandler.h" |
17 #include "wapmsgerr.h" |
22 #include "wapmsgerr.h" |
18 #include "WapSwsLog.h" |
|
19 |
23 |
20 void CCLWSPPduHandler::UnpackWSPPduL(HBufC8* aWSPPdu, TWSPPduType& aType, HBufC8*& aWSPHeader, HBufC8*& aBody, TUint8& aId, TWSPStatus& aStatus) |
24 void CCLWSPPduHandler::UnpackWSPPduL(HBufC8* aWSPPdu, TWSPPduType& aType, HBufC8*& aWSPHeader, HBufC8*& aBody, TUint8& aId, TWSPStatus& aStatus) |
21 /** |
25 /** |
22 Unpack the received WSP PDU from remote peer to several data structure expected by the client. |
26 Unpack the received WSP PDU from remote peer to several data structure expected by the client. |
23 @internalComponent |
27 @internalComponent |
33 */ |
37 */ |
34 { |
38 { |
35 TPtr8 des=aWSPPdu->Des(); |
39 TPtr8 des=aWSPPdu->Des(); |
36 if(des.Length() < KPDUTransactionIDAndPDUTypeLength) |
40 if(des.Length() < KPDUTransactionIDAndPDUTypeLength) |
37 { |
41 { |
38 LOG(SwsLog::Printf(_L("CCLWSPPduHandler::UnpackWSPPduL() Corrupted InComing Wsp PDU"));) |
42 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CCLWSPPDUHANDLER_UNPACKWSPPDUL_1, "CCLWSPPduHandler::UnpackWSPPduL() Corrupted InComing Wsp PDU"); |
39 User::Leave(KErrCorrupt); |
43 User::Leave(KErrCorrupt); |
40 } |
44 } |
41 aId=des[KPDUHeaderTransactionIDOffSet]; |
45 aId=des[KPDUHeaderTransactionIDOffSet]; |
42 aType=TWSPPduType(des[KPDUHeaderWSPPDUTypeOffSet]); |
46 aType=TWSPPduType(des[KPDUHeaderWSPPDUTypeOffSet]); |
43 switch (aType) |
47 switch (aType) |
44 { |
48 { |
47 break; |
51 break; |
48 case EPush: |
52 case EPush: |
49 UnpackPushPduL(aWSPPdu, aWSPHeader, aBody); |
53 UnpackPushPduL(aWSPPdu, aWSPHeader, aBody); |
50 break; |
54 break; |
51 default: |
55 default: |
52 LOG(SwsLog::Printf(_L("CCLWSPPduHandler::UnpackWSPPduL() Unknown InComing Wsp PDU Type"));) |
56 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CCLWSPPDUHANDLER_UNPACKWSPPDUL_2, "CCLWSPPduHandler::UnpackWSPPduL() Unknown InComing Wsp PDU Type"); |
53 User::Leave(KErrCorrupt); |
57 User::Leave(KErrCorrupt); |
54 } |
58 } |
55 } |
59 } |
56 |
60 |
57 void CCLWSPPduHandler::PackWSPPduL(HBufC8*& aWSPPdu, TWSPPduType aType, const TDesC& aURI, const TDesC8& aWSPHeader, const TDesC8& aBody, const TUint8 aId) |
61 void CCLWSPPduHandler::PackWSPPduL(HBufC8*& aWSPPdu, TWSPPduType aType, const TDesC& aURI, const TDesC8& aWSPHeader, const TDesC8& aBody, const TUint8 aId) |
83 case EPostPut: |
87 case EPostPut: |
84 PackPostPduL(aWSPPdu, aType, aURI, aWSPHeader, aBody, aId); |
88 PackPostPduL(aWSPPdu, aType, aURI, aWSPHeader, aBody, aId); |
85 break; |
89 break; |
86 |
90 |
87 default: |
91 default: |
88 LOG(SwsLog::Printf(_L("CCLWSPPduHandler::PackWSPPduL() Unknown Method Invoke Wsp PDU Type"));) |
92 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CCLWSPPDUHANDLER_PACKWSPPDUL_1, "CCLWSPPduHandler::PackWSPPduL() Unknown Method Invoke Wsp PDU Type"); |
89 User::Leave(Wap::EWspClParameterError); |
93 User::Leave(Wap::EWspClParameterError); |
90 } |
94 } |
91 } |
95 } |
92 |
96 |
93 void CCLWSPPduHandler::UnpackPushPduL(HBufC8* aWSPPdu, HBufC8*& aWSPHeader, HBufC8*& aBody) |
97 void CCLWSPPduHandler::UnpackPushPduL(HBufC8* aWSPPdu, HBufC8*& aWSPHeader, HBufC8*& aBody) |
94 /** |
98 /** |