133 url->Des().Copy(aUrl); |
133 url->Des().Copy(aUrl); |
134 User::LeaveIfError(uriParser.Parse(*url)); |
134 User::LeaveIfError(uriParser.Parse(*url)); |
135 |
135 |
136 // Create the transaction. |
136 // Create the transaction. |
137 iTransaction = iSession.OpenTransactionL(uriParser, *this, |
137 iTransaction = iSession.OpenTransactionL(uriParser, *this, |
138 iSession.StringPool().StringF(HTTP::EGET, RHTTPSession::GetTable())); |
138 iSession.StringPool().StringF(HTTP::EGET, RHTTPSession::GetTable())); |
139 |
139 |
140 // TODO: Set the headers if any. |
140 // TODO: Set the headers if any. |
141 //++PK Add UA header code |
141 //++PK Add UA header code |
142 |
142 |
143 iUserAgentHeader = iTransaction.Request().GetHeaderCollection(); |
143 iUserAgentHeader = iTransaction.Request().GetHeaderCollection(); |
144 |
144 |
145 CUserAgent* tWebUtilsStandardUA = CUserAgent::NewL(); |
145 CUserAgent* tWebUtilsStandardUA = CUserAgent::NewL(); |
146 CleanupStack::PushL(tWebUtilsStandardUA); |
146 CleanupStack::PushL(tWebUtilsStandardUA); |
147 |
147 |
148 HBufC8* tWebUtilsStandardUAHeaderValue = tWebUtilsStandardUA->UserAgentL(); |
148 HBufC8* tWebUtilsStandardUAHeaderValue = tWebUtilsStandardUA->UserAgentL(); |
149 |
149 CleanupStack::PushL(tWebUtilsStandardUAHeaderValue); |
150 RStringF tStringValue = iSession.StringPool().OpenFStringL(*tWebUtilsStandardUAHeaderValue); |
150 |
151 |
151 RStringF tStringValue = iSession.StringPool().OpenFStringL(*tWebUtilsStandardUAHeaderValue); |
152 THTTPHdrVal tHeaderValue( tStringValue ); |
152 |
153 |
153 THTTPHdrVal tHeaderValue( tStringValue ); |
154 RStringF tStringUA = iSession.StringPool().StringF(HTTP::EUserAgent, RHTTPSession::GetTable()); |
154 |
155 |
155 RStringF tStringUA = iSession.StringPool().StringF(HTTP::EUserAgent, RHTTPSession::GetTable()); |
156 iUserAgentHeader.SetFieldL( tStringUA, tStringValue ); |
156 |
157 |
157 iUserAgentHeader.SetFieldL( tStringUA, tStringValue ); |
158 //++PK |
158 |
|
159 //++PK |
159 // Submit the request. |
160 // Submit the request. |
160 iTransaction.SubmitL(); |
161 iTransaction.SubmitL(); |
161 |
162 |
162 // If the connection is available it is safe to tell to the observer |
163 // If the connection is available it is safe to tell to the observer |
163 // to display progress indicators (i.e. a wait-dialog). |
164 // to display progress indicators (i.e. a wait-dialog). |
164 if (iHttpConnection->IsConnected()) |
165 if (iHttpConnection->IsConnected()) |
165 { |
166 { |
166 iObserver->StartWait(); |
167 iObserver->StartWait(); |
167 |
168 |
168 // Start the inactive connection timer as well. |
169 // Start the inactive connection timer as well. |
169 iTimer->Start(KTimerPeriod, KTimerPeriod, iTimerState); |
170 iTimer->Start(KTimerPeriod, KTimerPeriod, iTimerState); |
170 iLastActivity.HomeTime(); |
171 iLastActivity.HomeTime(); |
171 } |
172 } |
172 |
173 |
|
174 tStringValue.Close(); |
|
175 CleanupStack::PopAndDestroy(tWebUtilsStandardUAHeaderValue); |
173 CleanupStack::PopAndDestroy(tWebUtilsStandardUA); |
176 CleanupStack::PopAndDestroy(tWebUtilsStandardUA); |
174 CleanupStack::PopAndDestroy(url); |
177 CleanupStack::PopAndDestroy(url); |
175 } |
178 } |
176 |
179 |
177 |
180 |