obnox/misc.git
14 years agolisten_on_socket: only hand out the socket fd when the complet func succeede events
Michael Adam [Thu, 27 Aug 2009 11:51:37 +0000 (13:51 +0200)]
listen_on_socket: only hand out the socket fd when the complet func succeede

and log the success at level INFO

Michael

14 years agoaccept_connection: log accepted conneciton a level INFO, and log the fd
Michael Adam [Thu, 27 Aug 2009 11:49:03 +0000 (13:49 +0200)]
accept_connection: log accepted conneciton a level INFO, and log the fd

Michael

14 years agodebug: remove currently unneeded this_log_level
Michael Adam [Thu, 27 Aug 2009 11:48:25 +0000 (13:48 +0200)]
debug: remove currently unneeded this_log_level

Michael

14 years agocorrectly zero out a new event contex upon creation.
Michael Adam [Thu, 27 Aug 2009 11:47:11 +0000 (13:47 +0200)]
correctly zero out a new event contex upon creation.

Michael

14 years agobuild with debugging symbols
Michael Adam [Thu, 27 Aug 2009 11:45:44 +0000 (13:45 +0200)]
build with debugging symbols

Michael

14 years agoevent_loop_once: only ever run one event handler in one loop...
Michael Adam [Thu, 27 Aug 2009 10:24:17 +0000 (12:24 +0200)]
event_loop_once: only ever run one event handler in one loop...

Michael

14 years agoMakefile: use variable "CC" that we have...
Michael Adam [Thu, 27 Aug 2009 10:23:56 +0000 (12:23 +0200)]
Makefile: use variable "CC" that we have...

Michael

14 years agoquad_client_loop: make address of host to connect to configurable by "-h"
Michael Adam [Thu, 27 Aug 2009 10:21:07 +0000 (12:21 +0200)]
quad_client_loop: make address of host to connect to configurable by "-h"

Michael

14 years agoquad_server: make listen address configurable by new parameter "-l"
Michael Adam [Thu, 27 Aug 2009 10:20:41 +0000 (12:20 +0200)]
quad_server: make listen address configurable by new parameter "-l"

Michael

14 years agoevents_loop_once : concatenate if statements
Michael Adam [Thu, 27 Aug 2009 10:20:02 +0000 (12:20 +0200)]
events_loop_once : concatenate if statements

Michael

14 years agoquad_server: listen on the ipv4 wildcard address by default
Michael Adam [Thu, 27 Aug 2009 10:14:33 +0000 (12:14 +0200)]
quad_server: listen on the ipv4 wildcard address by default

Michael

14 years agoadd dlist.h - macros for doubly linked lists (not used - yet)
Michael Adam [Thu, 27 Aug 2009 10:12:59 +0000 (12:12 +0200)]
add dlist.h - macros for doubly linked lists (not used - yet)

Michael

14 years agoquad_server: make port and debug level configurable via getopt.
Michael Adam [Thu, 27 Aug 2009 10:11:07 +0000 (12:11 +0200)]
quad_server: make port and debug level configurable via getopt.

Michael

14 years agoquad_client_loop: end the event loop when there are no events left.
Michael Adam [Thu, 27 Aug 2009 10:10:20 +0000 (12:10 +0200)]
quad_client_loop: end the event loop when there are no events left.

Michael

14 years agoquad_client_loop: use strdup, not asprintf
Michael Adam [Thu, 27 Aug 2009 10:09:31 +0000 (12:09 +0200)]
quad_client_loop: use strdup, not asprintf

Michael

14 years agotrack number of registered events in event_context
Michael Adam [Thu, 27 Aug 2009 09:44:54 +0000 (11:44 +0200)]
track number of registered events in event_context

and provide an accessor event_num_events()

Michael

14 years agoquad_client_loop: make log level, num clients, num iterations and port configurable...
Michael Adam [Thu, 27 Aug 2009 08:15:49 +0000 (10:15 +0200)]
quad_client_loop: make log level, num clients, num iterations and port configurable from cmdline.

Michael

14 years agoadd a event-loop based variant of the quad client.
Michael Adam [Wed, 26 Aug 2009 23:55:14 +0000 (01:55 +0200)]
add a event-loop based variant of the quad client.

