Commit 14141e35 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

Use liboop as a backend. Only support TCP streams. Removed a lot of

stuff that isn't used by lyskom-server.  Move much internal stuff from
isc.h to intern.h.
parent 696387e4
2003-07-12 Per Cederqvist <ceder@ceder.dyndns.org>
Use liboop as a backend. Only support TCP streams. Removed a lot
of stuff that isn't used by lyskom-server. Move much internal
stuff from isc.h to intern.h.
* src/isc_wait.c: File removed.
* src/isc_udp.c: File removed.
* src/isc_tcp.c (isc_tcp_accept_fn): Renamed to isc_tcp_accept.
Removed the unused hl 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.
* src/isc_stdout.c (isc_putc): The ISC_STATE_CONNECTING state no
longer exists.
(isc_write): Ditto.
* src/isc_socket.c (isc_getladdress): Don't check the type of the
session.
(isc_getraddress): Ditto.
(isc_copyaddress): Function removed.
(isc_getservice): Ditto.
* src/isc_session.c (isc_default_read_fn): Function removed.
(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.
* src/isc_relocate.c: Include "oop.h" and "s-string.h".
* src/isc_queue.c (isc_pollqueue): Removed the external function.
The macro is good enough.
* src/isc_output.c (isc_flush): There is no longer any read queue.
(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.
* src/isc_message.c (isc_allocmsg): Don't set the address field,
which has been removed.
(isc_reallocmsg): Function removed.
(isc_copymsg): Ditto.
(isc_mkstrmsg): Ditto.
* src/isc_master.c (isc_initialize): Removed the cfg argument, and
added the oop_source argument. Allocate a cfg struct.
(isc_cfg_fd_relocate): New function.
(isc_shutdown): Free the cfg struct.
* src/isc_handler.c: File removed.
* src/isc_event.c (isc_read_data): New function.
(isc_getnextevent): Function removed.
(isc_dispose): Ditto.
* src/isc_compat.c: Include "oop.h" and "s-string.h".
* src/isc_alloc.c (isc_strdup): Function removed.
* src/isc_abort.c (isc_setabortfn): Place inside #if 0, since it
is currently unused.
* src/isc.h: Removed several defines for structs and unions. All
users updated to 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.
* src/intern.h: Moved some constants from isc.h and changed their
values:
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.
* src/Makefile.am (libisc_a_SOURCES): Removed isc_handler.c,
isc_udp.c and isc_wait.c.
(AM_CPPFLAGS): Added -I flags for libmisc (to get the string
class), liboop, and the main include library (needed by
s-string.h).
2003-01-07 Per Cederqvist <ceder@lysator.liu.se>
Port to IRIX64, where "unsigned long" isn't large enough to avoid
......
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