58 m_cookieHandler = NULL; |
58 m_cookieHandler = NULL; |
59 m_httpDownload = NULL; |
59 m_httpDownload = NULL; |
60 m_SelfDownloadContentHandler = NULL; |
60 m_SelfDownloadContentHandler = NULL; |
61 m_SelfDownloadContentTypes = KNullStr().Alloc(); |
61 m_SelfDownloadContentTypes = KNullStr().Alloc(); |
62 retryConnectivityFlag = EFalse; |
62 retryConnectivityFlag = EFalse; |
63 m_inSecConnection = EFalse; |
|
64 } |
63 } |
65 |
64 |
66 HttpSessionManager::~HttpSessionManager() |
65 HttpSessionManager::~HttpSessionManager() |
67 { |
66 { |
68 delete m_cacheManager; |
67 delete m_cacheManager; |
69 m_cacheManager = NULL; |
68 m_cacheManager = NULL; |
70 delete m_ReqHdrManager; |
69 delete m_ReqHdrManager; |
71 m_ReqHdrManager = NULL; |
70 m_ReqHdrManager = NULL; |
72 delete m_cookieHandler; |
71 delete m_cookieHandler; |
|
72 m_cookieHandler = NULL; |
73 delete m_httpDownload; |
73 delete m_httpDownload; |
74 m_httpDownload = NULL; |
74 m_httpDownload = NULL; |
75 delete m_SelfDownloadContentHandler; |
75 delete m_SelfDownloadContentHandler; |
76 m_SelfDownloadContentHandler = NULL; |
76 m_SelfDownloadContentHandler = NULL; |
77 delete m_SelfDownloadContentTypes; |
77 delete m_SelfDownloadContentTypes; |
140 // http request header manager |
140 // http request header manager |
141 if (!m_ReqHdrManager) { |
141 if (!m_ReqHdrManager) { |
142 m_ReqHdrManager = HttpRequestHeaderManager::NewL(m_httpSession); |
142 m_ReqHdrManager = HttpRequestHeaderManager::NewL(m_httpSession); |
143 } |
143 } |
144 if (!m_cookieHandler) { |
144 if (!m_cookieHandler) { |
145 m_cookieHandler = CookieHandler::init(); |
145 m_cookieHandler = CookieHandler::init(m_httpSession.StringPool()); |
146 } |
146 } |
147 } |
147 } |
148 updateFilters(true); |
148 updateFilters(true); |
149 } |
149 } |
150 |
150 |
173 this->handleError(KErrCancel); |
173 this->handleError(KErrCancel); |
174 |
174 |
175 // disconnect the Dl Mgr |
175 // disconnect the Dl Mgr |
176 if (m_httpDownload){ |
176 if (m_httpDownload){ |
177 m_httpDownload->disconnect(); |
177 m_httpDownload->disconnect(); |
|
178 if(m_cookieHandler) |
|
179 m_cookieHandler->destroy(); |
|
180 |
178 } |
181 } |
179 m_httpSession.Close(); |
182 m_httpSession.Close(); |
180 m_sessionRunning = false; |
183 m_sessionRunning = false; |
181 |
184 |
182 delete m_ReqHdrManager; |
185 delete m_ReqHdrManager; |
261 |
264 |
262 void HttpSessionManager::retryTransactions() |
265 void HttpSessionManager::retryTransactions() |
263 { |
266 { |
264 Vector<HttpConnection *> requests; |
267 Vector<HttpConnection *> requests; |
265 |
268 |
|
269 TBool newConn = ETrue; |
|
270 m_httpSession.ConnectionInfo().SetPropertyL(m_httpSession.StringPool().StringF(HttpFilterCommonStringsExt::EHttpNewConnFlag, HttpFilterCommonStringsExt::GetTable()), THTTPHdrVal((TBool)newConn)); |
|
271 |
266 for(HashMap<HttpConnection *, ResourceHandle *>::iterator tmpit = m_pendingHttpRequests.begin(); |
272 for(HashMap<HttpConnection *, ResourceHandle *>::iterator tmpit = m_pendingHttpRequests.begin(); |
267 tmpit != m_pendingHttpRequests.end(); ++tmpit) |
273 tmpit != m_pendingHttpRequests.end(); ++tmpit) |
268 { |
274 { |
269 ResourceHandle *tmp = tmpit->second; |
|
270 ResourceHandleClient* client = tmp->client(); |
|
271 if(!client->isLoadingPlugins()) |
|
272 requests.append(tmpit->first); |
275 requests.append(tmpit->first); |
273 } |
276 } |
274 //Submit them again |
277 //Submit them again |
275 for (int i=0; i<requests.size(); ++i) |
278 for (int i=0; i<requests.size(); ++i) |
276 { |
279 { |
|
280 if(requests[i]->HttpTransaction()) { |
277 requests[i]->HttpTransaction()->SubmitL(); |
281 requests[i]->HttpTransaction()->SubmitL(); |
278 } |
282 } |
279 |
283 else { |
|
284 removeRequest(requests[i]); |
|
285 } |
|
286 |
|
287 } |
280 } |
288 } |
281 |
289 |
282 HttpConnection* HttpSessionManager::firstHttpConnection() |
290 HttpConnection* HttpSessionManager::firstHttpConnection() |
283 { |
291 { |
284 HashMap<HttpConnection *, ResourceHandle *>::const_iterator it = m_pendingHttpRequests.begin(); |
292 HashMap<HttpConnection *, ResourceHandle *>::const_iterator it = m_pendingHttpRequests.begin(); |
481 } |
489 } |
482 CleanupStack::PopAndDestroy(); // url8 |
490 CleanupStack::PopAndDestroy(); // url8 |
483 } |
491 } |
484 } |
492 } |
485 |
493 |
|
494 void HttpSessionManager::cancelQueuedTransactions() |
|
495 { |
|
496 Vector<HttpConnection *> requests; |
|
497 for(HashMap<HttpConnection *, ResourceHandle *>::iterator tmpit = m_pendingHttpRequests.begin(); |
|
498 tmpit != m_pendingHttpRequests.end(); ++tmpit) |
|
499 { |
|
500 requests.append(tmpit->first); |
|
501 } |
|
502 |
|
503 for (int i = 0; i < requests.size(); ++i) { |
|
504 if(requests[i]->HttpTransaction()) { |
|
505 requests[i]->HttpTransaction()->Cancel(); |
|
506 } |
|
507 } |
|
508 } |
|
509 |
486 // end of file |
510 // end of file |