1. 12 Jul, 2003 40 commits
    • Per Cederqvist's avatar
      (isc_getipnum): Fixed compilation errors for IPv6 configurations, · d6e94866
      Per Cederqvist authored
      	which were introduced in the previous commit.
      (isc_gethostname): Ditto.
      (isc_getportnum): Ditto.
      d6e94866
    • Per Cederqvist's avatar
      Make it easier to run all the tests that don't require dejagnu. Add · 56cd68a4
      Per Cederqvist authored
      scheduling of clients, so that one client cannot starve other clients
      for resources.  (Bug 102).  Run the database save, garb, and check for
      killed clients from three separate liboop timer callbacks.  Use liboop
      for signal dispatching.  Use liboop.  (Bug 106).  Code cleanup.
      Renamed a few constants that have nothing to do with ISC.  Make it
      possible to read an unsigned int from the config file.  Add SA_RESTART
      support to liboop.  (This has been sent to the liboop maintainer.)
      (Fixes bug 845).  Add a few utility string functions.
      56cd68a4
    • Per Cederqvist's avatar
      Use liboop as a backend. Only support TCP streams. Removed a lot of · 14141e35
      Per Cederqvist authored
      stuff that isn't used by lyskom-server.  Move much internal stuff from
      isc.h to intern.h.
      14141e35
    • Per Cederqvist's avatar
      Check the parameter "Garb timeout" instead of "Idle timeout", since · 696387e4
      Per Cederqvist authored
      the latter no longer exists.
      696387e4
    • Per Cederqvist's avatar
      (check-nondejagnu): New target. · e32b4cb8
      Per Cederqvist authored
      (check-dejagnu): New target.
      (check): Depend on check-dejagnu and check-nondejagnu, and move
      	all dependencies to one of those targets.
      e32b4cb8
    • Per Cederqvist's avatar
      (last_start): Static variable removed. · 063c3d63
      Per Cederqvist authored
      (garb_text): Expect the caller to wait long enough when the garb
      	shouldn't be running.  Return true when the garb is completed,
      	instead of when the garb shouldn't be running.
      063c3d63
    • Per Cederqvist's avatar
      (sync_part): Return the number of seconds to wait instead of a Bool. · 252885fa
      Per Cederqvist authored
      	All callers updated.
      252885fa
    • Per Cederqvist's avatar
      (reread_param): Removed. · b01c1648
      Per Cederqvist authored
      (parameters): Removed "Idle timeout".  Added "Garb busy postponement",
      	"Penalty per call", "Penalty per read", "Max penalty" and "Low
      	penalty".
      b01c1648
    • Per Cederqvist's avatar
      Adjusted to new libisc API. · 438e6d90
      Per Cederqvist authored
      438e6d90
    • Per Cederqvist's avatar
      Include liboop.h. · da3cb7a0
      Per Cederqvist authored
      da3cb7a0
    • Per Cederqvist's avatar
      (listen_client): Static variable removed. · c4d7d239
      Per Cederqvist authored
      (server_init): Initialize liboop.  Adjusted to the new isc API:s.
      (sighandler_hup): Now an liboop signal callback, not a real signal
      	handler.
      (sighandler_quit): Ditto.
      (sighandler_usr2): Ditto.
      (sighandler_usr1): Ditto.  Do the real work here.
      (sighandler_winch): Ditto.  Do the real work here.
      (setup_sighandlers): Removed.
      (restart_syscalls_on_intr): Removed.
      (intr_syscalls_on_intr): Removed.
      (main): Clean up liboop structures on shutdown.
      c4d7d239
    • Per Cederqvist's avatar
      Include oop.h. · b097a2ff
      Per Cederqvist authored
      b097a2ff
    • Per Cederqvist's avatar
      (struct kom_par): Removed timeout. Added garb_busy_postponement, · 561e79e9
      Per Cederqvist authored
      	penalty_per_call, penalty_per_read, max_penalty and low_penalty.
      (reread_param): Variable removed.
      561e79e9
    • Per Cederqvist's avatar
      (KOM_PROTOCOL_ERR): New name for former ISC_PROTOCOL_ERR. All users updated. · 8aa57722
      Per Cederqvist authored
      (KOM_MSG_INCOMPLETE): New name for former ISC_MSG_INCOMPLETE.  All
      	users updated.
      (KOM_LOGOUT): New name for former ISC_LOGOUT.  All users updated.
      8aa57722
    • Per Cederqvist's avatar
    • Per Cederqvist's avatar
      30e5e761
    • Per Cederqvist's avatar
      (init_connection): Added static const qualifiers to the · 9f674c7f
      Per Cederqvist authored
      	default_want_async variable.  Initialize penalty,
      	penalty_generation, queue_next, queue_prev, on_queue.
      (kill_client): Assert that on_queue is false.
      9f674c7f
    • Per Cederqvist's avatar
      3bb2edec
    • Per Cederqvist's avatar
      (end_of_atomic): Removed the idle argument. Don't call the garb. · 96fdec13
      Per Cederqvist authored
      	Adjusted to the new API of sync_part().
      96fdec13
    • Per Cederqvist's avatar
      (Connection): New fields: penalty, penalty_generation, queue_prev, · aa21369f
      Per Cederqvist authored
      	queue_next, on_queue.
      (handle_accept_event): New function.
      aa21369f
    • Per Cederqvist's avatar
      (kom_server_oop_src): New variable. · 6d90fbde
      Per Cederqvist authored
      (penalty_generation): New static variable.
      (work_done): Ditto.
      (is_idle): Ditto.
      (queue_first): Ditto.
      (queue_last): Ditto.
      (kill_pending): Ditto.
      (do_statistics): Variable removed.
      (queue_add): New static function.
      (queue_remove): Ditto.
      (set_time): Ditto.
      (logout_client): Remove the client from the queue of pending clients.
      (parse_unparsed): Add penalty points for finished calls and protocol
      	errors.  Don't delete the parsed part of unparsed.
      (parse_message): Function removed.
      (logout_request): Function removed.
      (parse_forgotten): Ditto.
      (message_request): Ditto.
      (add_to_kill_list): Add an oop timer event callback to check_kill_flg
      	when a client is added to the kill list.
      (check_kill_flg): Changed API: this is now an oop timer callback
      	function.
      (write_err_cb): New static function.
      (adjust_penalty): Ditto.
      (read_from_connection): Ditto.
      (setup_timer): Ditto.
      (enable_idle_check): Ditto.
      (check_idle_callback): Ditto.
      (garb_callback): Ditto.
      (saver_callback): Ditto.
      (data_available_callback): Ditto.
      (handle_accept_event): New function.
      (login_request): Take an isc_scb as argument instead of an isc event.
      	Add read and write error callback functions for the new client.
      (toploop): Rewritten to use liboop.
      6d90fbde
    • Per Cederqvist's avatar
      (assign_uint): New function. · 00dd25b9
      Per Cederqvist authored
      (union param_value): Unused union removed.
      00dd25b9
    • Per Cederqvist's avatar
      (assign_uint): New function. · c761bd7a
      Per Cederqvist authored
      c761bd7a
    • Per Cederqvist's avatar
    • Per Cederqvist's avatar
      (AM_CPPFLAGS): Added an -I flag for liboop. · 973d5974
      Per Cederqvist authored
      (lyskomd_SOURCES): Added oop-malloc.h and oop-malloc.c.
      (lyskomd_LDADD): Link against liboop.a.
      973d5974
    • Per Cederqvist's avatar
      File removed. · 2c9f6a58
      Per Cederqvist authored
      2c9f6a58
    • Per Cederqvist's avatar
      (isc_tcp_accept_fn): Renamed to isc_tcp_accept. Removed the unused hl · 3fc62c56
      Per Cederqvist authored
      	and msg arguments.
      (isc_tcp_destroy_fn): Function removed.
      (isc_connecttcp): Ditto.
      (isc_opentcp): Ditto.
      (isc_tcp_funs): Function table removed.
      (isc_createtcp): Added mcb and initial_state arguments.  Removed
      	obsolete bogus setsockopt() calls.
      (isc_bindtcp): Don't check the type of the session.
      (isc_accept_cb): New function.
      (isc_listentcp): Added the cb argument.  Don't set the state here;
      	that is now done by isc_create().  Add isc_accept_cb() as a
      	read callback.
      3fc62c56
    • Per Cederqvist's avatar
      (isc_putc): The ISC_STATE_CONNECTING state no longer exists. · 49909a30
      Per Cederqvist authored
      (isc_write): Ditto.
      49909a30
    • Per Cederqvist's avatar
      (isc_getladdress): Don't check the type of the session. · 136dd2e2
      Per Cederqvist authored
      (isc_getraddress): Ditto.
      (isc_copyaddress): Function removed.
      (isc_getservice): Ditto.
      136dd2e2
    • Per Cederqvist's avatar
      (isc_default_read_fn): Function removed. · a6b198ab
      Per Cederqvist authored
      (isc_default_write_fn): Ditto.
      (isc_default_close_fn): Ditto.
      (isc_close): Ditto.
      (isc_sessions): Ditto.
      (isc_openfd): Ditto.
      (isc_file_destroy_fn): Ditto.
      (isc_openfile): Ditto.
      (isc_default_fun): Function table removed.
      (isc_create): Removed the "IscHandler *fun" argument, and added
      	mcb and initial_state arguments.  Initialize the currently
      	existing fields.
      (isc_set_read_callback): New function.
      (isc_check_read_callback): Ditto.
      (isc_cancel_read_callback): Ditto.
      (isc_cancel_write_callback): Ditto.
      (isc_destroy): Cancel read, write and accept callbacks.  Free
      	raddr and laddr instead of calling a destroy handler.
      (isc_disable): Remove the read callback.
      (isc_enable): Maybe add the read callback.
      a6b198ab
    • Per Cederqvist's avatar
      Include "oop.h" and "s-string.h". · 10c27d11
      Per Cederqvist authored
      10c27d11
    • Per Cederqvist's avatar
    • Per Cederqvist's avatar
      (isc_flush): There is no longer any read queue. · 67bdb314
      Per Cederqvist authored
      (write_cb): New function.
      (isc_oflush): Don't close the socket if the output queue is too big.
      	Instead, isc_check_read_callback() refuses to read input from
      	the client until it reads enough of the output queue.  Assert
      	that this isn't a listening session, but don't otherwise check
      	the state.  Call write instead of using the handler mechanism.
      	Call the write_err_cb callback function if an error occurs.
      	Don't update statistics that nobody uses.  Set up a liboop
      	write callback if we cannot send all output at once.  Call
      	isc_check_read_callback().
      (isc_send): Function removed.
      (isc_sendto): Ditto.
      67bdb314
    • Per Cederqvist's avatar
      (isc_allocmsg): Don't set the address field, which has been removed. · 602686cb
      Per Cederqvist authored
      (isc_reallocmsg): Function removed.
      (isc_copymsg): Ditto.
      (isc_mkstrmsg): Ditto.
      602686cb
    • Per Cederqvist's avatar
      (isc_initialize): Removed the cfg argument, and added the oop_source · 70218df2
      Per Cederqvist authored
      	argument.  Allocate a cfg struct.
      (isc_cfg_fd_relocate): New function.
      (isc_shutdown): Free the cfg struct.
      70218df2
    • Per Cederqvist's avatar
      (isc_read_data): New function. · fdb5fc6c
      Per Cederqvist authored
      (isc_getnextevent): Function removed.
      (isc_dispose): Ditto.
      fdb5fc6c
    • Per Cederqvist's avatar
      (isc_strdup): Function removed. · 7208f2da
      Per Cederqvist authored
      7208f2da
    • Per Cederqvist's avatar
    • Per Cederqvist's avatar
      Removed several defines for structs and unions. All users updated to · efadcbe2
      Per Cederqvist authored
      use the real names instead:
          IscSessionConfig  => struct isc_session_cfg
          IscAddress        => union  isc_address
          IscMessage        => struct isc_msg
          IscMsgQE          => struct isc_msg_q_entry
          IscMsgQueue       => struct isc_msgqueue
          IscSession        => struct isc_scb
          IscSessionList    => struct isc_scb_entry
          IscMaster         => struct isc_mcb
      (IscMasterConfig): Define and struct removed.
      (IscConfig): Ditto.
      (IscHandlerCache): Ditto
      (IscHandler): Ditto.
      (IscHandlerList): Ditto.
      (IscEvent): Ditto.
      (IscEventType): Define and enum removed.
      (IscSessionType): Ditto.
      (IscSessionInfo): Define and union removed.
      (IscSessionStats): Ditto.
      (enum isc_session_state): Removed the states ISC_STATE_UNKNOWN,
      	ISC_STATE_CONNECTING and ISC_STATE_CLOSING2.
      (union isc_address): Don't wrap the saddr field inside a
      	meaningless struct named ip.
      (isc_initialize): Removed the cfg argument, and added the
      	oop_source argument.
      (struct isc_scb): Removed the following fields: type, isc_errno,
      	rd_msg_q, info, logintime, idlesince, stats and handlers.
      	Added the following fields: raddr, laddr, master, accept_cb,
      	write_err_cb, data_available_callback, data_available_user,
      	data_available_registered and write_cb_registered.
      (struct isc_mcb): The scfg field is now a pointer, so that we
      	don't have to expose the struct isc_session_cfg struct in isc.h.
      	Added the event_source field.
      (isc_listentcp): Added the cb argument.
      (isc_openfd): Function removed.
      (isc_openfile): Ditto.
      (isc_openudp): Ditto.
      (isc_close): Ditto.
      (isc_sessions): Ditto.
      (isc_getnextevent): Ditto.
      (isc_wait): Ditto.
      (isc_dispose): Ditto.
      (isc_send): Ditto.
      (isc_sendto): Ditto.
      (isc_reallocmsg): Ditto.
      (isc_copymsg): Ditto.
      (isc_mkstrmsg): Ditto.
      (isc_createudp): Ditto.
      (isc_bindudp): Ditto.
      (isc_connecttcp): Ditto.
      (isc_connectudp): Ditto.
      (isc_listenudp): Ditto.
      (isc_copyaddress): Ditto.
      (isc_getservice): Ditto.
      (isc_newhandler): Ditto.
      (isc_freehandler): Ditto.
      (isc_copyhandler): Ditto.
      (isc_pushhandler): Ditto.
      (isc_pophandler): Ditto.
      (ISC_HCALLFUN1): Macro removed.
      (ISC_HCALLFUN2): Ditto.
      (ISC_HCALLFUN3): Ditto.
      (enum isc_read_result): New enum.
      (isc_read_data): New function.
      (isc_cfg_fd_relocate): Ditto.
      (isc_set_read_callback): Ditto.
      (isc_accept_callback): New callback function.
      (isc_write_error_cb): Ditto
      Moved some constants to intern.h:
      (ISC_DEFAULT_MAX_MSG_SIZE): Moved.
      (ISC_DEFAULT_MAX_QUEUED_SIZE): Moved.
      (ISC_DEFAULT_MAX_DEQUEUE_LEN): Moved.
      (ISC_DEFAULT_MAX_OPEN_RETRIES): Moved.
      (ISC_DEFAULT_MAX_BACKLOG): Moved.
      Moved some structs to intern.h:
      (struct isc_msg): Was: IscMessage.
      (struct isc_msg_q_entry): Was: IscMsgQE.
      (struct isc_msgqueue): Was: IscMsgQueue.
      (struct isc_session_cfg): Was: IscSessionConfig.
      (struct isc_scb_entry): Was: IscSessionList.
      Moved some functions to intern.h:
      (isc_freemsg): Moved.
      (isc_create): Moved.
      (isc_insert): Moved.
      (isc_remove): Moved.
      (isc_createtcp): Moved.
      (isc_bindtcp): Moved.
      (isc_allocmsg): Moved.
      Moved some functions from intern.h:
      (isc_setallocfn): Moved.
      efadcbe2
    • Per Cederqvist's avatar
      Moved some constants from isc.h and changed their values: · 0d171696
      Per Cederqvist authored
          ISC_DEFAULT_MAX_MSG_SIZE:   2048 => 8176
          ISC_DEFAULT_MAX_QUEUED_SIZE: 600 => 50
          ISC_DEFAULT_MAX_DEQUEUE_LEN:  10 => 30
          ISC_DEFAULT_MAX_OPEN_RETRIES: 10 => 10
          ISC_DEFAULT_MAX_BACKLOG:       5 => 50
      Moved some structs from isc.h and stopped using a defined name:
      (struct isc_msg): Was: IscMessage.
      (struct isc_msg_q_entry): Was: IscMsgQE.
      (struct isc_msgqueue): Was: IscMsgQueue.
      (struct isc_session_cfg): Was: IscSessionConfig.
      (struct isc_scb_entry): Was: IscSessionList.
      Moved some functions from isc.h:
      (isc_freemsg): Moved.
      (isc_create): Moved.
      (isc_insert): Moved.
      (isc_remove): Moved.
      (isc_createtcp): Moved.
      (isc_bindtcp): Moved.
      (isc_allocmsg): Moved.
      Moved some functions to isc.h:
      (isc_setallocfn): Moved.
      Other changes:
      (struct isc_msg): Removed the address field.
      (struct isc_session_cfg): Removed the version field.
      (isc_log): Function removed.
      (isc_create): Removed the "IscHandler *fun" argument, and added
      	mcb and initial_state arguments.
      (isc_createtcp): Added mcb and initial_state arguments.
      (isc_strdup): Function removed.
      (isc_default_read_fn): Function removed.
      (isc_default_write_fn): Function removed.
      (isc_default_close_fn): Function removed.
      (isc_pollqueue): Removed the external function.  Retain the macro.
      (isc_setabortfn): Place inside #if 0, since it is currently unused.
      (isc_check_read_callback): New function.
      (isc_cancel_read_callback): New function.
      (isc_cancel_write_callback): New function.
      (ISC_SCALLFUN1): Macro removed.
      (ISC_SCALLFUN2): Macro removed.
      (ISC_SCALLFUN3): Macro removed.
      0d171696