From fd05d6e5fd68dbd6d405e9508c783d1ac9b318c3 Mon Sep 17 00:00:00 2001 From: erickson Date: Wed, 3 Aug 2005 17:07:36 +0000 Subject: [PATCH] some code cleanup, some unfinished projects, etc. git-svn-id: svn://svn.open-ils.org/ILS/trunk@1604 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- OpenSRF/bin/opensrf_all | 4 ++-- OpenSRF/src/utils/socket_bundle.c | 10 +--------- OpenSRF/src/utils/socket_bundle.h | 7 +++++-- OpenSRF/src/xinclude/Makefile | 10 +++++----- OpenSRF/src/xinclude/mod_xinclude.c | 3 +++ 5 files changed, 16 insertions(+), 18 deletions(-) diff --git a/OpenSRF/bin/opensrf_all b/OpenSRF/bin/opensrf_all index 18d182ad48..ffa4489e54 100755 --- a/OpenSRF/bin/opensrf_all +++ b/OpenSRF/bin/opensrf_all @@ -74,12 +74,12 @@ function startJserver { fi; rm -f "$JSERVERSOCK"; - nohup "$BINDIR/$JSERVERBIN" $JSERVERPORT "$JSERVERSOCK" "$JSERVERLEVEL" "$JSERVERLOG" & + "$BINDIR/$JSERVERBIN" $JSERVERPORT "$JSERVERSOCK" "$JSERVERLEVEL" "$JSERVERLOG" } function startRouter { - nohup "$BINDIR/router" "$ETCDIR/router_config.xml" & + "$BINDIR/router" "$ETCDIR/router_config.xml" } function startOpenSRF { diff --git a/OpenSRF/src/utils/socket_bundle.c b/OpenSRF/src/utils/socket_bundle.c index 24ebb49a78..1e77c5720c 100644 --- a/OpenSRF/src/utils/socket_bundle.c +++ b/OpenSRF/src/utils/socket_bundle.c @@ -142,7 +142,7 @@ int socket_open_unix_server(socket_manager* mgr, char* path) { returns 0 on success. -1 on failure. socket_type is one of INET or UNIX */ int socket_open_client(socket_manager* mgr, - int socket_type, int port, char* dest_addr) { + int socket_type, int port, char* sock_path, char* dest_addr) { return 0; } @@ -398,14 +398,6 @@ int _socket_handle_client_data(socket_manager* mgr, socket_node* node) { debug_handler("Socket buf before read %s", buf); while( (read_bytes = recv(sock_fd, buf, BUFSIZE-1, 0) ) > 0 ) { debug_handler("Socket %d Read %d bytes and data: %s", sock_fd, read_bytes, buf); - - /* - int l = strlen(buf); - if(l > 1) {buf[l-1] = '\0';buf[l-2] = '\0';} - debug_handler("Socket data after cleanup: %s", sock_fd, read_bytes, buf); - */ - - if(mgr->data_received) mgr->data_received(mgr->blob, mgr, sock_fd, buf, node->parent_id); diff --git a/OpenSRF/src/utils/socket_bundle.h b/OpenSRF/src/utils/socket_bundle.h index 3b0121f4b1..7227a3899a 100644 --- a/OpenSRF/src/utils/socket_bundle.h +++ b/OpenSRF/src/utils/socket_bundle.h @@ -76,9 +76,12 @@ int socket_open_unix_server(socket_manager* mgr, char* path); /* creates a client socket and adds it to the socket set. returns 0 on success. -1 on failure. - socket_type is one of INET or UNIX */ + socket_type is one of INET or UNIX + port is the INET port number + sock_path is the UNIX socket file + */ int socket_open_client(socket_manager*, - int socket_type, int port, char* dest_addr); + int socket_type, int port, char* sock_path, char* dest_addr); /* returns the socket_node with the given sock_fd */ socket_node* socket_find_node(socket_manager*, int sock_fd); diff --git a/OpenSRF/src/xinclude/Makefile b/OpenSRF/src/xinclude/Makefile index b9be5f0d24..ba537e981d 100644 --- a/OpenSRF/src/xinclude/Makefile +++ b/OpenSRF/src/xinclude/Makefile @@ -1,11 +1,11 @@ SO=mod_xinclude.so # -------------------------------------------------------- -#TMPDIR = /tmp/ilstmp/opensrf -#LIBDIR = /openils/lib -#CC_OPTS = -Wall -O2 -fPIC -I /usr/include/libxml2 -I /opt/include -#LD_OPTS = -lxml2 -#APXS2 = /opt/bin/apxs +TMPDIR = /tmp/ilstmp/opensrf +LIBDIR = /openils/lib +CC_OPTS = -Wall -O2 -fPIC -I /usr/include/libxml2 -I /opt/include +LD_OPTS = -lxml2 +APXS2 = /opt/bin/apxs # -------------------------------------------------------- all: $(SO) diff --git a/OpenSRF/src/xinclude/mod_xinclude.c b/OpenSRF/src/xinclude/mod_xinclude.c index 022a149439..08fee22e3e 100644 --- a/OpenSRF/src/xinclude/mod_xinclude.c +++ b/OpenSRF/src/xinclude/mod_xinclude.c @@ -25,6 +25,7 @@ static int mod_xinclude_handler (request_rec *r) { if(!file) { fprintf(stderr, "No XML file to parse"); + fflush(stderr); return HTTP_INTERNAL_SERVER_ERROR; } @@ -33,6 +34,7 @@ static int mod_xinclude_handler (request_rec *r) { if(!doc) { fprintf(stderr, "Error parsing XML file %s\n", file); + fflush(stderr); return HTTP_INTERNAL_SERVER_ERROR; } @@ -41,6 +43,7 @@ static int mod_xinclude_handler (request_rec *r) { if(status < 0) { fprintf(stderr, "Error processing XIncludes in XML file %s\n", file); + fflush(stderr); return HTTP_INTERNAL_SERVER_ERROR; } -- 2.43.2