Re: cvs commit: squid3/src ftp.cc

2007-08-13 Thread Guido Serassio

Hi Amos,

At 01.57 13/08/2007, Amos Jeffries wrote:

amosjeffries2007/08/12 17:57:28 MDT

  Modified files:
src  ftp.cc
  Log:
  Fix bug 1560 : Bad filedescriptor in ftpSend actions.



Something is missing in your commit:

if /usr/bin/g++-3.4 -DHAVE_CONFIG_H 
-DDEFAULT_CONFIG_FILE=\/usr/local/squid3/etc/squid.conf\ -I. -I. 
-I../include -I. -I. -I../include -I../include 
-I../lib/libTrie/include   -I/usr/include/libxml2  -Werror -Wall 
-Wpointer-arith -Wwrite-strings -Wcomments  -D_REENTRANT -m32 
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -MT ftp.o -MD -MP 
-MF $depbase.Tpo -c -o ftp.o ftp.cc; \

then mv -f $depbase.Tpo $depbase.Po; else rm -f $depbase.Tpo; exit 1; fi
ftp.cc: In function `void ftpSendUser(FtpStateData*)':
ftp.cc:1859: error: `haveControlChannel' undeclared (first use this function)
ftp.cc:1859: error: (Each undeclared identifier is reported only once 
for each function it appears in.)

ftp.cc: In function `void ftpSendPass(FtpStateData*)':
ftp.cc:1893: error: `haveControlChannel' undeclared (first use this function)
ftp.cc: In function `void ftpSendType(FtpStateData*)':
ftp.cc:1922: error: `haveControlChannel' undeclared (first use this function)
ftp.cc: In function `void ftpSendCwd(FtpStateData*)':
ftp.cc:2047: error: `haveControlChannel' undeclared (first use this function)
ftp.cc: In function `void ftpSendMkdir(FtpStateData*)':
ftp.cc:2101: error: `haveControlChannel' undeclared (first use this function)
ftp.cc: In function `void ftpSendMdtm(FtpStateData*)':
ftp.cc:2155: error: `haveControlChannel' undeclared (first use this function)
ftp.cc: In function `void ftpSendSize(FtpStateData*)':
ftp.cc:2185: error: `haveControlChannel' undeclared (first use this function)
ftp.cc: In function `void ftpSendPasv(FtpStateData*)':
ftp.cc:2234: error: `haveControlChannel' undeclared (first use this function)
ftp.cc: In function `void ftpSendPort(FtpStateData*)':
ftp.cc:2510: error: `haveControlChannel' undeclared (first use this function)
ftp.cc: In function `void ftpSendStor(FtpStateData*)':
ftp.cc:2639: error: `haveControlChannel' undeclared (first use this function)
ftp.cc: In function `void ftpSendRest(FtpStateData*)':
ftp.cc:2704: error: `haveControlChannel' undeclared (first use this function)
ftp.cc: In function `void ftpSendList(FtpStateData*)':
ftp.cc:2762: error: `haveControlChannel' undeclared (first use this function)
ftp.cc: In function `void ftpSendNlst(FtpStateData*)':
ftp.cc:2779: error: `haveControlChannel' undeclared (first use this function)
ftp.cc: In function `void ftpSendRetr(FtpStateData*)':
ftp.cc:2833: error: `haveControlChannel' undeclared (first use this function)
ftp.cc: In function `void ftpSendQuit(FtpStateData*)':
ftp.cc:2940: error: `haveControlChannel' undeclared (first use this function)
ftp.cc: In function `bool haveControlChannel(const char*)':
ftp.cc:3405: error: `bool haveControlChannel(const char*)' used prior 
to declaration

ftp.cc:3406: error: `doneWithServer' undeclared (first use this function)
make[3]: *** [ftp.o] Error 1
make[3]: Leaving directory `/home/serassio/squid-cache.org/squid3/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/serassio/squid-cache.org/squid3/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/serassio/squid-cache.org/squid3/src'
make: *** [all-recursive] Error 1

Regards

Guido


  This was caused by some FTP operations failing and calling the ftpFail
  properly, but then going on to call an ftpSend.
  It may also occur when a ftpSend event is scheduled prior to the server
  control channel dying or being closed.

  This patch adds a function haveControlChannel(const char *caller_name)
  which displays a debug notice at level 3 and returns false if the server
  control channels are not available. This is now called by each Sending
  operation before it begins.

  Revision  ChangesPath
  1.433 +76 -3 squid3/src/ftp.cc



-

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: squid3-ipv6 squid3/src HttpHeader.cc,1.18.4.8,1.18.4.9 cache_manager.cc,1.7.8.3,1.7.8.4 client_db.cc,1.5.4.14,1.5.4.15 event.cc,1.5.8.5,1.5.8.6

