Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2000:
[Freeciv-Dev] Re: zlib compression
Home

[Freeciv-Dev] Re: zlib compression

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: zlib compression
From: Lauri Tarkkala <ltarkkal@xxxxxxxxxxxxxxx>
Date: Wed, 30 Aug 2000 12:48:31 +0300

On Wed, Aug 30, 2000 at 06:55:17PM +1100, David Pfitzner wrote:
> Lauri Tarkkala <ltarkkal@xxxxxxxxxxxxxxx> wrote:
> 
> > I tinkered with my freeciv-net* patches some more, and added compression
> > of all network traffic using zlib. 
> 
> I just note that currently zlib is optional for compiling freeciv.
> Would this make it mandatory?  (I guess could support uncompressed
> traffic to connections without zlib support, but that would seem 
> to defeat much of the purpose...)  If so, do people think thats ok?

This is a simple implementation issue. Currently I thought that a
server and a client capability string of "zlib" or something might be
added. Then a server option of "zlibnetuse" could be used to
parametrize the server

- Require always compression
- Use compression if possible
- Never accept compression

I figure this ought to be "ok" for everybody. 

I guess a public server at freeciv.org would then always require 
compression, so yeah, one would probably have to dig up zlib on the 
client side to play on public servers, even if it was optional
at compile-time.

I agree that using "zlib" is a bit of a hack, but on the other hand,
it is relatively easy to do, allows people doing the packet stuff
not to think too much about efficiency (in terms of space), and
results in quite nice performance gains. 

zlib is also quite portable.

Currently binaries from the zlib homepage are available for:

- Irix 6.x
- HP-UX 10.20 and HP-UX 11
- Windows 9x/NT
- BeOS R5
- MacOS v ?
- OS/2 v ?

The zlib-1.1.3/README mentions that zlib can be compiled for

- VMS
- MS-DOS
- Digital UN*X and OSF/1

I also remember that zlib also compiles for Linux, *BSD and Solaris.

The zlib distribution also comes with a couple of Makefiles for Amiga.

Is there anyone who has experience that zlib cannot be made to work
on their platform?
 
> On a related note, do sane things happen for all the combinations
> of servers/clients with/without compression support trying to connect 
> to each other after this feature?

Should.  

Basically I put the zlib code in write_socket_data() and read_socket_data()
as another "layer" below the current socket handling functions
in common/connection.c

> (And BTW what is the current state of server I/O changes, and 
> "list clistat", independent of compression?  I lost track with 
> you and Vasco posting various patches back and forth :-)

My last patch to the list was "freeciv-net4.patch", which contained
an overhaul of sernet.c, a set of mods from Vasco and the "clistat"
command.

Vasco then posted after this yet another patch, which I have not had
yet time to look at and incorporate into my tinkering. 

Lauri

-- 
"The credit belongs to the man in the arena whose face is marred by dust and
sweat and blood, who strives valiantly, who errs, and who comes up short again
and again, who knows the great enthusiasms, the great devotions, and spends
himself in a worthy cause. The man who at best knows the triumph of high
achievement and who at worst, if he fails, fails while daring greatly, so that
his place will never be with those cold timid souls who never knew victory or
defeat." - Theodore Roosevelt



[Prev in Thread] Current Thread [Next in Thread]