ICAP orphan files ?

2007-04-28 Thread Guido Serassio

Hi,

It seems to me that the following files in Squid 3 are orphaned:

ICAP/ICAPClientStream.cc
ICAP/ICAPClientStream.h

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/



squid3-largeobj: more changes ....

2007-04-28 Thread Tsantilas Christos
Hi Duane,
  I am sending a patch for the squid3-largeobj.

- FTP: size of large files does not show well.
- _DigestFetchState::offset and _DigestFetchState::mask_offset I think
must be 64bit
- fde::bytes_read and fde::bytes_written must be  64 bit

Large files support is still incomplete, more work needed at least for
Range Headers 

Regards,
Christos
Index: PeerDigest.h
===
RCS file: /cvsroot/squid/squid3/src/PeerDigest.h,v
retrieving revision 1.1
diff -u -r1.1 PeerDigest.h
--- PeerDigest.h	21 Aug 2006 01:51:49 -	1.1
+++ PeerDigest.h	28 Apr 2007 21:07:51 -
@@ -70,8 +70,8 @@
 store_client *sc;
 store_client *old_sc;
 HttpRequest *request;
-int offset;
-int mask_offset;
+int64_t offset;
+int64_t mask_offset;
 time_t start_time;
 time_t resp_time;
 time_t expires;
Index: fde.cc
===
RCS file: /cvsroot/squid/squid3/src/fde.cc,v
retrieving revision 1.6.6.1
diff -u -r1.6.6.1 fde.cc
--- fde.cc	25 Apr 2007 16:45:10 -	1.6.6.1
+++ fde.cc	28 Apr 2007 21:08:02 -
@@ -56,11 +56,11 @@
 
 #ifdef _SQUID_MSWIN_
 
