Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Pisarchik <pisarchik@mapswithme.com>2014-05-04 22:53:37 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 02:15:11 +0300
commit9632652c23690f0c2bfe9b06f9c694fb64b1de46 (patch)
tree46995df0df823ac6d8289b8b8a5dffe54e1b4a1b /platform/http_thread_tizen.cpp
parent93db6ec22bc95587dbfe3bfd6cbfcd963c8ecd49 (diff)
[Tizen] Fixed code style
Diffstat (limited to 'platform/http_thread_tizen.cpp')
-rw-r--r--platform/http_thread_tizen.cpp50
1 files changed, 23 insertions, 27 deletions
diff --git a/platform/http_thread_tizen.cpp b/platform/http_thread_tizen.cpp
index 80e905d01e..8bf0406468 100644
--- a/platform/http_thread_tizen.cpp
+++ b/platform/http_thread_tizen.cpp
@@ -96,10 +96,10 @@ HttpThread::HttpThread(std::string const & url,
{
pRequest->SetMethod(NET_HTTP_METHOD_POST);
pHeader->AddField("Content-Type", "application/json");
- int64_t sz = m_pb.size();
- String lenght;
- lenght.Append(sz);
- pHeader->AddField("Content-Length", lenght);
+ int64_t const sz = m_pb.size();
+ String length;
+ length.Append(sz);
+ pHeader->AddField("Content-Length", length);
ByteBuffer body;
body.Construct((const byte *)m_pb.c_str(), 0, sz, sz);
pRequest->WriteBody(body);
@@ -120,8 +120,8 @@ HttpThread::~HttpThread()
void HttpThread::OnTransactionHeaderCompleted(HttpSession & httpSession,
- HttpTransaction & httpTransaction,
- int headerLen, bool bAuthRequired)
+ HttpTransaction & httpTransaction,
+ int headerLen, bool bAuthRequired)
{
result r = E_SUCCESS;
HttpResponse * pResponse = httpTransaction.GetResponse();
@@ -143,7 +143,7 @@ void HttpThread::OnTransactionHeaderCompleted(HttpSession & httpSession,
LOG(LWARNING, ("Http request to", m_url, " aborted with HTTP code", httpStatusCode));
httpSession.CancelTransaction(httpTransaction);
r = httpSession.CloseTransaction(httpTransaction);
- m_callback.OnFinish(-4, m_begRange, m_endRange);
+ m_callback.OnFinish(-4, m_begRange, m_endRange);
LOG(LDEBUG, ("CloseTransaction result", r));
return;
}
@@ -172,7 +172,7 @@ void HttpThread::OnTransactionHeaderCompleted(HttpSession & httpSession,
if (value != m_expectedSize)
{
LOG(LWARNING, ("Http request to", m_url,
- "aborted - invalid Content-Range:", value, " expected:" ,m_expectedSize ));
+ "aborted - invalid Content-Range:", value, " expected:", m_expectedSize ));
httpSession.CancelTransaction(httpTransaction);
r = httpSession.CloseTransaction(httpTransaction);
m_callback.OnFinish(-2, m_begRange, m_endRange);
@@ -182,14 +182,12 @@ void HttpThread::OnTransactionHeaderCompleted(HttpSession & httpSession,
}
else
{
-
pValues = pHeader->GetFieldValuesN("Content-Length");
if (GetLastResult() == E_SUCCESS)
{
bGoodSize = true;
pValues->MoveNext(); // strange, but works
String const * pString = dynamic_cast<String const *>(pValues->GetCurrent());
-
if (pString)
{
int64_t value = -1;
@@ -197,10 +195,10 @@ void HttpThread::OnTransactionHeaderCompleted(HttpSession & httpSession,
if (value != m_expectedSize)
{
LOG(LWARNING, ("Http request to", m_url,
- "aborted - invalid Content-Length:", value, " expected:" ,m_expectedSize ));
+ "aborted - invalid Content-Length:", value, " expected:", m_expectedSize));
httpSession.CancelTransaction(httpTransaction);
r = httpSession.CloseTransaction(httpTransaction);
- m_callback.OnFinish(-2, m_begRange, m_endRange);
+ m_callback.OnFinish(-2, m_begRange, m_endRange);
LOG(LDEBUG, ("CloseTransaction result", r));
}
}
@@ -209,12 +207,11 @@ void HttpThread::OnTransactionHeaderCompleted(HttpSession & httpSession,
if (!bGoodSize)
{
-
LOG(LWARNING, ("Http request to", m_url,
"aborted, server didn't send any valid file size"));
httpSession.CancelTransaction(httpTransaction);
r = httpSession.CloseTransaction(httpTransaction);
- m_callback.OnFinish(-2, m_begRange, m_endRange);
+ m_callback.OnFinish(-2, m_begRange, m_endRange);
LOG(LDEBUG, ("CloseTransaction result", r));
}
}
@@ -226,7 +223,6 @@ void HttpThread::OnHttpDownloadInProgress(HttpSession & /*httpSession*/,
int64_t totalLength)
{
HttpResponse * pResponse = httpTransaction.GetResponse();
-
if (pResponse->GetHttpStatusCode() == HTTP_STATUS_OK || pResponse->GetHttpStatusCode() == HTTP_STATUS_PARTIAL_CONTENT)
{
ByteBuffer * pBuffer = 0;
@@ -240,7 +236,7 @@ void HttpThread::OnHttpDownloadInProgress(HttpSession & /*httpSession*/,
LOG(LERROR, ("OnHttpDownloadInProgress ERROR", FromTizenString(pResponse->GetStatusText())));
}
-void HttpThread::OnTransactionCompleted (HttpSession &/*httpSession*/,
+void HttpThread::OnTransactionCompleted(HttpSession & /*httpSession*/,
HttpTransaction & httpTransaction)
{
HttpResponse * pResponse = httpTransaction.GetResponse();
@@ -258,35 +254,35 @@ void HttpThread::OnTransactionCompleted (HttpSession &/*httpSession*/,
}
void HttpThread::OnTransactionAborted(HttpSession & /*httpSession*/,
- HttpTransaction & /*httpTransaction*/,
- result r)
+ HttpTransaction & /*httpTransaction*/,
+ result r)
{
LOG(LINFO, ("OnTransactionAborted result:", r));
m_callback.OnFinish(-100, m_begRange, m_endRange);
}
void HttpThread::OnTransactionCertVerificationRequiredN(HttpSession & /*httpSession*/,
- HttpTransaction & /*httpTransaction*/,
- String * /*pCert*/)
+ HttpTransaction & /*httpTransaction*/,
+ String * /*pCert*/)
{
LOG(LERROR, ("OnTransactionCertVerificationRequiredN"));
}
void HttpThread::OnTransactionReadyToRead(HttpSession & /*httpSession*/,
- HttpTransaction & /*httpTransaction*/,
- int /*availableBodyLen*/)
+ HttpTransaction & /*httpTransaction*/,
+ int /*availableBodyLen*/)
{
}
void HttpThread::OnTransactionReadyToWrite(HttpSession & /*httpSession*/,
- HttpTransaction & /*httpTransaction*/,
- int /*recommendedChunkSize*/)
+ HttpTransaction & /*httpTransaction*/,
+ int /*recommendedChunkSize*/)
{
}
void HttpThread::OnHttpUploadInProgress(Tizen::Net::Http::HttpSession & /*httpSession*/,
- Tizen::Net::Http::HttpTransaction & /*httpTransaction*/,
- int64_t /*currentLength*/,
- int64_t /*totalLength*/)
+ Tizen::Net::Http::HttpTransaction & /*httpTransaction*/,
+ int64_t /*currentLength*/,
+ int64_t /*totalLength*/)
{
}