diff options
| author | Wladimir J. van der Laan <[email protected]> | 2014-05-23 15:41:14 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2014-05-23 15:52:45 +0200 |
| commit | 97b53b581b637f4c8089133e7d4bcd6e2a8761c8 (patch) | |
| tree | b5b628c1843b76214d97ceb801e6a971283566db /src/rpcprotocol.cpp | |
| parent | Merge pull request #4212 (diff) | |
| parent | Replace non-threadsafe gmtime and setlocale (diff) | |
| download | discoin-97b53b581b637f4c8089133e7d4bcd6e2a8761c8.tar.xz discoin-97b53b581b637f4c8089133e7d4bcd6e2a8761c8.zip | |
Merge pull request #4152
3e8ac6a Replace non-threadsafe gmtime and setlocale (Wladimir J. van der Laan)
a60838d Replace non-threadsafe strerror (Wladimir J. van der Laan)
Diffstat (limited to 'src/rpcprotocol.cpp')
| -rw-r--r-- | src/rpcprotocol.cpp | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/src/rpcprotocol.cpp b/src/rpcprotocol.cpp index 5cbaa535a..2718f8178 100644 --- a/src/rpcprotocol.cpp +++ b/src/rpcprotocol.cpp @@ -51,15 +51,7 @@ string HTTPPost(const string& strMsg, const map<string,string>& mapRequestHeader static string rfc1123Time() { - char buffer[64]; - time_t now; - time(&now); - struct tm* now_gmt = gmtime(&now); - string locale(setlocale(LC_TIME, NULL)); - setlocale(LC_TIME, "C"); // we want POSIX (aka "C") weekday/month strings - strftime(buffer, sizeof(buffer), "%a, %d %b %Y %H:%M:%S +0000", now_gmt); - setlocale(LC_TIME, locale.c_str()); - return string(buffer); + return DateTimeStrFormat("%a, %d %b %Y %H:%M:%S +0000", GetTime()); } string HTTPReply(int nStatus, const string& strMsg, bool keepalive) |