Commit e37c8984 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

Tell svn to ignore core files.

* src/server/testsuite: Ignore core and vgcore.*.

Replaced the "Client host" and "Client port" configuration file
parameters with "Listen", and allow lyskomd to listen to more than
one port.
* doc/lyskomd.texi (Parameters): Replaced "Client host" and
"Client port" with "Listen".
* src/server/ramkomd.c (start_listen_sockets): New static
function.  Listen to all the ports specified by the "Listen:"
parameter.
(server_init): Use start_listen_sockets() instead of calling
isc_listentcp().  Removed the host and client_port arguments.  All
callers updated.
* src/server/testsuite/lyskomd.0/54.exp: New test suite.
* src/server/conf-file.c (ctor_ipport_list): New static function.
(dtor_ipport_list): New static function.
(assign_ipport_list): New static function.
(cf_ipport_list): New constant.
* src/server/conf-file.h (struct ipport_entry): New struct.
(struct ipport_list): New struct.
(cf_ipport_list): New constant.
* src/server/param.h (struct kom_par): Replaced "ip_client_host"
and "ip_client_port" with "listen".
* src/server/server-config.c (parameters): Ditto.
* src/server/prot-a-parse-arg-c.awk: Include "conf-file.h" from
the generated files.
* src/server/admin.c: Include "conf-file.h".
* src/server/aux-items.c: Ditto.
* src/server/checkkomspace.c: Ditto.
* src/server/conference.c: Ditto.
* src/server/connections.c: Ditto.
* src/server/dbck-cache.c: Ditto.
* src/server/dbck.c: Ditto.
* src/server/disk-end-of-atomic.c: Ditto.
* src/server/komrunning.c: Ditto.
* src/server/lockdb.c: Ditto.
* src/server/membership.c: Ditto.
* src/server/person.c: Ditto.
* src/server/prot-a-output.c: Ditto.
* src/server/prot-a-parse.c: Ditto.
* src/server/prot-a.c: Ditto.
* src/server/regex-match.c: Ditto.
* src/server/rfc931.c: Ditto.
* src/server/send-async.c: Ditto.
* src/server/session.c: Ditto.
* src/server/simple-cache.c: Ditto.
* src/server/splitkomdb.c: Ditto.
* src/server/text-garb.c: Ditto.
* src/server/text.c: Ditto.
* src/server/updateLysKOM.c: Ditto.
* run-support/config: Removed the "Client port" setting.