2007-08-13 Thread Alex Rousskov
On Fri, 2007-08-10 at 23:35 +1200, Amos Jeffries wrote:
 Any objections to these going into 3-HEAD?
 Baring the seconds precision drop to 3dp (aka ms), its all whitespace.

White space changes are obviously OK. If change in precision affects
statistics reporting only, then it should be OK as well.

Thank you,

Alex.




Re: cvs commit: squid3/src ftp.cc

2007-08-13 Thread Alex Rousskov
On Mon, 2007-08-13 at 12:01 +0200, Guido Serassio wrote:

 Now fixed.

If you have time, it may be better to replace a virtual
FtpStateData::haveControlChannel(char*) into a static
FtpStateData::HaveControlChannel(FtpStateData*, char*) and let it check
the ftpState pointer itself. This will avoid more code repetition and
may even work faster.

I would also suggest to use a different method name since the code
assumes it is only called to detect attempts to call a method when a
control channel is open. Also, doneWithServer() actually checks for the
presence of both data and control channels.

Thank you,

Alex.




Re: Squid 3 build error using Visual Studio

2007-08-13 Thread Alex Rousskov
On Sat, 2007-08-11 at 23:06 +0200, Serassio Guido wrote:
 Hi,
 
 Trying to build the current Squid 3 source using Visual Studio 2005 
 on Windows, I get the following error.
 Any C++ suggestion ?
 
 Compiling...
 mem.cc
 c:\work\nt-3.0\src\StoreEntryStream.h(119) : error C2512: 
 'std::basic_ostream_Elem,_Traits' : no appropriate default 
 constructor available
  with
  [
  _Elem=char,
  _Traits=std::char_traitschar
  ]

This is with the code recently synced with HEAD, right?

Please try the attached untested patch. It follows the suggestions at
the page found by Amos:
http://www.codecomments.com/archive292-2005-2-396222.html

 Thanks for the link, but, I have really understand nothing  :-(
 Really I hate C++ :-(

Is it a good idea to hate something you do not understand? :-)

Alex.

std::ostream may not have a default constructor on Windows so we need
to supply a NULL buffer and then change the buffer to ours.
Index: src/StoreEntryStream.h
===
RCS file: /cvsroot/squid/squid3/src/StoreEntryStream.h,v
retrieving revision 1.4
diff -u -r1.4 StoreEntryStream.h
--- src/StoreEntryStream.h	7 Aug 2007 20:02:51 -	1.4
+++ src/StoreEntryStream.h	13 Aug 2007 16:41:26 -
@@ -116,7 +116,11 @@
 
 public:
 /* create a stream for writing text etc into theEntry */
-StoreEntryStream(StoreEntry *entry): theBuffer(entry) { this-init(theBuffer); }
+// See http://www.codecomments.com/archive292-2005-2-396222.html
+StoreEntryStream(StoreEntry *entry): std::ostream(0), theBuffer(entry) {
+rdbuf(theBuffer); // set the buffer to now-initialized theBuffer
+clear(); //clear badbit set by calling init(0)
+}
 
 private:
 StoreEntryStreamBuf theBuffer;


Re: cvs commit: squid3/src BodyPipe.cc BodyPipe.h

2007-08-13 Thread Amos Jeffries
 rousskov2007/08/13 10:48:20 MDT

snip
 The new code also keeps track
 of the
   number of outstanding events and skips that number if the consumer
 leaves.

   TODO:  when AscyncCall support is improved, should we just schedule
 calls
   directly to consumer? It could be a much cleaner solution than counting
   pending calls and skipping them when needed.


You mean like client-streams was meant to be (I think, after only a few
days reading the code and a bias from work on other real-time
applications).
Where only the tail gets event calls and read events pull as much buffer
data through the chain as possible?

Amos




Documentation bugs

2007-08-13 Thread Mark Nottingham

I've filed a number of bugs against squid.conf;

http://www.squid-cache.org/bugs/show_bug.cgi?id=1952
http://www.squid-cache.org/bugs/show_bug.cgi?id=1953
http://www.squid-cache.org/bugs/show_bug.cgi?id=1954
http://www.squid-cache.org/bugs/show_bug.cgi?id=1955
http://www.squid-cache.org/bugs/show_bug.cgi?id=2047
http://www.squid-cache.org/bugs/show_bug.cgi?id=2051
http://www.squid-cache.org/bugs/show_bug.cgi?id=1977

What's the best way to get these incorporated? IME they tend to  
confuse first-time (and not-so-first-time) Squid admins.


Cheers,

--
Mark Nottingham   [EMAIL PROTECTED]




Re: Documentation bugs

2007-08-13 Thread Henrik Nordstrom
On tis, 2007-08-14 at 11:25 +1000, Mark Nottingham wrote:

 What's the best way to get these incorporated?

To do what you just did.. keep reminding us.

Regards
Henrik


signature.asc
Description: This is a digitally signed message part