diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2013-07-25 20:15:05 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2013-07-25 20:15:05 +0000 |
commit | 9d32b9cd791fb5f51dad17567152c70a8511a500 (patch) | |
tree | fd7aa3250ed409e720f26c341c0a5d736ed8083c /plugins/HTTPServer | |
parent | 125a25c86eed41352d45eb8fb6f994f65700c3ec (diff) |
replace sprintf to mir_snprintf (part 6)
git-svn-id: http://svn.miranda-ng.org/main/trunk@5485 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/HTTPServer')
-rw-r--r-- | plugins/HTTPServer/src/HttpUser.cpp | 38 | ||||
-rw-r--r-- | plugins/HTTPServer/src/main.cpp | 4 |
2 files changed, 11 insertions, 31 deletions
diff --git a/plugins/HTTPServer/src/HttpUser.cpp b/plugins/HTTPServer/src/HttpUser.cpp index e64656d93e..428a5cb087 100644 --- a/plugins/HTTPServer/src/HttpUser.cpp +++ b/plugins/HTTPServer/src/HttpUser.cpp @@ -231,7 +231,7 @@ void CLHttpUser::SendError(int iErrorCode, const char * pszError, const char * p pszDescription = pszError;
char szBuf[1000];
- DWORD dwBytesToWrite = mir_snprintf(szBuf, sizeof(szBuf) ,
+ DWORD dwBytesToWrite = mir_snprintf(szBuf, sizeof(szBuf),
"HTTP/1.1 %i %s\r\n"
"Date: %s\r\n"
"Server: MirandaWeb/%s\r\n"
@@ -281,7 +281,7 @@ void CLHttpUser::SendRedir(int iErrorCode, const char * pszError, const char * p pszDescription = pszError;
char szBuff[1000];
- DWORD dwBytesToWrite = mir_snprintf(szBuff, sizeof(szBuff) ,
+ DWORD dwBytesToWrite = mir_snprintf(szBuff, sizeof(szBuff),
"HTTP/1.1 %i %s\r\n"
"Date: %s\r\n"
"Server: MirandaWeb/%s\r\n"
@@ -616,11 +616,11 @@ bool CLHttpUser::bProcessGetRequest(char * pszRequest, bool bIsGetCommand) { "Last-Modified: %s\r\n"
"\r\n";
- dwBytesToWrite = mir_snprintf(szBuf, sizeof(szBuf), szHttpPartial ,
- szCurTime ,
+ dwBytesToWrite = mir_snprintf(szBuf, sizeof(szBuf), szHttpPartial,
+ szCurTime,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
- szETag ,
- dwDataToSend ,
+ szETag,
+ dwDataToSend,
pszGetMimeType(pszRealPath),
dwFileStart,
(dwFileStart + dwDataToSend - 1),
@@ -638,11 +638,11 @@ bool CLHttpUser::bProcessGetRequest(char * pszRequest, bool bIsGetCommand) { "Last-Modified: %s\r\n"
"\r\n";
- dwBytesToWrite = mir_snprintf(szBuf, sizeof(szBuf), szHttpOk ,
- szCurTime ,
+ dwBytesToWrite = mir_snprintf(szBuf, sizeof(szBuf), szHttpOk,
+ szCurTime,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
- szETag ,
- nDataSize ,
+ szETag,
+ nDataSize,
pszGetMimeType(pszRealPath),
szFileTime);
}
@@ -671,11 +671,7 @@ bool CLHttpUser::bProcessGetRequest(char * pszRequest, bool bIsGetCommand) { for (;;) {
{
DWORD dwCurTick = GetTickCount();
- if (dwCurTick - dwLastUpdate >= 1000) {/*
- char szTmp[200];
- _snprintf( szTmp, sizeof( szTmp ), "Bytes tr %d Time %d Tick %d\n", dwCurrentDL - dwLastCurrentDL, dwCurTick - dwLastUpdate, dwCurTick );
- OutputDebugString( szTmp );
- */
+ if (dwCurTick - dwLastUpdate >= 1000) {
dwSpeed = ((dwCurrentDL - dwLastCurrentDL) * 1000) / (dwCurTick - dwLastUpdate);
dwLastUpdate = dwCurTick;
dwLastCurrentDL = dwCurrentDL;
@@ -723,11 +719,6 @@ bool CLHttpUser::bProcessGetRequest(char * pszRequest, bool bIsGetCommand) { dwLastResetTime = GetTickCount();
nMaxBytesToSend = nMaxUploadSpeed / nThreadCount;
}
- /*
- char szTmp[200];
- _snprintf( szTmp, sizeof( szTmp ), "Current status : %d %% pos %d size %d\n", (dwCurrentDL * 100) / dwTotalSize, dwCurrentDL , dwTotalSize );
- OutputDebugString( szTmp );
- */
}
// file is always closed in destructor
@@ -738,13 +729,6 @@ bool CLHttpUser::bProcessGetRequest(char * pszRequest, bool bIsGetCommand) { DeleteFile(szTempfile);
}
- /*
- {
- char szBuf[200];
- _snprintf( szBuf, sizeof( szBuf ), "File Transfer stoped %d transfer complete %d\n", GetTickCount(), dwCurrentDL == nDataSize);
- OutputDebugString( szBuf );
- }
- */
clCritSection.Lock();
nThreadCount--;
diff --git a/plugins/HTTPServer/src/main.cpp b/plugins/HTTPServer/src/main.cpp index f71fe47ac0..3e476d40b8 100644 --- a/plugins/HTTPServer/src/main.cpp +++ b/plugins/HTTPServer/src/main.cpp @@ -602,10 +602,6 @@ static int nProtoAck(WPARAM /*wParam*/, LPARAM lParam) { return 0;
bIsOnline = ((int)ack->lParam != ID_STATUS_AWAY && (int)ack->lParam != ID_STATUS_NA);
- /*
- char szTmp[200];
- _snprintf( szTmp, sizeof( szTmp ), "%s New status %d\n" ,ack->szModule, (int)bIsOnline);
- OutputDebugString( szTmp );*/
return 0;
}
|