From c277eed35d61e0d2f2ed84abd2134242005c3f22 Mon Sep 17 00:00:00 2001 From: erickson Date: Sat, 20 Aug 2005 19:55:49 +0000 Subject: [PATCH] updated make process to copy over new web stuff and not old web stuff removed the old transport_socket stuff git-svn-id: svn://svn.open-ils.org/ILS/trunk@1682 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Evergreen/Makefile | 26 +- Open-ILS/src/Makefile | 59 ++--- Open-ILS/src/apachemods/Makefile | 8 +- OpenSRF/src/libtransport/transport_session.h | 1 - OpenSRF/src/libtransport/transport_socket.c | 250 ------------------- OpenSRF/src/libtransport/transport_socket.h | 71 ------ OpenSRF/src/router/Makefile | 2 +- install.sh | 2 - 8 files changed, 32 insertions(+), 387 deletions(-) delete mode 100644 OpenSRF/src/libtransport/transport_socket.c delete mode 100644 OpenSRF/src/libtransport/transport_socket.h diff --git a/Evergreen/Makefile b/Evergreen/Makefile index 49b213796f..06c37734d3 100644 --- a/Evergreen/Makefile +++ b/Evergreen/Makefile @@ -2,7 +2,6 @@ # Evergreen makefile # ------------------------------------------------------------------------ -IMAGE=$(WEBDIR)/images NEW_OPAC_URL=myopac.domain NEW_XUL_PACKAGE_NAME=openils NEW_XUL_PACKAGE_LABEL=OpenILS @@ -11,8 +10,7 @@ NEW_XUL_PACKAGE_LABEL=OpenILS all: xul - -install: images-install circ-install +install: circ-install xul: cp -R staff_client local_staff_client @@ -27,28 +25,6 @@ xul: find local_staff_client/ -type f -exec sed -i s/gapines.org/${NEW_OPAC_URL}/g {} \; make -C local_staff_client package -images-install: - @echo "Installing images to $(IMAGE)"; - mkdir -p $(WEBDIR) - cp -r images $(WEBDIR) - ln -sf $(IMAGE)/pics/map.jpg $(IMAGE)/cartographic.jpg - ln -sf $(IMAGE)/bigpinesLogo.jpg $(IMAGE)/main_logo.jpg - ln -sf $(IMAGE)/pics/open_book.gif $(IMAGE)/"mixed material.jpg" - ln -sf $(IMAGE)/pics/movie.jpg $(IMAGE)/"moving image.jpg" - ln -sf $(IMAGE)/pics/music_icon.jpg $(IMAGE)/"notated music.jpg" - ln -sf $(IMAGE)/smallpinesLogo.jpg $(IMAGE)/"small_logo.jpg" - ln -sf $(IMAGE)/pics/computer.jpg $(IMAGE)/"software, multimedia.jpg" - ln -sf $(IMAGE)/pics/speaker.gif $(IMAGE)/"sound recording-musical.jpg" - ln -sf $(IMAGE)/pics/speaker.gif $(IMAGE)/"sound recording-nonmusical.jpg" - ln -sf $(IMAGE)/pics/speaker.gif $(IMAGE)/"sound recording.jpg" - ln -sf $(IMAGE)/pics/camera.gif $(IMAGE)/"still images.jpg" - ln -sf $(IMAGE)/pics/open_book.gif $(IMAGE)/text.jpg - ln -sf $(IMAGE)/pics/book_icon.jpeg $(IMAGE)/"three dimensional object.jpg" - -css-install: - mkdir -p $(WEBDIR)/css - cp -r css/opac/* $(WEBDIR)/css - circ-install: mkdir -p $(CIRCRULESDIR) cp circ_rules/*.rules $(CIRCRULESDIR)/ diff --git a/Open-ILS/src/Makefile b/Open-ILS/src/Makefile index d33cba3140..53bd1bf91f 100644 --- a/Open-ILS/src/Makefile +++ b/Open-ILS/src/Makefile @@ -8,19 +8,12 @@ all: mod_xmltools install: perl-install web-install string-templates-install storage-bootstrap xsl-install -web-install: web-templates-install javascript-install autojs-install mod_xmltools-install webxml-install +web-install: webcore-install autojs-install mod_xmltools-install -JSDIR=$(WEBDIR)/js - -marcdumper: - echo $@ - make -C extras/marcdumper - -marcdumper-install: - echo $@ - make -C extras/marcdumper install - +# ----------------------------------------------------------------------------------- +# Web stuff +# ----------------------------------------------------------------------------------- mod_xmltools: echo $@ make -C apachemods mod_xmltools.so @@ -29,10 +22,26 @@ mod_xmltools-install: echo $@ make -C apachemods mod_xmltools-install -webxml-install: - echo $@ +webcore-install: mkdir -p $(WEBDIR) - cp -r webxml $(WEBDIR) + cp -r ../web/* $(WEBDIR) + +autojs-install: + echo $@ + cp extras/fieldmapper.pl $(BINDIR) + cp extras/org_tree_js.pl $(BINDIR) + cp extras/autogen.sh $(BINDIR) +# ----------------------------------------------------------------------------------- + +marcdumper: + echo $@ + make -C extras/marcdumper + +marcdumper-install: + echo $@ + make -C extras/marcdumper install + +# ----------------------------------------------------------------------------------- perl-install: echo $@ @@ -43,13 +52,7 @@ perl-install: mkdir -p $(TEMPLATEDIR) cp -r templates/marc $(TEMPLATEDIR) -javascript-install: - echo $@ - @echo "Installing javascript to $(JSDIR)" - mkdir -p $(JSDIR) - cp -r javascript/* $(JSDIR) - cp ../../$(OPENSRFDIR)/javascript/JSON.js $(JSDIR)/util/ - cp ../../$(OPENSRFDIR)/javascript/md5.js $(JSDIR)/util/ +# ----------------------------------------------------------------------------------- storage-bootstrap: echo $@ @@ -58,19 +61,8 @@ storage-bootstrap: cp -r cgi-bin/* $(CGIDIR) ./extras/import/build-oils-db.sh $(DBDRVR) $(DBHOST) $(DBNAME) $(DBUSER) $(DBPW) +# ----------------------------------------------------------------------------------- -autojs-install: - echo $@ - cp extras/fieldmapper.pl $(BINDIR) - cp extras/org_tree_js.pl $(BINDIR) - cp extras/autogen.sh $(BINDIR) - -web-templates-install: - echo $@ - @echo "Installing web templates to $(TEMPLATEDIR)" - mkdir -p $(TEMPLATEDIR) - cp -r templates/opac $(TEMPLATEDIR) - cp -r templates/html $(TEMPLATEDIR) string-templates-install: echo $@ @@ -78,7 +70,6 @@ string-templates-install: mkdir -p $(TEMPLATEDIR) cp -r templates/strings $(TEMPLATEDIR) - xsl-install: echo $@ @echo "Installing XSL files to $(XSLDIR)" diff --git a/Open-ILS/src/apachemods/Makefile b/Open-ILS/src/apachemods/Makefile index acfcd394d0..45fad1480c 100644 --- a/Open-ILS/src/apachemods/Makefile +++ b/Open-ILS/src/apachemods/Makefile @@ -22,7 +22,6 @@ xmltools.o: xmltools.c xmltools.h echo $@ $(CC) -c $(CC_OPTS) xmltools.c -o $@ - mod_xmltools-install: echo $@ $(APXS2) -i -a -n mod_xmltools mod_xmltools.so @@ -31,8 +30,11 @@ mod_xmltools-install: LoadModule mod_xmltools_module modules/mod_xmltools.so \n \ to this: \n \ LoadModule mod_xmltools modules/mod_xmltools.so" - @echo "Also, you can add \nXMLToolsDefaultLocale \nand\n \ - XMLToolsLocaleDir to httpd.conf" + @echo -e "Supported configuration options:\ + \nXMLToolsDefaultLocale \ + \nXMLToolsLocaleDir \ + \nXMLToolsPreXSL \ + \nXMLToolsPostXSL " @echo "-----------------------------------------------"; @sleep 3; diff --git a/OpenSRF/src/libtransport/transport_session.h b/OpenSRF/src/libtransport/transport_session.h index d5bfbe3ab0..27199e8ab1 100644 --- a/OpenSRF/src/libtransport/transport_session.h +++ b/OpenSRF/src/libtransport/transport_session.h @@ -3,7 +3,6 @@ // a SAX push parser as it arrives. When key Jabber documetn elements are met, // logic ensues. // --------------------------------------------------------------------------------- -#include "transport_socket.h" #include "transport_message.h" #include "utils.h" diff --git a/OpenSRF/src/libtransport/transport_socket.c b/OpenSRF/src/libtransport/transport_socket.c deleted file mode 100644 index b9ea09f1d6..0000000000 --- a/OpenSRF/src/libtransport/transport_socket.c +++ /dev/null @@ -1,250 +0,0 @@ -#include "transport_socket.h" - - -/* -int main( char* argc, char** argv ) { - - transport_socket sock_obj; - sock_obj.port = 5222; - sock_obj.server = "10.0.0.4"; - sock_obj.data_received_callback = &print_stuff; - - printf("connecting...\n"); - if( (tcp_connect( &sock_obj )) < 0 ) { - printf( "error connecting" ); - } - - printf("sending...\n"); - if( tcp_send( &sock_obj, "\n" ) < 0 ) { - printf( "error sending" ); - } - - printf("waiting...\n"); - if( tcp_wait( &sock_obj, 15 ) < 0 ) { - printf( "error receiving" ); - } - - printf("disconnecting...\n"); - tcp_disconnect( &sock_obj ); - -} -*/ - - -// returns the socket fd, -1 on error -int tcp_connect( transport_socket* sock_obj ){ - - - if( sock_obj == NULL ) { - fatal_handler( "connect(): null sock_obj" ); - return -1; - } - - struct sockaddr_in remoteAddr, localAddr; - struct hostent *hptr; - int sock_fd; - - // ------------------------------------------------------------------ - // Create the socket - // ------------------------------------------------------------------ - if( (sock_fd = socket( AF_INET, SOCK_STREAM, 0 )) < 0 ) { - fatal_handler( "tcp_connect(): Cannot create socket" ); - return -1; - } - - // ------------------------------------------------------------------ - // Get the hostname - // ------------------------------------------------------------------ - if( (hptr = gethostbyname( sock_obj->server ) ) == NULL ) { - fatal_handler( "tcp_connect(): Unknown Host => %s", sock_obj->server ); - return -1; - } - - // ------------------------------------------------------------------ - // Construct server info struct - // ------------------------------------------------------------------ - memset( &remoteAddr, 0, sizeof(remoteAddr)); - remoteAddr.sin_family = AF_INET; - remoteAddr.sin_port = htons( sock_obj->port ); - memcpy( (char*) &remoteAddr.sin_addr.s_addr, - hptr->h_addr_list[0], hptr->h_length ); - - // ------------------------------------------------------------------ - // Construct local info struct - // ------------------------------------------------------------------ - memset( &localAddr, 0, sizeof( localAddr ) ); - localAddr.sin_family = AF_INET; - localAddr.sin_addr.s_addr = htonl( INADDR_ANY ); - localAddr.sin_port = htons(0); - - // ------------------------------------------------------------------ - // Bind to a local port - // ------------------------------------------------------------------ - if( bind( sock_fd, (struct sockaddr *) &localAddr, sizeof( localAddr ) ) < 0 ) { - fatal_handler( "tcp_connect(): Cannot bind to local port" ); - return -1; - } - - // ------------------------------------------------------------------ - // Connect to server - // ------------------------------------------------------------------ - if( connect( sock_fd, (struct sockaddr*) &remoteAddr, sizeof( struct sockaddr_in ) ) < 0 ) { - fatal_handler( "tcp_connect(): Cannot connect to server %s", sock_obj->server ); - return -1; - } - - sock_obj->sock_fd = sock_fd; - sock_obj->connected = 1; - return sock_fd; - -} - - -int tcp_send( transport_socket* sock_obj, const char* data ){ - - if( sock_obj == NULL ) { - fatal_handler( "tcp_send(): null sock_obj" ); - return 0; - } - - //fprintf( stderr, "TCP Sending: \n%s\n", data ); - - // ------------------------------------------------------------------ - // Send the data down the TCP pipe - // ------------------------------------------------------------------ - if( send( sock_obj->sock_fd, data, strlen(data), 0 ) < 0 ) { - fatal_handler( "tcp_send(): Error sending data" ); - return 0; - } - - debug_handler( "Sent Data %s At %f Seconds", data, get_timestamp_millis() ); - return 1; -} - - - -int tcp_disconnect( transport_socket* sock_obj ){ - - if( sock_obj == NULL ) { - fatal_handler( "tcp_disconnect(): null sock_obj" ); - return -1; - } - - if( close( sock_obj->sock_fd ) == -1 ) { - - // ------------------------------------------------------------------ - // Not really worth throwing an exception for... should be logged. - // ------------------------------------------------------------------ - warning_handler( "tcp_disconnect(): Error closing socket" ); - return -1; - } - - return 0; -} - -// ------------------------------------------------------------------ -// And now for the gory C socket code. -// Returns 0 on failure, 1 otherwise -// ------------------------------------------------------------------ -int tcp_wait( transport_socket* sock_obj, int timeout ){ - - if( sock_obj == NULL ) { - fatal_handler( "tcp_wait(): null sock_obj" ); - return 0; - } - - - int n = 0; - int retval = 0; - char buf[BUFSIZE]; - int sock_fd = sock_obj->sock_fd; - - fd_set read_set; - - FD_ZERO( &read_set ); - FD_SET( sock_fd, &read_set ); - - // ------------------------------------------------------------------ - // Build the timeval struct - // ------------------------------------------------------------------ - struct timeval tv; - tv.tv_sec = timeout; - tv.tv_usec = 0; - - if( timeout == -1 ) { - - // ------------------------------------------------------------------ - // If timeout is -1, there is no timeout passed to the call to select - // ------------------------------------------------------------------ - if( (retval = select( sock_fd + 1 , &read_set, NULL, NULL, NULL)) == -1 ) { - warning_handler( "Call to select interrupted" ); - return 0; - } - - } else if( timeout != 0 ) { /* timeout of 0 means don't block */ - - if( (retval = select( sock_fd + 1 , &read_set, NULL, NULL, &tv)) == -1 ) { - warning_handler( "Call to select interrupted" ); - return 0; - } - } - - memset( &buf, 0, BUFSIZE ); - - if( set_fl( sock_fd, O_NONBLOCK ) < 0 ) - return 0; - -#ifdef _ROUTER // just read one buffer full of data - - n = recv(sock_fd, buf, BUFSIZE-1, 0); - sock_obj->data_received_callback( sock_obj->user_data, buf ); - if( n == 0 ) - n = -1; - -#else // read everything we can - - debug_handler( "Leaving Socket Select At %f Seconds", get_timestamp_millis() ); - while( (n = recv(sock_fd, buf, BUFSIZE-1, 0) ) > 0 ) { - debug_handler("SOCKET Read: \n%s\n", buf); - sock_obj->data_received_callback( sock_obj->user_data, buf ); - memset( &buf, 0, BUFSIZE ); - } - -#endif - - if( clr_fl( sock_fd, O_NONBLOCK ) < 0 ) { - warning_handler("Unable to clear O_NONBLOCK flag on socket"); - return 0; - } - - - if( n < 0 ) { - if( errno != EAGAIN ) { - warning_handler( " * Error reading socket with errno %d", errno ); - return 0; - } - } - -#ifdef _ROUTER - return n; -#else - return sock_fd; -#endif - -} - - -/* -int tcp_connected( transport_socket* obj ) { - - int ret; - if( ! obj->sock_fd ) { return 0; } - - ret = read( obj->sock_fd , NULL,0 ); - if( ret <= 0 ) { - return 0; - } - return 1; -} -*/ - diff --git a/OpenSRF/src/libtransport/transport_socket.h b/OpenSRF/src/libtransport/transport_socket.h deleted file mode 100644 index dd1f146a05..0000000000 --- a/OpenSRF/src/libtransport/transport_socket.h +++ /dev/null @@ -1,71 +0,0 @@ -#include -#include -#include -#include - -#include "utils.h" -#include "logging.h" -//--------------------------------------------------------------- -// WIN32 -//--------------------------------------------------------------- -#ifdef WIN32 -#include -#include -#else - -//--------------------------------------------------------------- -// Unix headers -//--------------------------------------------------------------- -#include -#include -#include -#include -#include -#include -#include -#include -#endif - -#ifndef TRANSPORT_SOCKET_H -#define TRANSPORT_SOCKET_H - -/* how many characters we read from the socket at a time */ -#ifdef _ROUTER -#define BUFSIZE 412 -#else -#define BUFSIZE 4096 -#endif - -/* we maintain the socket information */ -struct transport_socket_struct { - /* for a client, sock_fd is THE socket connection. For a server, - it's the socket we listen on */ - int sock_fd; - int connected; - char* server; /* remote server name or ip */ - int port; - void* user_data; - - /* user_data may be anything. it's whatever you wish - to see showing up in the callback in addition to - the acutal character data*/ - void (*data_received_callback) (void * user_data, char*); -}; -typedef struct transport_socket_struct transport_socket; - -/* connects. If is_server is true, we call tcp_server_connect */ -int tcp_connect( transport_socket* obj ); - -int tcp_send( transport_socket* obj, const char* data ); - -int tcp_disconnect( transport_socket* obj ); - -/* does both client and server waiting. - returns the socket_fd on success, 0 on error */ -int tcp_wait( transport_socket* obj, int timeout ); - -int tcp_connected(transport_socket* obj); - - - -#endif diff --git a/OpenSRF/src/router/Makefile b/OpenSRF/src/router/Makefile index ef877a62f8..fc7c4ee62e 100644 --- a/OpenSRF/src/router/Makefile +++ b/OpenSRF/src/router/Makefile @@ -3,7 +3,7 @@ LD_OPTS += -lc_utils -lxml2 -lopensrf_stack -lobjson LP = ../libtransport -LIB_SOURCES = $(LP)/transport_socket.c $(LP)/transport_session.c $(LP)/transport_message.c $(LP)/transport_client.c +LIB_SOURCES = $(LP)/transport_session.c $(LP)/transport_message.c $(LP)/transport_client.c all: msg router diff --git a/install.sh b/install.sh index 3fe7f63a9a..49ba3552e9 100755 --- a/install.sh +++ b/install.sh @@ -203,9 +203,7 @@ function runInstall { # Evergreen --- "evergreen_core" ) - if installing; then $MAKE -C "$EVERGREENDIR" "images-install"; fi; if installing; then $MAKE -C "$EVERGREENDIR" "circ-install"; fi; - if installing; then $MAKE -C "$EVERGREENDIR" "css-install"; fi; ;; "evergreen_xul_client" ) -- 2.43.2