[OpenSRF-GIT] OpenSRF branch master updated. 71720f639e00d0e457bc8f967f8060b579bc2882

Evergreen Git git at git.evergreen-ils.org
Mon May 7 16:10:21 EDT 2018


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "OpenSRF".

The branch, master has been updated
       via  71720f639e00d0e457bc8f967f8060b579bc2882 (commit)
       via  0f0a2281767a47c0ab4971d2b0dba5da10c6907b (commit)
       via  f47f108e7a2af04360c872313978be6ce71c5c25 (commit)
       via  9dd65c72e5bd114eb1e1d6c2b1388e01df02bbb8 (commit)
       via  f8f1813bf17f745719c9dabbdfc5c7bed05c7138 (commit)
       via  6aedae0b42434c95f22924ed4b93ba726353f034 (commit)
       via  2e5c11c04c4db962aebf4b8632ce35a46434cd12 (commit)
      from  e72473d9c43a579ea64cb79fd410d37df23c3445 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 71720f639e00d0e457bc8f967f8060b579bc2882
Author: Galen Charlton <gmc at equinoxinitiative.org>
Date:   Mon May 7 16:03:16 2018 -0400

    LP#1243841: quiet a misleading indentation warning
    
    Adjusts a spaces-vs-tabs issue to fix the following compilation
    warning:
    
    osrf_prefork.c: In function ‘check_children’:
    osrf_prefork.c:1067:5: warning: this ‘if’ clause does not
    guard... [-Wmisleading-indentation]
         if( select_ret <= 0 ) // we're done here
         ^~
    osrf_prefork.c:1072:2: note: ...this statement, but the latter is
    misleadingly indented as if it is guarded by the ‘if’
      cur_child = forker->first_child;
      ^~~~~~~~~
    
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/src/libopensrf/osrf_prefork.c b/src/libopensrf/osrf_prefork.c
index 658fd8c..f02f635 100644
--- a/src/libopensrf/osrf_prefork.c
+++ b/src/libopensrf/osrf_prefork.c
@@ -1065,7 +1065,7 @@ static int check_children( prefork_simple* forker, int forever ) {
 	}
 
     if( select_ret <= 0 ) // we're done here
-        return select_ret;
+		return select_ret;
 
 	// Check each child in the active list.
 	// If it has responded, move it to the idle list.

commit 0f0a2281767a47c0ab4971d2b0dba5da10c6907b
Author: Jason Stephenson <jason at sigio.com>
Date:   Tue Nov 7 16:39:39 2017 -0500

    LP#1243841 - Quiet remaining Make install warnings.
    
    We silence the following warnings:
    
    apachetools.c:179:15: warning: initialization discards 'const' qualifier
    from pointer target type [enabled by default]
    
    apachetools.c:181:8: warning: assignment discards 'const' qualifier from
    pointer target type [enabled by default]
    
    apachetools.c:183:8: warning: assignment discards 'const' qualifier from
    pointer target type [enabled by default]
    
    ./osrf_websocket_translator.c:541:9: warning: return makes integer from
    pointer without a cast [enabled by default]
    
    ./osrf_http_translator.c:300:25: warning: passing argument 1 of 'free'
    discards 'const' qualifier from pointer target type [enabled by default]
    
    Signed-off-by: Jason Stephenson <jason at sigio.com>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/src/gateway/apachetools.c b/src/gateway/apachetools.c
index d3975d3..b6db557 100644
--- a/src/gateway/apachetools.c
+++ b/src/gateway/apachetools.c
@@ -176,7 +176,7 @@ int crossOriginHeaders(request_rec* r, osrfStringArray* allowedOrigins) {
 		return 0;
 
 	/* remove scheme from address */
-	char *host = origin;
+	const char *host = origin;
 	if ( !strncmp(origin, "http://", 7) )
 		host = origin + 7;
 	if ( !strncmp(origin, "https://", 8) )
diff --git a/src/gateway/osrf_http_translator.c b/src/gateway/osrf_http_translator.c
index fd2bf23..789aaae 100644
--- a/src/gateway/osrf_http_translator.c
+++ b/src/gateway/osrf_http_translator.c
@@ -297,7 +297,7 @@ static char* osrfHttpTranslatorParseRequest(osrfHttpTranslator* trans) {
                         else
                             OSRF_BUFFER_ADD(act, ", ");
                         OSRF_BUFFER_ADD(act, str);
-                        free(str);
+                        free((void *)str);
                     }
                 }
                 osrfLogActivity(OSRF_LOG_MARK, "%s", act->buf);
