Miscellaneous minor tweaks: 1. Moved nested #includes out of the header file and into the implementation files as needed. 2. Additions and refinements to comments; adjustments to white space. 3. Changed several functions to return void instead of int, since we don't look at the return values anyway. 4. Added the const qualifier to several function parameters. 5. In osrfRouterHandleAppRequest(): initialize arr[], an array of pointers, by setting each pointer to NULL. We had been using memset() on the lot, relying on a the non-portable assumption that a NULL pointer is represented by all-bits-zero. 6. Minor rearrangements of the logic here and there, mostly to free things as soon as we're done with them instead of waiting until the end of the block, or to defer the declarations of things until we're about to use them. 7. Replaced a couple of calls to jsonObjectToSimpleString() with calls to jsonObjectGetString(), in order to eliminate a malloc() and a free(). 8. Renamed osrfRouterHandleAppResponse() to osrfRouterSendAppResponse(), which is more descriptive and less vague. M src/router/osrf_router.h M src/router/osrf_router.c M src/router/osrf_router_main.c git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1846 9efc2488-bf62-4759-914b-345cdb29e865
1. Move the declaration of osrfRouter out of the header and into osrf_router.c. There's no need for any other source file to know about the internals. 2. Eliminate the ROUTER_SOCKFD macro in favor of the new client_sock_fd() function. Reason: it needlessly coupled the osrfRouter and osrfRouterClass structures by requiring each of them to have a member named "connection". 3. Further tinkering with the comments. M src/router/osrf_router.h M src/router/osrf_router.c git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1838 9efc2488-bf62-4759-914b-345cdb29e865
Changed the signal handling. There are very few things you can safely do within a signal handler, and shutting down an osrfRouter is not among them. Now the signal handler just sets a switch for the main loop to look at. The select call looks for errno == EINTR and then looks at the switch that the signal handler sets. If the switch is set, we exit the otherwise infinite loop. Then we free the osrfRouter and re-raise the signal. M src/router/osrf_router.h M src/router/osrf_router.c M src/router/osrf_router_main.c git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1836 9efc2488-bf62-4759-914b-345cdb29e865
Prepare for #inclusion in C++ git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1607 9efc2488-bf62-4759-914b-345cdb29e865
Patch from Scott McKellar: 1. In the header: I added compilation guards. 2. In the header: I changed leading double underscores to leading single underscores. These identifiers don't appear elsewhere in the code base, with either double or single underscores. 3. I moved most of the header into the implementation file. The headers whose prototypes I moved are now static. Where there were comments associated with the prototypes, I moved them to the function definitions. 4. I removed an extra leading underscore from __osrfRouterFillFDSet(). 5. I replaced some deprecated identifiers with their camel-case equivalents: osrf_message_free ==> osrfMessageFree osrf_message ==> osrfMessage 6. I added the const qualifier to several function parameters. 7. In a couple of spots we were failing to free classname buffers. I plugged those leaks. git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1232 9efc2488-bf62-4759-914b-345cdb29e865
uber-patch from Scott McKellar cleans up large amounts of const-correctness issues and static-ifies several areas of unused header-based code; several cleanups to use simpler APIs such as buffer_release git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1130 9efc2488-bf62-4759-914b-345cdb29e865
moved C code to a unified logging framework which currently supports syslogging and file logging added the following to the config framework: <logfile>syslog</logfile> <syslog>local3</syslog> <!-- replace local3 with correct facility --> git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@583 9efc2488-bf62-4759-914b-345cdb29e865
added list and hash code based on libJudy re-coded the router added preliminary transport_group code for client redundancy (far from functional) various twists and tweaks fixed memory error in string_array code update makefiles git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@541 9efc2488-bf62-4759-914b-345cdb29e865