From 93db6ec22bc95587dbfe3bfd6cbfcd963c8ecd49 Mon Sep 17 00:00:00 2001 From: Sergey Pisarchik Date: Sat, 3 May 2014 22:03:39 +0300 Subject: [Tizen] Add some http callback calls --- platform/http_thread_tizen.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'platform/http_thread_tizen.cpp') diff --git a/platform/http_thread_tizen.cpp b/platform/http_thread_tizen.cpp index 92705351d8..80e905d01e 100644 --- a/platform/http_thread_tizen.cpp +++ b/platform/http_thread_tizen.cpp @@ -128,6 +128,9 @@ void HttpThread::OnTransactionHeaderCompleted(HttpSession & httpSession, if ((r = GetLastResult()) != E_SUCCESS) { LOG(LWARNING, ("httpTransaction.GetResponse error", r)); + httpSession.CancelTransaction(httpTransaction); + httpSession.CloseTransaction(httpTransaction); + m_callback.OnFinish(-1, m_begRange, m_endRange); return; } @@ -138,8 +141,9 @@ void HttpThread::OnTransactionHeaderCompleted(HttpSession & httpSession, if ((isChunk && httpStatusCode != 206) || (!isChunk && httpStatusCode != 200)) { LOG(LWARNING, ("Http request to", m_url, " aborted with HTTP code", httpStatusCode)); - r = httpSession.CancelTransaction(httpTransaction); + httpSession.CancelTransaction(httpTransaction); r = httpSession.CloseTransaction(httpTransaction); + m_callback.OnFinish(-4, m_begRange, m_endRange); LOG(LDEBUG, ("CloseTransaction result", r)); return; } @@ -169,8 +173,9 @@ void HttpThread::OnTransactionHeaderCompleted(HttpSession & httpSession, { LOG(LWARNING, ("Http request to", m_url, "aborted - invalid Content-Range:", value, " expected:" ,m_expectedSize )); - r = httpSession.CancelTransaction(httpTransaction); + httpSession.CancelTransaction(httpTransaction); r = httpSession.CloseTransaction(httpTransaction); + m_callback.OnFinish(-2, m_begRange, m_endRange); LOG(LDEBUG, ("CloseTransaction result", r)); } } @@ -193,8 +198,9 @@ void HttpThread::OnTransactionHeaderCompleted(HttpSession & httpSession, { LOG(LWARNING, ("Http request to", m_url, "aborted - invalid Content-Length:", value, " expected:" ,m_expectedSize )); - r = httpSession.CancelTransaction(httpTransaction); + httpSession.CancelTransaction(httpTransaction); r = httpSession.CloseTransaction(httpTransaction); + m_callback.OnFinish(-2, m_begRange, m_endRange); LOG(LDEBUG, ("CloseTransaction result", r)); } } @@ -206,8 +212,9 @@ void HttpThread::OnTransactionHeaderCompleted(HttpSession & httpSession, LOG(LWARNING, ("Http request to", m_url, "aborted, server didn't send any valid file size")); - r = httpSession.CancelTransaction(httpTransaction); + httpSession.CancelTransaction(httpTransaction); r = httpSession.CloseTransaction(httpTransaction); + m_callback.OnFinish(-2, m_begRange, m_endRange); LOG(LDEBUG, ("CloseTransaction result", r)); } } -- cgit v1.2.3