Re: [Squid-cvs] nt-2_5 squid/src/fs/aufs store_dir_aufs.c,1.23.6.1.4.15,1.23.6.1.4.16

2005-05-20 Thread Henrik Nordstrom
On Fri, 20 May 2005, Guido Serassio wrote:
--- store_dir_aufs.c27 Mar 2005 07:51:24 -  1.23.6.1.4.15
+++ store_dir_aufs.c20 May 2005 08:41:51 -  1.23.6.1.4.16
@@ -1175,7 +1175,7 @@
debug(50, 0) (%s: %s\n, swaplog_path, xstrerror());
fatal(Failed to open swap log for reading);
}
-#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_)
+#if defined(_SQUID_CYGWIN_)
setmode(fileno(fp), O_BINARY);
#endif
memset(clean_sb, '\0', sizeof(struct stat));
Are you sure about this? The file is binary..
Additionally isn't it better to fopen the file binary to begin with?
from
fp = fopen(swaplog_path, r);
to
fp = fopen(swaplog_path, rb);
the b flag is accepted by all systems I know of, including UNIX (ignored 
there..).

Regards
Henrik


Re: [Squid-cvs] nt-2_5 squid/src/fs/aufs store_dir_aufs.c,1.23.6.1.4.15,1.23.6.1.4.16

2005-05-20 Thread Serassio Guido
Hi Henrik,
At 13.14 20/05/2005, Henrik Nordstrom wrote:
On Fri, 20 May 2005, Guido Serassio wrote:
--- store_dir_aufs.c27 Mar 2005 07:51:24 -  1.23.6.1.4.15
+++ store_dir_aufs.c20 May 2005 08:41:51 -  1.23.6.1.4.16
@@ -1175,7 +1175,7 @@
debug(50, 0) (%s: %s\n, swaplog_path, xstrerror());
fatal(Failed to open swap log for reading);
}
-#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_)
+#if defined(_SQUID_CYGWIN_)
setmode(fileno(fp), O_BINARY);
#endif
memset(clean_sb, '\0', sizeof(struct stat));
Are you sure about this? The file is binary..
This is exactly the current code in 2.5 STABLE. I have changed the #if 
defined simply to remove a not needed Windows change in the aufs code 
(aufs is not used on Windows, awin32 is used instead).

Additionally isn't it better to fopen the file binary to begin with?
from
fp = fopen(swaplog_path, r);
to
fp = fopen(swaplog_path, rb);
the b flag is accepted by all systems I know of, including UNIX (ignored 
there..).
Sure, in the nt branches, ufs and awin32 disk modules already open files in 
rb mode, without any setmode().

This code is unchanged from many time. I have never changed this because 
I'm not sure about any implication on existing disk cache on any other 
system than Windows.

There was an old thread on squid-dev about a similar question:
http://www.squid-cache.org/mail-archive/squid-dev/200205/0107.html
Regards
Guido

-

Guido Serassio
Acme Consulting S.r.l. - Microsoft Certified Partner
Via Lucia Savarino, 1   10098 - Rivoli (TO) - ITALY
Tel. : +39.011.9530135  Fax. : +39.011.9781115
Email: [EMAIL PROTECTED]
WWW: http://www.acmeconsulting.it/


Re: [Squid-cvs] nt-2_5 squid/src/fs/aufs store_dir_aufs.c,1.23.6.1.4.15,1.23.6.1.4.16

2005-05-20 Thread Serassio Guido
Hi Henrik,
At 17.00 20/05/2005, Henrik Nordstrom wrote:
This code is unchanged from many time. I have never changed this because 
I'm not sure about any implication on existing disk cache on any other 
system than Windows.

There was an old thread on squid-dev about a similar question:
http://www.squid-cache.org/mail-archive/squid-dev/200205/0107.html
Hmm.. this is about COSS?
Yes, look at the fopen() discussion. After this thread many of the 
setmode() was removed from HEAD and many fopen was changed to rb. This 
was never done on 2.5.

Regards
Guido

-

Guido Serassio
Acme Consulting S.r.l. - Microsoft Certified Partner
Via Lucia Savarino, 1   10098 - Rivoli (TO) - ITALY
Tel. : +39.011.9530135  Fax. : +39.011.9781115
Email: [EMAIL PROTECTED]
WWW: http://www.acmeconsulting.it/