dev-serveez
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[dev-serveez] changes (informational)


From: Raimund 'Raimi' Jacob
Subject: [dev-serveez] changes (informational)
Date: Thu, 15 Mar 2001 00:24:39 +0100 (CET)

hello!

(mgrabmue, there is a paragraph for you at the lower end of this msg)

ela and me had a discussion about changes required in libserveez so that
the guile switch will be possible. here is a little summary because i made
notes on paper and ela needs that stuff, too :-)

libserveez needs to provide semantics to create servers so that i can make
that funcionality available in the config file. there are 3 major parts:
1) ports    (corresponds to define-port!)
2) servers  (corresponds to define-server!)
3) bindings (corresponds to bind! (or however we're going to call it))


* 1) port maintainance:
- file: portcfg.c
- the portcfg_t gets reorganized so that is a union of structs
  this reflects the nature of a port better. draft:
  typedef union portcfg {
  int type;
  char *name;
  struct tcp_t {
   int port;
   <something> localaddr;
   } tcp;
  struct pipe_t {
   char *in;
   char *out;
   } pipe;
  }

  usage looks better then: switch (someportcfg.type) { .. }
  someportcfg.tcp.localaddr = ...

- the portcfg_ts maintained by libserveez are held in a hash associating
  names (the symbols from the config file) with portcfg_ts

* 2) servers
- file: server.c
- two major things to manage: server types (definitions) and instances
- servertypes: svz_array of server_definition thingies which perhaps get
  renamed to server_type or something
  (we need to clean up the terminology here, i think)
- svz_servertype_add (server_type) adds to the array and runs the
  initializer of that 'class'
- svz_servertype_del (index) removes servertype and runs finalizer of
  'class'
- server instances are held in a hash associating strings (the symbols
  from the config file) with server_t structs.
- server_t gets another member 'type' which is an index into the
  servertypes svz_array

* 3) binding
- file: binding.c
- major functionality: bind(portcfg_t, server_t):
- -create sock_t from information in portcfg_t
- -find equal sock_t in existing listeners
- -use that one when found, use the new one when not found
- -local adress of "*" results in one sock_t per local interface, we
   dont do any IPADDR_ANY binding.
- -THINKME: can we run into conflicts here? conflicting port definitions?
- the list of server_ts on a listening sock_t is a hack now, use svz_array

on a related note: on some systems we cannot determine the list of local
interfaces. binding.c should provide a method to set the list of local
interfaces explicitly. that function will be available as
define-local-interfaces! or something from guile.

changing the portcfg_t here is a wishlist of things to configure on a
port:

* all kind of portcfg_ts:
  - idle protection (client must be recognized within timespan)
  - hammer protection (same ip cannot connet twice within timespan)
    note: this is tricky and not urgent :-)
  - set initial buffer size

* tcp:
  - set backlog with SOMAXCONN as default

* pipes:
  - set access mode (chmod)
  - set group (chgrp)
  - set user (chown)
  - on each pipe, of course


another word on the guile switch: we decided to stay with the old
mechanism of knowing which kind of server to instantiate on
define-server!. we'll continue to require users to use 'http-someting' as
the server (instance) name of a http server. that schema is IOHO straight
forward :-)


thinking of dynamic reload there is another thing libserveez has to
provide to the config file:
something to add a path to the library search path.
something to trigger the loading of a library given a short name (like
'http').
ela wants to convice me that i should automagically load libraries when i
encounter a short name i dont know yet. still undecided.

mbrainmue: any opinion on any of the above ?


Bye,
    Raimi

--
      __/\     _/\    _____/\.___/\
     /   /    /  /___/   ____/  __/\     Name    : Raimi
    /   /  __/    __/   / __/  / _\/     Contact : address@hidden
   /   /__/ /     \/   /_/_/  /_/        Visit   : http://www.lkcc.org
  /________/___/\._\._____/_____/\       3.141592653589793238462643383
  \._______\.__\/__/\.____\.____\/       27950288419716939937510582097





reply via email to

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