Adjust the test suite for the above change.
* src/server/testsuite/lyskomd.0/bug-64.exp: Expect memory leaks
due to bug 1599.
* src/server/testsuite/lyskomd.0/53.exp: Expect a more informative
error message when isc_listentcp fails.
* src/server/testsuite/lyskomd.0/11.exp: Expect an IP address in
the "Listening for clients" log message.
* src/server/testsuite/config/unix.exp (clientport_2): New
constant.
(clientport_3): New constant.
(lyskomd_start): New argument: listen_messages.  Use "Listen:"
instead of "Client port:".
(lyskomd_fail_start): Use "Listen:" instead of "Client port:".
(client_start): New optional argument: port.
parent 4c6723a9
2006-04-24 Per Cederqvist <ceder@lysator.liu.se>
Tell svn to ignore core files.
* src/server/testsuite: Ignore core and vgcore.*.
Replaced the "Client host" and "Client port" configuration file
parameters with "Listen", and allow lyskomd to listen to more than
one port.
* doc/lyskomd.texi (Parameters): Replaced "Client host" and
"Client port" with "Listen".
* src/server/ramkomd.c (start_listen_sockets): New static
function. Listen to all the ports specified by the "Listen:"
parameter.
(server_init): Use start_listen_sockets() instead of calling
isc_listentcp(). Removed the host and client_port arguments. All
callers updated.
* src/server/testsuite/lyskomd.0/54.exp: New test suite.
* src/server/conf-file.c (ctor_ipport_list): New static function.
(dtor_ipport_list): New static function.
(assign_ipport_list): New static function.
(cf_ipport_list): New constant.
* src/server/conf-file.h (struct ipport_entry): New struct.
(struct ipport_list): New struct.
(cf_ipport_list): New constant.
* src/server/param.h (struct kom_par): Replaced "ip_client_host"
and "ip_client_port" with "listen".
* src/server/server-config.c (parameters): Ditto.
* src/server/prot-a-parse-arg-c.awk: Include "conf-file.h" from
the generated files.
* src/server/admin.c: Include "conf-file.h".
* src/server/aux-items.c: Ditto.
* src/server/checkkomspace.c: Ditto.
* src/server/conference.c: Ditto.
* src/server/connections.c: Ditto.
* src/server/dbck-cache.c: Ditto.
* src/server/dbck.c: Ditto.
* src/server/disk-end-of-atomic.c: Ditto.
* src/server/komrunning.c: Ditto.
* src/server/lockdb.c: Ditto.
* src/server/membership.c: Ditto.
* src/server/person.c: Ditto.
* src/server/prot-a-output.c: Ditto.
* src/server/prot-a-parse.c: Ditto.
* src/server/prot-a.c: Ditto.
* src/server/regex-match.c: Ditto.
* src/server/rfc931.c: Ditto.
* src/server/send-async.c: Ditto.
* src/server/session.c: Ditto.
* src/server/simple-cache.c: Ditto.
* src/server/splitkomdb.c: Ditto.
* src/server/text-garb.c: Ditto.
* src/server/text.c: Ditto.
* src/server/updateLysKOM.c: Ditto.
* run-support/config: Removed the "Client port" setting.
Adjust the test suite for the above change.
* src/server/testsuite/lyskomd.0/bug-64.exp: Expect memory leaks
due to bug 1599.
* src/server/testsuite/lyskomd.0/53.exp: Expect a more informative
error message when isc_listentcp fails.
* src/server/testsuite/lyskomd.0/11.exp: Expect an IP address in
the "Listening for clients" log message.
* src/server/testsuite/config/unix.exp (clientport_2): New
constant.
(clientport_3): New constant.
(lyskomd_start): New argument: listen_messages. Use "Listen:"
instead of "Client port:".
(lyskomd_fail_start): Use "Listen:" instead of "Client port:".
(client_start): New optional argument: port.
2006-02-09 Per Cederqvist <ceder@lysator.liu.se> 2006-02-09 Per Cederqvist <ceder@lysator.liu.se>
   
