Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2003:
[Freeciv-Dev] Re: (PR#3706) append the capstring
Home

[Freeciv-Dev] Re: (PR#3706) append the capstring

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: kaufman@xxxxxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#3706) append the capstring
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 12 Mar 2003 15:11:11 -0800
Reply-to: rt@xxxxxxxxxxxxxx

Mike Kaufman wrote:
> here's small patch that allows the server or client to append tokens to the
> capstring at runtime. This allows not only compile options like:
> 
> #ifdef FOO
>   append_capability("foo");
> #endif
> 
> but also things like server commandline options:
> 
> % ser --foo
> 
>   if (is_option("--foo", argv[inx])
>     append_capability("foo");
>   }
> 
> this will be nice for things like gzip compression in the server and server
> authentication.
> 
> -mike
> 
> PS: is there a reason why we need a capstr.c as well as a capability.c?

capability.c provides the code to handle capabilities; these are used 
for savegames, tilespec and specfiles, and network versioning.  capstr.c 
just provides the network versioning capstring.

Thus the append_capability function should go into capability.c, I would 
think.  Unfortunately, this is more complicated since other users don't 
have writable capstrings.  So perhaps it is not worthwhile.

It does look like you don't handle the error case properly.  What 
happens if the capstring buffer is overflowed?  Will freeciv just break? 
  Even in the second patch, when you return FALSE to indicate error, it 
still leaves you with an incorrect capstring.

jason




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