From da1b9e0c1ceeb47ba20b1c6e82978d22e9bec4c4 Mon Sep 17 00:00:00 2001 From: wyy Date: Thu, 18 Sep 2014 00:05:43 +0800 Subject: [PATCH] update limonp --- server/Husky/WorkerThread.hpp | 2 +- src/Limonp/StringUtil.hpp | 21 --------------------- 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/server/Husky/WorkerThread.hpp b/server/Husky/WorkerThread.hpp index 2398890..37af949 100644 --- a/server/Husky/WorkerThread.hpp +++ b/server/Husky/WorkerThread.hpp @@ -57,7 +57,7 @@ namespace Husky LogError("do_POST failed."); break; } - string_format(strSnd, HTTP_FORMAT, CHARSET_UTF8, strRetByHandler.length(), strRetByHandler.c_str()); + strSnd = string_format(HTTP_FORMAT, CHARSET_UTF8, strRetByHandler.length(), strRetByHandler.c_str()); if(!_send(_sockfd, strSnd)) { diff --git a/src/Limonp/StringUtil.hpp b/src/Limonp/StringUtil.hpp index a10a80e..e6cc15d 100644 --- a/src/Limonp/StringUtil.hpp +++ b/src/Limonp/StringUtil.hpp @@ -26,27 +26,6 @@ namespace Limonp { using namespace std; - - inline void string_format(string& res, const char* fmt, ...) - { - int size = 256; - va_list ap; - res.clear(); - while (1) { - res.resize(size); - va_start(ap, fmt); - int n = vsnprintf((char *)res.c_str(), size, fmt, ap); - va_end(ap); - if (n > -1 && n < size) { - res.resize(n); - return; - } - if (n > -1) - size = n + 1; - else - size *= 2; - } - } inline string string_format(const char* fmt, ...) { int size = 256;