Michael

14 years agoallocate (and free) the data passed to the write handler
Michael Adam [Wed, 26 Aug 2009 21:17:12 +0000 (23:17 +0200)]
allocate (and free) the data passed to the write handler

Michael

14 years agoevents.c: convert one forgotten fprintf->DEBUG
Michael Adam [Wed, 26 Aug 2009 20:49:05 +0000 (22:49 +0200)]
events.c: convert one forgotten fprintf->DEBUG

Michael

14 years agouse DEBUG instead of fprintf in sockets.c
Michael Adam [Wed, 26 Aug 2009 20:48:18 +0000 (22:48 +0200)]
use DEBUG instead of fprintf in sockets.c

Michael

14 years agoutils: use DEBUG instead of fprintf
Michael Adam [Wed, 26 Aug 2009 20:38:49 +0000 (22:38 +0200)]
utils: use DEBUG instead of fprintf

Michael

14 years agouse DEBUG in quad_server.c
Michael Adam [Wed, 26 Aug 2009 20:36:04 +0000 (22:36 +0200)]
use DEBUG in quad_server.c

Michael

14 years agoevents: fix segfault caused by removed events
Michael Adam [Wed, 26 Aug 2009 20:35:35 +0000 (22:35 +0200)]
events: fix segfault caused by removed events

Michael

14 years agoMakfile: use variable CC
Michael Adam [Wed, 26 Aug 2009 20:33:05 +0000 (22:33 +0200)]
Makfile: use variable CC

Michael

14 years agouse DEBUG in events.c and adapt Makfile accordingly
Michael Adam [Tue, 25 Aug 2009 22:34:09 +0000 (00:34 +0200)]
use DEBUG in events.c and adapt Makfile accordingly

14 years agoadd debug.c/h
Michael Adam [Tue, 25 Aug 2009 22:16:34 +0000 (00:16 +0200)]
add debug.c/h

Michael

14 years agoadd private data to events, enhance logging, several fixes.
Michael Adam [Tue, 25 Aug 2009 22:13:26 +0000 (00:13 +0200)]
add private data to events, enhance logging, several fixes.

Michael

14 years agoadd struct event_context and use this instead of global list of fd events.
Michael Adam [Mon, 24 Aug 2009 14:52:39 +0000 (16:52 +0200)]
add struct event_context and use this instead of global list of fd events.

users of the event systeme need to call event_context_init() first, in order
to allocate a new event context and then pass that context around to all
calls to event functions.

Michael

14 years agochange (un)register_event() to return int as status.
Michael Adam [Fri, 21 Aug 2009 09:54:43 +0000 (11:54 +0200)]
change (un)register_event() to return int as status.

Don't exit in the events.c code but always return.

Michael

14 years agoReduce headers included in quad_client.c
Michael Adam [Mon, 17 Aug 2009 09:12:50 +0000 (11:12 +0200)]
Reduce headers included in quad_client.c

Michael

14 years agoReduce headers included in quad_server.c
Michael Adam [Mon, 17 Aug 2009 09:11:46 +0000 (11:11 +0200)]
Reduce headers included in quad_server.c

Michael

14 years agoSimplify Makefile (use ".c.o:" rule...)
Michael Adam [Mon, 17 Aug 2009 08:23:56 +0000 (10:23 +0200)]
Simplify Makefile (use ".c.o:" rule...)

Michael

14 years agoAbstract event code into event.c
Michael Adam [Mon, 17 Aug 2009 08:14:24 +0000 (10:14 +0200)]
Abstract event code into event.c

Michael

14 years agoserver: extract event_loop_once() function from main.
Michael Adam [Mon, 17 Aug 2009 07:59:28 +0000 (09:59 +0200)]
server: extract event_loop_once() function from main.

Michael

14 years agoMove socket related functions to new module sockets.c/sockets.h
Michael Adam [Mon, 17 Aug 2009 07:33:03 +0000 (09:33 +0200)]
Move socket related functions to new module sockets.c/sockets.h

Michael

14 years agoCommit first version of quad server / client - example fd select event code.
Michael Adam [Mon, 17 Aug 2009 07:19:11 +0000 (09:19 +0200)]
Commit first version of quad server / client - example fd select event code.

Michael