Article delegate-en/3787 of [1-5169] on the server localhost:119
  upper oldest olders older1 this newer1 newers latest
search
[Top/Up] [oldest] - [Older+chunk] - [Newer+chunk] - [newest + Check]

Newsgroups: mail-lists.delegate-en

[DeleGate-En] Re: Problem with Content-Encoding
28 Jun 2007 11:16:51 GMT "Bieber, Sebastian" <pyuhabdyi-ry4zqcnkfjvr.ml@ml.delegate.org>


Hi,

I just applied your patches to the original 9.5.6 version. Don't know if
this is of any interest to you, but i can confirm that the patched
version works perfecly!

Thanks again...

So long, 
Sebastian

-----Original Message-----
From: Yutaka Sato [mailto:feedback@delegate.org] 
Sent: Thursday, June 28, 2007 9:05 AM
To: feedback@delegate.org
Cc: Bieber, Sebastian; feedback@delegate.org
Subject: Re: [DeleGate-En:3788] Problem with Content-Encoding


Hi,

In message <_A3785@delegate-en.ML_> on
06/28/07(13:44:24)
you "Bieber, Sebastian" <pyuhabdyi-ry4zqcnkfjvr.ml@ml.delegate.org> wrote:
 |First, let me say "thanks a lot" for your quick answer. Applying the
patch to filter.c solved the problem described - now content is
compressed before sent to the client.
 |
 |Unfortunately, with the patch, the browser now displays the content in
it's compressed form (as a "dump" of the gzip'ed file)!
...
 |	Content-Encoding: gzip,deflate
...
 |The "Content-Encoding"-header is set to the list of acceptable
encodings received in the http request, it seems. This obviously
"confuses" the browser - my up-to-date firefox, at least.

Ooooops...

 |With this modification, content compression now works perfectly.

Your modification will be enough for most situtaion, but I should fix it
as the enclosed patch to cope with "x-gzip" (which might be obsolete)
and
to prepare to cope with "deflate".

Cheers,
Yutaka
--
  9 9   Yutaka Sato <y.sato@delegate.org> http://delegate.org/y.sato/
 ( ~ )  National Institute of Advanced Industrial Science and Technology
_<   >_ 1-1-4 Umezono, Tsukuba, Ibaraki, 305-8568 Japan
Do the more with the less -- B. Fuller


diff -cr ../delegate9.5.6/include/dglib.h ./include/dglib.h
*** ../delegate9.5.6/include/dglib.h	Wed Jan 31 08:37:40 2007
--- ./include/dglib.h	Thu Jun 28 15:49:58 2007
***************
*** 688,694 ****
--- 688,697 ----
  void  swfFilter(DGCTX,FILE *in,FILE *out,PCStr(arg));
  int   procSocket(DGC*Conn,PCStr(command),int sio[]);
  FILE *Gunzip(PCStr(enc),FILE *fs);
+ /*
  FILE *Gzip(PCStr(enc),FILE *src);
+ */
+ FILE *Gzip(PVStr(enc),FILE *src);
  
  int   fcloseFILE(FILE *fp);
  void  closeFDs(FILE *ifp,FILE *ofp);
diff -cr ../delegate9.5.6/src/filter.c ./src/filter.c
*** ../delegate9.5.6/src/filter.c	Sat Feb 17 19:11:05 2007
--- ./src/filter.c	Thu Jun 28 15:49:01 2007
***************
*** 503,517 ****
--- 503,525 ----
  }
  
  int systemFilter(PCStr(command),FILE *in,FILE *out);
+ /*
  FILE *Gzip(PCStr(enc),FILE *src)
+ */
+ FILE *Gzip(PVStr(enc),FILE *src)
  {	FILE *out;
  	int isize;
  	double Start;
+ 	const char *en;
  
  	if( !withGzip || gzip == 0 )
  		return 0;
  
+ 	/*
  	if( strcaseeq(enc,"gzip") || strcaseeq(enc,"x-gzip") ){
+ 	*/
+ 	if( isinListX(enc,en="gzip","c") ||
isinListX(enc,en="x-gzip","c") ){
+ 		strcpy(enc,en);
  		Start = Time();
  		out = TMPFILE("gzip");
  		if( streq(gzip,"-") ){
diff -cr ../delegate9.5.6/src/http.c ./src/http.c
*** ../delegate9.5.6/src/http.c	Wed Apr  4 09:53:19 2007
--- ./src/http.c	Thu Jun 28 15:55:18 2007
***************
*** 1147,1153 ****
--- 1147,1156 ----
  					fseek(in,0,0);
  					fseek(in,hsize,0);
  				}
+ 				/*
  				if( zip = Gzip(cencode,in) ){
+ 				*/
+ 				if( zip = Gzip(AVStr(cencode),in) ){
  					fseek(zip,0,0);
  					nleng = file_size(fileno(zip));
  					msize = hsize + nleng;

  admin search upper oldest olders older1 this newer1 newers latest
[Top/Up] [oldest] - [Older+chunk] - [Newer+chunk] - [newest + Check]
@_@V