Re: Announce: squid-3.0PRE3 (release candidate)

2003-08-20 Thread Henrik Nordstrom
On Tuesday 19 August 2003 19.28, Anand Kumria wrote:

   - configuration for the common case is vastly simpler
   - cleanup http proxying versus http acceleration seperation

   : these two changes make it trivial to get squid up and running

I assume you refer to the accel mode  only in the above two? The 
changes in non-accel mode is barely nothing..

   - improved authentication infrastructure

   : Easily! hook up NTLM, LDAP, NIS, etc.

This is not news for Squid-3.0.. the same infrastructure exists in 
Squid-2.5.

   - support encrypted peers, SSL gatewaying, SSL hardware
 acceleration - support for millions of clients

   : via epoll (Linux), kqueue (FreeBSD), completion ports(?)
   : (Win32)

These are still experimental features and need a fair bit of testing 
before pushed for.

   - enhanced reliability via an automated test suite,

This is news, but not really visible to others than developers.

   - native Win32 port, take over ISA one server at a time

The win32 port is still a little experimental and an ongoing effort 
and is not yet fully merged into Squid-3.

 Remember, Lies, damned lies and marketing material. Or similiar.



Reading the release notes one more time I see several entries which 
does not belong here as they came from Squid-2.5.

Regards
Henrik


CE(gzip) for squid-2.5STABLE3

2003-08-20 Thread Gonzalo Arana
Hi,

I wrote a mail a couple of days ago asking for guidelines about adding
Content-Encoding: gzip support for squid.
I have been working, but now I'm stucked.