diff --git a/src/gateway/osrf_websocket_translator.c b/src/gateway/osrf_websocket_translator.c
index 8da5a36..75d6876 100644
--- a/src/gateway/osrf_websocket_translator.c
+++ b/src/gateway/osrf_websocket_translator.c
@@ -554,7 +554,7 @@ static int build_startup_data(const WebSocketServer *server) {
     // the only data entering this pools are the session strings.
     if (apr_pool_create(&stateful_session_pool, trans->main_pool) != APR_SUCCESS) {
         osrfLogError(OSRF_LOG_MARK, "WS Unable to create apr_pool");
-        return NULL;
+        return 0;
     }
     trans->stateful_session_pool = stateful_session_pool;
 

commit f47f108e7a2af04360c872313978be6ce71c5c25
Author: Jason Stephenson <jason at sigio.com>
Date:   Tue Nov 7 15:58:05 2017 -0500

    LP#1243841 - Quiet additional Make warnings and some code cleanup.
    
    We make the following warnings go away:
    
    osrf_legacy_json.c:607:6: warning: variable ‘fourth_dash’ set but
    not used [-Wunused-but-set-variable]
    
    osrf_legacy_json.c:836:5: warning: passing argument 3 of ‘makeNode’
    discards ‘const’ qualifier from pointer target type [enabled by
    default]
    
    utils.c:133:2: warning: format not a string literal and no format
    arguments [-Wformat-security]
    
    We also cleanup the while block nested in a do while block around line
    63 of osrf_cache.c to be more readable by adding braces and breaking
    it across 3 lines.
    
    Signed-off-by: Jason Stephenson <jason at sigio.com>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/src/libopensrf/osrf_cache.c b/src/libopensrf/osrf_cache.c
index b9ef6e9..08ac596 100644
--- a/src/libopensrf/osrf_cache.c
+++ b/src/libopensrf/osrf_cache.c
@@ -60,7 +60,9 @@ char* _clean_key( const char* key ) {
     char* clean_key = (char*)strdup(key);
     char* d = clean_key;
     char* s = clean_key;
-    do while( (isspace(*s) || ((*s != '\0') && iscntrl(*s))) ) s++; while( (*d++ = *s++) );
+    do {
+        while(isspace(*s) || ((*s != '\0') && iscntrl(*s))) s++;
+    } while((*d++ = *s++));
     if (strlen(clean_key) > MAX_KEY_LEN) {
         char *hashed = md5sum(clean_key);
         clean_key[0] = '\0';
diff --git a/src/libopensrf/osrf_legacy_json.c b/src/libopensrf/osrf_legacy_json.c
index cd43d13..1ed4555 100644
--- a/src/libopensrf/osrf_legacy_json.c
+++ b/src/libopensrf/osrf_legacy_json.c
@@ -603,8 +603,6 @@ int json_eat_comment(char* string, unsigned long* index, char** buffer, int pars
 
 	int first_dash		= 0;
 	int second_dash	= 0;
-	int third_dash		= 0;
-	int fourth_dash	= 0;
 
 	int in_hint			= 0;
 	int done				= 0;
@@ -619,9 +617,7 @@ int json_eat_comment(char* string, unsigned long* index, char** buffer, int pars
 
 			case '-':
 				on_star = 0;
-				if(third_dash)			fourth_dash = 1;
-				else if(in_hint)		third_dash	= 1;
-				else if(first_dash)	second_dash = 1;
+				if(first_dash)	second_dash = 1;
 				else						first_dash = 1;
 				break;
 
@@ -833,7 +829,9 @@ jsonObjectNode* jsonObjectIteratorNext( jsonObjectIterator* itr ) {
         itr->done = 1;
         return NULL;
     }
-    itr->current = makeNode(next, itr->iterator->index, itr->iterator->key);
+    /* Lp 1243841: Remove compiler const warning. */
+    char *k = (char *) itr->iterator->key;
+    itr->current = makeNode(next, itr->iterator->index, k);
     return itr->current;
 }
 
diff --git a/src/libopensrf/utils.c b/src/libopensrf/utils.c
index ff0afc3..2698f1d 100644
--- a/src/libopensrf/utils.c
+++ b/src/libopensrf/utils.c
@@ -113,8 +113,7 @@ int init_proc_title( int argc, char* argv[] ) {
 		provide values to be formatted and inserted into the format string.
 	@return Length of the resulting string (or what the length would be if the
 		receiving buffer were big enough to hold it), or -1 in case of an encoding
-		error.  Note: because some older versions of snprintf() don't work correctly,
-		this function may return -1 if the string is truncated for lack of space.
+		error.
 
 	Formats a string as directed, and uses it to replace the name of the
 	currently running executable.  This replacement string is what will
@@ -130,7 +129,11 @@ int init_proc_title( int argc, char* argv[] ) {
 int set_proc_title( const char* format, ... ) {
 	VA_LIST_TO_STRING(format);
 	osrf_clearbuf( *(global_argv), global_argv_size);
-	return snprintf( *(global_argv), global_argv_size, VA_BUF );
+	(void) strncpy( *(global_argv), VA_BUF, global_argv_size - 1 );
+	if (strlen(VA_BUF) >= global_argv_size) {
+		*(global_argv)[global_argv_size - 1] = '\0';
+	}
+	return (strlen(VA_BUF) > strlen(*(global_argv))) ? strlen(VA_BUF) : strlen(*(global_argv));
 }
 
 /**

commit 9dd65c72e5bd114eb1e1d6c2b1388e01df02bbb8
Author: Chris Sharp <csharp at georgialibraries.org>
Date:   Tue Sep 19 21:25:12 2017 -0400

    LP#1243841 - Quiet wrong format warnings during make install.
    
    During make install, the compiler warns that %d expects an int when the
    actual value is a long int.  Changing %d to %ld fixes the issue.
    
    Signed-off-by: Chris Sharp <csharp at georgialibraries.org>
    Signed-off-by: Jason Stephenson <jason at sigio.com>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/src/gateway/osrf_websocket_translator.c b/src/gateway/osrf_websocket_translator.c
index 2d3a5e1..8da5a36 100644
--- a/src/gateway/osrf_websocket_translator.c
+++ b/src/gateway/osrf_websocket_translator.c
@@ -622,7 +622,7 @@ int child_init(const WebSocketServer *server) {
         }
 
         ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, 
-            "WS: timeout set to %d", idle_timeout_interval);
+            "WS: timeout set to %ld", idle_timeout_interval);
 
         timeout = getenv("OSRF_WEBSOCKET_MAX_REQUEST_WAIT_TIME");
         if (timeout) {
@@ -637,7 +637,7 @@ int child_init(const WebSocketServer *server) {
         }
 
         ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, 
-            "WS: max request wait time set to %d", max_request_wait_time);
+            "WS: max request wait time set to %ld", max_request_wait_time);
 
         char* interval = getenv("OSRF_WEBSOCKET_IDLE_CHECK_INTERVAL");
         if (interval) {
@@ -652,7 +652,7 @@ int child_init(const WebSocketServer *server) {
         } 
 
         ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, 
-            "WS: idle check interval set to %d", idle_check_interval);
+            "WS: idle check interval set to %ld", idle_check_interval);
 
       
         char* cfile = getenv("OSRF_WEBSOCKET_CONFIG_FILE");

commit f8f1813bf17f745719c9dabbdfc5c7bed05c7138
Author: Chris Sharp <csharp at georgialibraries.org>
Date:   Tue Sep 19 20:46:28 2017 -0400

    LP#1243841 - Quiet unused return value warning in srfsh.c
    
    Using the technique described here: https://stackoverflow.com/a/13999461.
    
    Signed-off-by: Chris Sharp <csharp at georgialibraries.org>
    Signed-off-by: Jason Stephenson <jason at sigio.com>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/src/srfsh/srfsh.c b/src/srfsh/srfsh.c
index e3705a9..1887bac 100644
--- a/src/srfsh/srfsh.c
+++ b/src/srfsh/srfsh.c
@@ -383,7 +383,7 @@ static int process_request( const char* request ) {
 
 	else if ( request[0] == '!') {
 		if (!no_bang) {
-			system( request + 1 );
+			(void) (system( request + 1 )+1);
 			ret_val = 1;
 		}
 	}

commit 6aedae0b42434c95f22924ed4b93ba726353f034
Author: Chris Sharp <csharp at georgialibraries.org>
Date:   Tue Sep 19 20:37:13 2017 -0400

    LP#1243841 - Quiet unused return value warnings.
    
    Using advice given here: https://stackoverflow.com/a/13999461, "The
    only good (if ugly) way to suppress these is to convert the return
    value into something that the compiler agrees that you can ignore."
    
    Signed-off-by: Chris Sharp <csharp at georgialibraries.org>
    Signed-off-by: Jason Stephenson <jason at sigio.com>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/src/libopensrf/utils.c b/src/libopensrf/utils.c
index 1c049c0..ff0afc3 100644
--- a/src/libopensrf/utils.c
+++ b/src/libopensrf/utils.c
@@ -667,16 +667,16 @@ int daemonizeWithCallback( void (*callback)(pid_t, int), int callback_arg ) {
 		// Change directories.  Otherwise whatever directory
 		// we're in couldn't be deleted until the program
 		// terminated -- possibly causing some inconvenience.
-		chdir( "/" );
+		(void) (chdir( "/" )+1);
 
 		/* create new session */
 		setsid();
 
 		// Now that we're no longer attached to a terminal,
 		// we don't want any traffic on the standard streams
-		freopen( "/dev/null", "r", stdin );
-		freopen( "/dev/null", "w", stdout );
-		freopen( "/dev/null", "w", stderr );
+		(void) (freopen( "/dev/null", "r", stdin )+1);
+		(void) (freopen( "/dev/null", "w", stdout )+1);
+		(void) (freopen( "/dev/null", "w", stderr )+1);
 		
 		return 0;
 

commit 2e5c11c04c4db962aebf4b8632ce35a46434cd12
Author: Chris Sharp <csharp at georgialibraries.org>
Date:   Tue Sep 19 18:10:00 2017 -0400

    LP#1243841 - Wrap truth test using "=" in an extra set of parens.
    
    Referring to https://stackoverflow.com/questions/5476759/compiler-warning-suggest-parentheses-around-assignment-used-as-truth-value,
    it is recommended to wrap variable assignments that are used as a truth
    test within an extra set of parentheses.
    
    Signed-off-by: Chris Sharp <csharp at georgialibraries.org>
    Signed-off-by: Jason Stephenson <jason at sigio.com>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/src/libopensrf/osrf_cache.c b/src/libopensrf/osrf_cache.c
index 2f829cc..b9ef6e9 100644
--- a/src/libopensrf/osrf_cache.c
+++ b/src/libopensrf/osrf_cache.c
@@ -60,7 +60,7 @@ char* _clean_key( const char* key ) {
     char* clean_key = (char*)strdup(key);
     char* d = clean_key;
     char* s = clean_key;
-    do while(isspace(*s) || ((*s != '\0') && iscntrl(*s))) s++; while(*d++ = *s++);
+    do while( (isspace(*s) || ((*s != '\0') && iscntrl(*s))) ) s++; while( (*d++ = *s++) );
     if (strlen(clean_key) > MAX_KEY_LEN) {
         char *hashed = md5sum(clean_key);
         clean_key[0] = '\0';

-----------------------------------------------------------------------

Summary of changes:
 src/gateway/apachetools.c               |    2 +-
 src/gateway/osrf_http_translator.c      |    2 +-
 src/gateway/osrf_websocket_translator.c |    8 ++++----
 src/libopensrf/osrf_cache.c             |    4 +++-
 src/libopensrf/osrf_legacy_json.c       |   10 ++++------
 src/libopensrf/osrf_prefork.c           |    2 +-
 src/libopensrf/utils.c                  |   17 ++++++++++-------
 src/srfsh/srfsh.c                       |    2 +-
 8 files changed, 25 insertions(+), 22 deletions(-)


hooks/post-receive
-- 
OpenSRF


More information about the opensrf-commits mailing list