--------------------- PatchSet 3720 Date: 2002/03/03 10:14:06 Author: serassio Branch: nt-2_3 Tag: (none) Log: Fixed a bug in WIN32 getrusage emulation - Thanks to Evgeniy Bendersky for the report Members: src/ftp.c:1.1.1.3.4.3.2.7->1.1.1.3.4.3.2.8 src/win32.c:1.1.2.13->1.1.2.14 Index: squid/src/ftp.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/ftp.c,v retrieving revision 1.1.1.3.4.3.2.7 retrieving revision 1.1.1.3.4.3.2.8 diff -u -r1.1.1.3.4.3.2.7 -r1.1.1.3.4.3.2.8 --- squid/src/ftp.c 23 Feb 2002 21:41:03 -0000 1.1.1.3.4.3.2.7 +++ squid/src/ftp.c 3 Mar 2002 10:14:06 -0000 1.1.1.3.4.3.2.8 @@ -1,6 +1,6 @@ /* - * $Id: ftp.c,v 1.1.1.3.4.3.2.7 2002/02/23 21:41:03 serassio Exp $ + * $Id: ftp.c,v 1.1.1.3.4.3.2.8 2002/03/03 10:14:06 serassio Exp $ * * DEBUG: section 9 File Transfer Protocol (FTP) * AUTHOR: Harvest Derived @@ -1250,13 +1250,11 @@ Counter.syscalls.sock.reads++; #ifdef _SQUID_MSWIN_ len = recv(fd, - ftpState->ctrl.buf + ftpState->ctrl.offset, - ftpState->ctrl.size - ftpState->ctrl.offset); #else len = read(fd, +#endif ftpState->ctrl.buf + ftpState->ctrl.offset, ftpState->ctrl.size - ftpState->ctrl.offset); -#endif if (len > 0) { fd_bytes(fd, len, FD_READ); kb_incr(&Counter.server.all.kbytes_in, len); Index: squid/src/win32.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/win32.c,v retrieving revision 1.1.2.13 retrieving revision 1.1.2.14 diff -u -r1.1.2.13 -r1.1.2.14 --- squid/src/win32.c 10 Feb 2002 17:55:57 -0000 1.1.2.13 +++ squid/src/win32.c 3 Mar 2002 10:14:07 -0000 1.1.2.14 @@ -724,10 +724,12 @@ FILETIME ftCreate, ftExit, ftKernel, ftUser; if (GetProcessTimes(hProcess, &ftCreate, &ftExit, &ftKernel, &ftUser)) { - LONGLONG tUser64 = *(LONGLONG *)&ftUser; - LONGLONG tKernel64 = *(LONGLONG *)&ftKernel; - usage->ru_utime.tv_usec =(DWORD)(tUser64 / 10); - usage->ru_stime.tv_usec =(DWORD)(tKernel64 / 10); + LONGLONG tUser64 = (*(LONGLONG *)&ftUser / 10); + LONGLONG tKernel64 = (*(LONGLONG *)&ftKernel / 10); + usage->ru_utime.tv_sec =(long)(tUser64 / 1000000); + usage->ru_stime.tv_sec =(long)(tKernel64 / 1000000); + usage->ru_utime.tv_usec =(long)(tUser64 % 1000000); + usage->ru_stime.tv_usec =(long)(tKernel64 % 1000000); } else {