]> Git repositories of Nishi - tewi.git/commitdiff
some fix for old windows
authorNishi <nishi@nishi.boats>
Wed, 18 Sep 2024 09:51:17 +0000 (09:51 +0000)
committerNishi <nishi@nishi.boats>
Wed, 18 Sep 2024 09:51:17 +0000 (09:51 +0000)
git-svn-id: file:///raid/svn-personal/tewi/trunk@45 8739d7e6-ffea-ec47-b151-bdff447c6205

Server/server.c

index 367d3ac354df3a80eb8f17dffa5676d49a284749..5f83de53be80699407c3cc8f614d8b3990d576a1 100644 (file)
@@ -435,7 +435,10 @@ void tw_server_pass(int sock, bool ssl, int port, SOCKADDR addr) {
                                struct tm tm;
                                strptime(req.headers[i + 1], "%a, %d %b %Y %H:%M:%S GMT", &tm);
 #ifdef __MINGW32__
-                               cmtime = _mkgmtime(&tm);
+                               time_t t = 0;
+                               struct tm* btm = localtime(&t);
+                               cmtime = mktime(&tm);
+                               cmtime -= (btm->tm_hour * 60 + btm->tm_min) * 60;
 #else
                                cmtime = timegm(&tm);
 #endif