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) )
else
OSRF_BUFFER_ADD(act, ", ");
OSRF_BUFFER_ADD(act, str);
- free(str);
+ free((void *)str);
}
}
osrfLogActivity(OSRF_LOG_MARK, "%s", act->buf);
// 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;
}
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) {
}
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) {
}
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");
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';
int first_dash = 0;
int second_dash = 0;
- int third_dash = 0;
- int fourth_dash = 0;
int in_hint = 0;
int done = 0;
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;
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;
}
}
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.
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
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));
}
/**
// 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;
else if ( request[0] == '!') {
if (!no_bang) {
- system( request + 1 );
+ (void) (system( request + 1 )+1);
ret_val = 1;
}
}