-storeAppendPrintf(dumpEntry, %4d 0x%-8lX %-6.6s %4d %7d%c %7d%c %-21s %s\n,
+storeAppendPrintf(dumpEntry, %4d 0x%-8lX %-6.6s %4d %7PRId64%c %7PRId64%c %-21s %s\n,
   fdNumber,
   win32.handle,
 #else
-storeAppendPrintf(dumpEntry, %4d %-6.6s %4d %7d%c %7d%c %-21s %s\n,
+storeAppendPrintf(dumpEntry, %4d %-6.6s %4d %7PRId64%c %7PRId64%c %-21s %s\n,
   fdNumber,
 #endif
   fdTypeStr[type],
Index: fde.h
===
RCS file: /cvsroot/squid/squid3/src/fde.h,v
retrieving revision 1.13
diff -u -r1.13 fde.h
--- fde.h	15 Sep 2006 20:51:21 -	1.13
+++ fde.h	28 Apr 2007 21:08:02 -
@@ -75,8 +75,8 @@
 	unsigned int write_pending:1;
 } flags;
 
-int bytes_read;
-int bytes_written;
+int64_t bytes_read;
+int64_t bytes_written;
 
 struct {
 int uses;   /* ie # req's over persistent conn */
Index: ftp.cc
===
RCS file: /cvsroot/squid/squid3/src/ftp.cc,v
retrieving revision 1.63.2.8
diff -u -r1.63.2.8 ftp.cc
--- ftp.cc	25 Apr 2007 16:45:10 -	1.63.2.8
+++ ftp.cc	28 Apr 2007 21:08:14 -
@@ -152,7 +152,7 @@
 int fd;
 char *buf;
 size_t size;
-off_t offset;
+size_t offset;
 wordlist *message;
 char *last_command;
 char *last_reply;
@@ -217,7 +217,7 @@
 static IOCB ftpReadControlReply;
 static IOCB ftpWriteCommandCallback;
 static HttpReply *ftpAuthRequired(HttpRequest * request, const char *realm);
-static wordlist *ftpParseControlReply(char *, size_t, int *, int *);
+static wordlist *ftpParseControlReply(char *, size_t, int *, size_t *);
 
 // sending of the request body to the server
 virtual void sentRequestBody(int fd, size_t size, comm_err_t errflag);
@@ -258,7 +258,7 @@
 typedef struct
 {
 char type;
-int size;
+int64_t size;
 char *date;
 char *name;
 char *showname;
@@ -765,7 +765,7 @@
 p-type = 'd';
 } else {
 p-type = '-';
-p-size = atoi(tokens[2]);
+p-size = strtoll(tokens[2], NULL, 10);
 }
 
 snprintf(tbuf, 128, %s %s, tokens[0], tokens[1]);
@@ -1056,7 +1056,7 @@
 snprintf(icon, 2048, IMG border=\0\ SRC=\%s\ ALT=\%-6s\,
  mimeGetIconURL(parts-name),
  [FILE]);
-snprintf(size, 2048,  %6dk, parts-size);
+snprintf(size, 2048,  %6PRId64k, parts-size);
 break;
 }
 
@@ -1619,7 +1619,7 @@
 }
 
 wordlist *
-FtpStateData::ftpParseControlReply(char *buf, size_t len, int *codep, int *used)
+FtpStateData::ftpParseControlReply(char *buf, size_t len, int *codep, size_t *used)
 {
 char *s;
 char *sbuf;
@@ -1629,7 +1629,7 @@
 wordlist *head = NULL;
 wordlist *list;
 wordlist **tail = head;
-off_t offset;
+size_t offset;
 size_t linelen;
 int code = -1;
 debug(9, 5) (ftpParseControlReply\n);
@@ -1755,11 +1755,7 @@
 return;
 }
 
-/*
- * Cast is necessary because off_t and size_t are not always of
- * same signedness.
- */
-assert(ftpState-ctrl.offset  (off_t) ftpState-ctrl.size);
+assert(ftpState-ctrl.offset  ftpState-ctrl.size);
 
 if (errflag == COMM_OK  len  0) {
 fd_bytes(fd, len, FD_READ);
@@ -1802,7 +1798,7 @@
 FtpStateData::handleControlReply()
 {
 wordlist **W;
-int bytes_used = 0;
+size_t bytes_used = 0;
 wordlistDestroy(ctrl.message);
 ctrl.message = ftpParseControlReply(ctrl.buf,
 ctrl.offset, ctrl.replycode, bytes_used);
@@ -1810,7 +1806,7 @@
 if (ctrl.message == NULL) {

Re: debug statements to debugs statements

2007-04-28 Thread Henrik Nordstrom
lör 2007-04-28 klockan 00:14 +0300 skrev Tsantilas Christos:
 Here is the patch which converts the debug statements to debugs statements:
 http://www.chtsanti.net/others/CONVER_DEBUGS.diff
 It is not excellent but it is not so bad...

Applied with a bit of whitespace cleanup

 - Less aggressive folding of lines

 - Indent fixes little here and there. Maninly after if, or in switch
statemetnts.

Regards
Henrik


signature.asc
Description: Detta är en digitalt signerad	meddelandedel


Re: auth_ntlm broken?

2007-04-28 Thread Alex Rousskov
On Fri, 2007-04-27 at 21:11 +0200, Gernot Tenchio wrote:
 Hi developers,
 
 I've noticed that auth_ntlm does not work in current squid3-icap branch. As
 far as I remember squid crashed right after printing
 AuthNTLMUserRequest::authenticate: authenticated user XYZ.
 
 After looking into sources i saw two changes to auth_ntlm.cc. One is dated
 03-Jan-07 and the other is dated 20-Jan-07. They changing the way
 AUTHENTICATE_STATE_xxx is handled. After reverting these changes back to the
 version before 03-Jan-07, auth_ntlm works again as expected. What was the
 reason for these changes?

Hello,

Thank you for reporting the problem! It sounds like the changes you are
talking about came from the Squid HEAD branch. Perhaps they created a
conflict and the conflict was not resolved correctly. I will investigate
and try to fix.

Thank you,

Alex.
P.S. For the future, please post a diff of changes as it usually speeds
things up considerably.




Re: ICAP orphan files ?

2007-04-28 Thread Alex Rousskov
On Sat, 2007-04-28 at 21:15 +0200, Guido Serassio wrote:
 Hi,
 
 It seems to me that the following files in Squid 3 are orphaned:
 
 ICAP/ICAPClientStream.cc
 ICAP/ICAPClientStream.h

It looks like the functions these files provide are called from
client_side_reply.cc but the code is #ifdef-ed with
ICAP_CLIENT_RESPMOD_POSTCACHE, which is not defined anywhere. It sounds
like somebody was trying to get ICAP work with client streams long time
ago but did not get far or perhaps just wanted to provide hooks for
future use.

If there are not objections, I am going to remove the files and the
client_side_reply.cc code that references them. We should be able to
restore them from CVS if needed.

Thank you,

Alex.