I modified clientSendMoreData this way (see attached patch for more
detailed info):

  if (http-out.offset == 0) {
   check if log mime headers
   rep = clientBuildReply(http, buf, size);
   if (rep) {
 body too large check
   if (must_compress) {
  compress 'size' bytes located at 'buf', producing 'zbytes'
 of compressed bytes in zipped_buff.
  size = zbytes - rep-hdr_sz;
  memcpy(buf + rep-hdr_sz, zipped_buff, zbytes);
   }
 ...
   } else if (!http-request-range) {
   if (must_compress) {
   compress 'size' bytes located at 'buf' to zipped_buf
   body_size += zbytes - pbytes;
   size = zbytes;
   memcpy(buf, zipped_buf, zbytes);
   }
 http-out.offset += body_size;
 comm_write(fd, buf, size, clientWriteBodyComplete, http, NULL);
 /* NULL because clientWriteBodyComplete frees it */
 return;
 }
 ...

And the call sequence from cache_log is this (omitting some entries):

clientProcessRequest: GET $URL
clientProcessRequest: TCP_MISS for $URL
clientProcessMiss: 'GET URL'
storeClientCopy: $HASH_KEY, seen 0, want 0, size 4096
storeClientCopy2: $HASH_KEY
storeClientCopy3: Waiting for more
storeClientCopy2: $HASH_KEY
storeClientCopy3: Copying from memory (1368 bytes, hi=1368, lo=0)
 reply got from server is 1368 bytes = 133 headers + 1335 body
clientSendMoreData: $URL, 1368 bytes
clientSendMoreData: FD 9 '$URL', out.offset=0
clientBuildReplyHeader: can't keep-alive, unknown body size
clientSendMoreData: (no data sent yet) (http-out.offset == 0)
gzip_data: Got 1235 bytes, out avail 4086 bytes
 have 1235 plain bytes and 4k zipped buffer to write output
 gzip_data writes 10 bytes (gzip header) to outbuffer.
clientSendMoreData: Appending 10 bytes after 133 bytes of headers
clientSendMoreData: packed reply: 207 bytes
 reply sent to client has: 207 bytes header + 10 bytes content
 more content may come later
clientSendMoreData: queueing mb(217 bytes) and clientWriteComplete
clientWriteComplete: FD 9, sz 217, err 0, off 143, len -1
storeClientCopy: $HASH_KEY, seen 143, want 143, size 4096, cb !NULL,
cbdata !NULL
storeClientCopy2: $HASH_KEY
storeClientCopy3: Copying from memory (1225 bytes, hi=1368, lo=0)
 ok, here comes my problem:
 1235 bytes have been 'eaten' by last call to clientSendMoreData-
 gzip_data, but storeClientCopy3 thinks it has only 'consumed' 10
 bytes.
 Should I alter http-entry-mem_obj-inmem_hi??

I guess storeClientCopy3 thinks that 10 bytes has been 'consumed'
because http-out.offset has been incremented by 10, rather than 1335
(original body size so far).

How should I fix this? I mean, clientSendMoreData is called with data is
has already processed.

Thank you very much in advance,

-- 
Gonzalo Arana [EMAIL PROTECTED]
UOL-Sinectis S.A.
--- squid-2.5.STABLE3/src/client_side.c Sat May 24 08:08:41 2003
+++ squid-2.5.STABLE3-visolve_tcp_rtsignal-gzip/src/client_side.c   Wed Aug 20 
15:31:24 2003
@@ -1395,57 +1396,87 @@
getMyHostname(), ntohs(Config.Sockaddr.http-s.sin_port));
 #endif
 if (httpReplyBodySize(request-method, rep)  0) {
debug(33, 3) (clientBuildReplyHeader: can't keep-alive, unknown body size\n);
request-flags.proxy_keepalive = 0;
 }
 /* Signal keep-alive if needed */
 httpHeaderPutStr(hdr,
http-flags.accel ? HDR_CONNECTION : HDR_PROXY_CONNECTION,
request-flags.proxy_keepalive ? keep-alive : close);
 #if ADD_X_REQUEST_URI
 /*
  * Knowing the URI of the request is useful when debugging persistent
  * connections in a client; we cannot guarantee the order of http headers,
  * but X-Request-URI is likely to be the very last header to ease use from a
  * debugger [hdr-entries.count-1].
  */
 httpHeaderPutStr(hdr, HDR_X_REQUEST_URI,
http-entry-mem_obj-url ? http-entry-mem_obj-url : http-uri);
 #endif
+
+#if USE_CEGZIP
+/* If no ranges involved, and
+ * client accepts gzipped data, and
+ * content isn't alreadly 'encoded' (compressed, or something else)
+ */
+if (!request-range 
+(httpHeaderGetAcceptEncoding(http-request-header)  ENCODING_GZIP) 
+   !httpHeaderGetContentEncoding(rep-header)) {
+int cl = 9; /* //TODO: write CompressionLevel(); */
+
+/* if client accepts gzipped data
+* and acls are matched, do compress.
+*/
+httpHeaderPutStr(hdr, HDR_CONTENT_ENCODING, gzip);
+assert(http-conn);
+debug(33, 3)(Setting compression %d level on fd %d\n, cl, http-conn-fd);
+http-compress.level = cl;
+http-compress.offset = rep-hdr_sz; /* //TODO: set to header size */
+http-compress.gzdata = xmalloc(sizeof(z_stream)); /* //TODO: use mem pools 
instead */
+/* //TODO: where should I free gzdata */
+ deflateInit2(http-compress.gzdata, http-compress.level,
+  

Re: squid-2.5 and coss

2003-08-20 Thread Duane Wessels
 Well, theoretically, I should be able to easily forwardport my COSS changes
 to 3.0 once I know it works. Believe me, once its running I'm going to be
 looking to move to 3.0. kqueue and epoll are my next thing to sell. :)

Adrian,

FYI, my coss changes have not been commited to squid-3 yet because

   - I was going to wait until the time when it is okay to
 commit non-bugs to the tree.

   - I haven't figured out the new magic OO way of doing cache_dir
 options yet.

DW


Re: Many wrong debug section in 2.5 and HEAD

2003-08-20 Thread Robert Collins
On Thu, 2003-08-21 at 08:00, Henrik Nordstrom wrote:

 Regarding Squid-3.0 it is Roberts call.

Slate it for 3.1. I'm not particularly concerned about this today - and
we have plenty of debug cleanup stuff already slated - removing
typecasts being huge.

I'd rather have 'someone' do an audit post-3.0, replacing all debug()
uses with debugs() and fixing up the sections at the same time.

Cheers,
Rob
-- 
GPG key available at: http://members.aardvark.net.au/lifeless/keys.txt.


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


Re: squid-2.5 and coss

2003-08-20 Thread Robert Collins
On Thu, 2003-08-21 at 05:45, Duane Wessels wrote:

 FYI, my coss changes have not been commited to squid-3 yet because
 
- I was going to wait until the time when it is okay to
  commit non-bugs to the tree.

And on this note - anything that is ok to checkinto the Stable 2.5 tree
is ok to commit into the 3.0 tree.

It is feature-frozen, but by definition anything going into 2.5 is a
bugfix :}.

Cheers,
Rob
-- 
GPG key available at: http://members.aardvark.net.au/lifeless/keys.txt.


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


Re: CE(gzip) for squid-2.5STABLE3

2003-08-20 Thread Robert Collins
On Thu, 2003-08-21 at 05:00, Gonzalo Arana wrote:

 I guess storeClientCopy3 thinks that 10 bytes has been 'consumed'
 because http-out.offset has been incremented by 10, rather than 1335
 (original body size so far).
 
 How should I fix this? I mean, clientSendMoreData is called with data is
 has already processed.

You are running into the limitations in 2.5 that prevent easy CE.

You need to do what Henrik suggested: pipe the compressed data out via a
new StoreEntry, and that StoreEntry's data is what will actually get
sent to the client.

Cheers,
Rob
-- 
GPG key available at: http://members.aardvark.net.au/lifeless/keys.txt.


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