Added valgrind suppressions for optimised code. Added valgrind suppressions for optimised code.
......
...@@ -282,17 +282,24 @@ Do not send any non-requested messages. This disables the sending of ...@@ -282,17 +282,24 @@ Do not send any non-requested messages. This disables the sending of
messages about events in the server to all connections. Use of this messages about events in the server to all connections. Use of this
parameter is not recommended. Default is on. parameter is not recommended. Default is on.
@item Client host: @var{hostname} @item Listen: @var{portname}
Specify which IP number the server should use when listening for new @itemx Listen: @var{hostname}:@var{portname}
clients. @var{hostname} may be a FQDN (such as
@samp{kom.lysator.liu.se}) or an IP number (such as @samp{10.0.0.1}). Specify which IP number and port the server should use when listening
Default is to bind @code{INADDR_ANY}, which means that the server will for new clients. @var{hostname} may be a FQDN (such as
listen to all IP numbers of the computer it is running on. @samp{kom.lysator.liu.se}), an IPv4 address (such as @samp{10.0.0.1}),
or an IPv6 address enclosed in brackets (such as
@item Client port: @var{portname} @samp{[2001:db8::a00:20ff:fea7:ccea]}. If a FQDN resolves to several
Listen for new clients on port @var{portname}. The default is 4894, which IP addresses, it is undefined if the server will listen to all of them
is what all clients expect. Do not change this parameter without really or just pick one of them, so avoid that situation. If the
good reason. @var{portname} is the empty string, the default value of @code{4894}
will be used.
The default is @code{4894} (listen to port 4894 on all interfaces).
These parameters can be specified several times to cause the server to
listen to many ports and/or interfaces. The default is removed if
this parameter is specified at least once.
@item Presentation of conferences: @var{int} @item Presentation of conferences: @var{int}
The number of the conference where presentations should be sent. The number of the conference where presentations should be sent.
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
# the lyskom.info file. # the lyskom.info file.
# Mandatory options: # Mandatory options:
Client port: 4894
Max conferences: 4765 Max conferences: 4765
Max texts: 2000000 Max texts: 2000000
......
2006-04-24 Per Cederqvist <ceder@lysator.liu.se>
* src/isc_tcp.c (isc_listentcp): Make a single attempt to bind the
port. Don't retry if we get EADDRINUSE. The old code could leak
memory.
* src/isc_master.c (isc_initialize): Don't set openretries.
* src/intern.h (ISC_DEFAULT_MAX_OPEN_RETRIES): Removed.
(struct isc_session_cfg): Removed openretries.
(FOR_EACH_AF): Made the documentation slightly more readable.
2006-02-09 Per Cederqvist <ceder@lysator.liu.se> 2006-02-09 Per Cederqvist <ceder@lysator.liu.se>
Fixed a memory leak. Fixed a memory leak.
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
#define ISC_DEFAULT_MAX_MSG_SIZE 8176 #define ISC_DEFAULT_MAX_MSG_SIZE 8176
#define ISC_DEFAULT_MAX_QUEUED_SIZE 50 #define ISC_DEFAULT_MAX_QUEUED_SIZE 50
#define ISC_DEFAULT_MAX_DEQUEUE_LEN 30 #define ISC_DEFAULT_MAX_DEQUEUE_LEN 30
#define ISC_DEFAULT_MAX_OPEN_RETRIES 10
#define ISC_DEFAULT_MAX_BACKLOG 50 #define ISC_DEFAULT_MAX_BACKLOG 50
/* /*
...@@ -138,7 +137,6 @@ struct isc_session_cfg ...@@ -138,7 +137,6 @@ struct isc_session_cfg
int queuedsize; /* Number of messages. */ int queuedsize; /* Number of messages. */
int queuedsize_bytes; /* Total number of bytes. */ int queuedsize_bytes; /* Total number of bytes. */
int dequeuelen; /* Number of messages to write at once. */ int dequeuelen; /* Number of messages to write at once. */
int openretries;
int backlog; int backlog;
} max; } max;
int fd_relocate; int fd_relocate;
...@@ -303,16 +301,19 @@ typedef unsigned long uint32_t; ...@@ -303,16 +301,19 @@ typedef unsigned long uint32_t;
* evaluates to second arg if first arg (of type * evaluates to second arg if first arg (of type
* enum sockaddrs) contains an AF_INET address or * enum sockaddrs) contains an AF_INET address or
* IPv6 is not used, otherwise to third arg. * IPv6 is not used, otherwise to third arg.
* FOR_EACH_AF: Takes 2 args; first is an int lvalue, second * FOR_EACH_AF: Takes 2 args; an int lvalue that will be bound to
* an int expression. For each available address * an address family, and a an expression
* family (from most preferred to last preferred), * returning int. The expression should return
* the second arg is evaluated with the address * zero on success. The int lvalue will be bound
* family assigned to the first arg, until it * to each available address family in turn (from
* evaluates to false (in which case the entire * most preferred to least preferred) and the
* macro expansion evaluates to false), or until * expression evaluated, until the expression
* there are no more address families, in which * indicates success by returning 0.
* case the entire macro expansion evaluates to *
* true. * The entire macro expansion evaluates to 0 if
* an expression succeded, or a true value if no
* expression succeeded.
*
* FOR_EACH_PF: As FOR_EACH_AF, but for protocol families * FOR_EACH_PF: As FOR_EACH_AF, but for protocol families
* instead of address families. * instead of address families.
* STORE_ADDR: First arg (enum sockaddrs) is checked for * STORE_ADDR: First arg (enum sockaddrs) is checked for
......
...@@ -82,7 +82,6 @@ isc_initialize(oop_source *event_source, ...@@ -82,7 +82,6 @@ isc_initialize(oop_source *event_source,
mcb->scfg->max.msgsize = ISC_DEFAULT_MAX_MSG_SIZE; mcb->scfg->max.msgsize = ISC_DEFAULT_MAX_MSG_SIZE;
mcb->scfg->max.queuedsize = ISC_DEFAULT_MAX_QUEUED_SIZE; mcb->scfg->max.queuedsize = ISC_DEFAULT_MAX_QUEUED_SIZE;
mcb->scfg->max.dequeuelen = ISC_DEFAULT_MAX_DEQUEUE_LEN; mcb->scfg->max.dequeuelen = ISC_DEFAULT_MAX_DEQUEUE_LEN;
mcb->scfg->max.openretries = ISC_DEFAULT_MAX_OPEN_RETRIES;
mcb->scfg->max.backlog = ISC_DEFAULT_MAX_BACKLOG; mcb->scfg->max.backlog = ISC_DEFAULT_MAX_BACKLOG;
mcb->scfg->fd_relocate = 0; mcb->scfg->fd_relocate = 0;
mcb->scfg->stale_timeout = timeval_ctor(3600, 0); mcb->scfg->stale_timeout = timeval_ctor(3600, 0);
......
...@@ -381,7 +381,6 @@ isc_listentcp(struct isc_mcb *mcb, ...@@ -381,7 +381,6 @@ isc_listentcp(struct isc_mcb *mcb,
isc_accept_callback *cb) isc_accept_callback *cb)
{ {
struct isc_scb_internal *scb; struct isc_scb_internal *scb;
int retries;
int errcode; int errcode;
...@@ -389,14 +388,8 @@ isc_listentcp(struct isc_mcb *mcb, ...@@ -389,14 +388,8 @@ isc_listentcp(struct isc_mcb *mcb,
if (!scb) if (!scb)
return NULL; return NULL;
for (retries = 0; retries < scb->cfg->max.openretries; sleep(1), retries++) errno = 0;
{ if (isc_bindtcp(scb, address, service) < 0)
errno = 0;
if (isc_bindtcp(scb, address, service) >= 0 || errno != EADDRINUSE)
break;
}
if (retries >= scb->cfg->max.openretries || errno != 0)
{ {
errcode = errno; errcode = errno;
isc_destroy(NULL, &scb->pub); isc_destroy(NULL, &scb->pub);
......
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
#include "kom-config.h" #include "kom-config.h"
#include "log.h" #include "log.h"
#include "send-async.h" #include "send-async.h"
#include "conf-file.h"
#include "param.h" #include "param.h"
#include "string-malloc.h" #include "string-malloc.h"
#include "services.h" #include "services.h"
......
...@@ -57,6 +57,7 @@ ...@@ -57,6 +57,7 @@
#include "log.h" #include "log.h"
#include "services.h" #include "services.h"
#include "admin.h" #include "admin.h"
#include "conf-file.h"
#include "param.h" #include "param.h"
#include "server-time.h" #include "server-time.h"
#include "string-malloc.h" #include "string-malloc.h"
......
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
#include "kom-config.h" #include "kom-config.h"
#include "misc-types.h" #include "misc-types.h"
#include "kom-types.h" #include "kom-types.h"
#include "conf-file.h"
#include "param.h" #include "param.h"
#include "version-info.h" #include "version-info.h"
#include "log.h" #include "log.h"
......
...@@ -525,6 +525,99 @@ assign_timeval(const char *val, ...@@ -525,6 +525,99 @@ assign_timeval(const char *val,
} }
static void
ctor_ipport_list(const struct parameter *par)
{
struct ipport_list *val = par->value;
val->size = 0;
val->entries = NULL;
}
static void
dtor_ipport_list(const struct parameter *par)
{
int i;
struct ipport_list *val = par->value;
for (i = 0; i < val->size; i++)
{
sfree(val->entries[i].ipaddr);
sfree(val->entries[i].port);
}
sfree(val->entries);
val->entries = NULL;
val->size = 0;
}
static Success
assign_ipport_list(const char *val,
const struct parameter *par)
{
struct ipport_list *list = par->value;
struct ipport_entry *entry;
const char *host_start = NULL;
const char *host_end = NULL;
const char *port_start = val;
if (val[0] == '[')
{
/* IPv6 address. */
#ifndef USE_INET6
kom_log("IPv6 address found in \"Listen:\" directive, but"
"IPv6 support not enabled in this build.\n");
return FAILURE;
#else
host_start = val + 1;
host_end = strchr(val, ']');
if (host_end == NULL)
{
kom_log("Unterminated IPv6 address: %s\n", val);
return FAILURE;
}
if (*(host_end+1) != ':')
{
kom_log("IPv6 address not followed by colon and port: %s\n", val);
return FAILURE;
}
port_start = host_end + 2;
#endif
}
else if ((host_end = strchr(val, ':')) != NULL)
{
/* IPv4 address or DNS name. */
host_start = val;
port_start = host_end + 1;
}
list->entries = srealloc(list->entries,
(list->size + 1) * sizeof(*list->entries));
entry = &list->entries[list->size];
list->size++;
if (host_start == NULL)
entry->ipaddr = NULL;
else
{
entry->ipaddr = smalloc(host_end - host_start + 1);
memcpy(entry->ipaddr, host_start, host_end - host_start);
entry->ipaddr[host_end - host_start] = '\0';
}
if (*port_start == '\0')
{
entry->port = smalloc(strlen(par->default_suffix) + 1);
strcpy(entry->port, par->default_suffix);
}
else
{
entry->port = smalloc(strlen(port_start) + 1);
strcpy(entry->port, port_start);
}
return OK;
}
const struct datatype cf_text_no = { const struct datatype cf_text_no = {
assign_text_no, NULL, NULL, assign_text_no, NULL, NULL,
}; };
...@@ -560,3 +653,7 @@ const struct datatype cf_double = { ...@@ -560,3 +653,7 @@ const struct datatype cf_double = {
const struct datatype cf_timeval = { const struct datatype cf_timeval = {
assign_timeval, NULL, NULL, assign_timeval, NULL, NULL,
}; };
const struct datatype cf_ipport_list = {
assign_ipport_list, ctor_ipport_list, dtor_ipport_list,
};
...@@ -70,4 +70,18 @@ extern const struct datatype cf_bool; ...@@ -70,4 +70,18 @@ extern const struct datatype cf_bool;
extern const struct datatype cf_double; extern const struct datatype cf_double;
extern const struct datatype cf_timeval; extern const struct datatype cf_timeval;
struct ipport_entry
{
char *ipaddr;
char *port;
};
struct ipport_list
{
int size;
struct ipport_entry *entries;
};
extern const struct datatype cf_ipport_list;
#endif #endif
...@@ -59,6 +59,7 @@ ...@@ -59,6 +59,7 @@
#include "lyskomd.h" #include "lyskomd.h"
#include "debug.h" #include "debug.h"
#include "send-async.h" #include "send-async.h"
#include "conf-file.h"
#include "param.h" #include "param.h"
#include "aux-items.h" #include "aux-items.h"
#include "local-to-global.h" #include "local-to-global.h"
......
...@@ -76,6 +76,7 @@ ...@@ -76,6 +76,7 @@
#include "send-async.h" #include "send-async.h"
#include "cache.h" #include "cache.h"
#include "rfc931.h" #include "rfc931.h"
#include "conf-file.h"
#include "param.h" #include "param.h"
#include "kom-config.h" #include "kom-config.h"
#include "kom-errno.h" #include "kom-errno.h"
......
...@@ -71,6 +71,7 @@ ...@@ -71,6 +71,7 @@
#include "kom-memory.h" #include "kom-memory.h"
#include "ram-parse.h" #include "ram-parse.h"
#include "ram-output.h" #include "ram-output.h"
#include "conf-file.h"
#include "param.h" #include "param.h"
#include "dbck-cache.h" #include "dbck-cache.h"
#include "local-to-global.h" #include "local-to-global.h"
......
...@@ -67,6 +67,7 @@ ...@@ -67,6 +67,7 @@
#include "kom-config.h" #include "kom-config.h"
#include "debug.h" #include "debug.h"
#include "dbck-cache.h" #include "dbck-cache.h"
#include "conf-file.h"
#include "param.h" #include "param.h"
#include "server-config.h" #include "server-config.h"
#include "async.h" #include "async.h"
......
...@@ -54,6 +54,7 @@ ...@@ -54,6 +54,7 @@
#include "cache.h" #include "cache.h"
#include "server/smalloc.h" #include "server/smalloc.h"
#include "kom-config.h" #include "kom-config.h"
#include "conf-file.h"
#include "param.h" #include "param.h"
#include "timeval-util.h" #include "timeval-util.h"
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
#include "server/smalloc.h" #include "server/smalloc.h"
#include "kom-config.h" #include "kom-config.h"
#include "server-config.h" #include "server-config.h"
#include "conf-file.h"
#include "param.h" #include "param.h"
#include "pidfile.h" #include "pidfile.h"
#include "linkansi.h" #include "linkansi.h"
......
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
#include "lockdb.h" #include "lockdb.h"
#include "log.h" #include "log.h"
#include "kom-types.h" #include "kom-types.h"
#include "conf-file.h"
#include "param.h" #include "param.h"
#include "lyskomd.h" #include "lyskomd.h"
......
...@@ -63,6 +63,7 @@ ...@@ -63,6 +63,7 @@
#include "send-async.h" #include "send-async.h"
#include "minmax.h" #include "minmax.h"
#include "kom-memory.h" #include "kom-memory.h"
#include "conf-file.h"
#include "param.h" #include "param.h"
#include "local-to-global.h" #include "local-to-global.h"
#include "server-time.h" #include "server-time.h"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment