Fixed variable server debug messages. Ref #447

This commit is contained in:
John M. Penn 2017-06-26 17:50:54 -05:00
parent 11d638d49e
commit d0b9cda9f2
2 changed files with 6 additions and 10 deletions

View File

@ -200,8 +200,7 @@ int Trick::VariableServerThread::var_exists(std::string in_name) {
/* send ascii "1" or "0" */
sprintf(buf1, "%d\t%d\n", VS_VAR_EXISTS, (error==false));
if (debug >= 2) {
message_publish(MSG_DEBUG, "%p tag=<%s> var_server sending:", &connection, connection.client_tag) ;
message_publish(MSG_NORMAL, "%s\n", buf1);
message_publish(MSG_DEBUG, "%p tag=<%s> var_server sending:\n%s\n", &connection, connection.client_tag, buf1) ;
}
tc_write(&connection, (char *) buf1, strlen(buf1));
}
@ -394,8 +393,7 @@ int Trick::VariableServerThread::send_list_size() {
// ascii
sprintf(buf1, "%d\t%d\n", VS_LIST_SIZE, var_count);
if (debug >= 2) {
message_publish(MSG_DEBUG, "%p tag=<%s> var_server sending number of event variables:", &connection, connection.client_tag) ;
message_publish(MSG_NORMAL, "%s\n", buf1);
message_publish(MSG_DEBUG, "%p tag=<%s> var_server sending number of event variables:\n%s\n", &connection, connection.client_tag, buf1) ;
}
tc_write(&connection, (char *) buf1, strlen(buf1));
}

View File

@ -244,9 +244,8 @@ int Trick::VariableServerThread::write_data() {
if( len + strlen( val ) + 2 > MAX_MSG_LEN ) {
if (debug >= 2) {
message_publish(MSG_DEBUG, "%p tag=<%s> var_server sending %d ascii bytes:",
&connection, connection.client_tag, (int)strlen(buf1)) ;
message_publish(MSG_NORMAL, "%s\n", buf1);
message_publish(MSG_DEBUG, "%p tag=<%s> var_server sending %d ascii bytes:\n%s\n",
&connection, connection.client_tag, (int)strlen(buf1), buf1) ;
}
ret = tc_write(&connection, (char *) buf1, len);
@ -266,9 +265,8 @@ int Trick::VariableServerThread::write_data() {
buf1[ strlen(buf1) - 1 ] = '\n';
if (debug >= 2) {
message_publish(MSG_DEBUG, "%p tag=<%s> var_server sending %d ascii bytes:",
&connection, connection.client_tag, (int)strlen(buf1)) ;
message_publish(MSG_NORMAL, "%s\n", buf1);
message_publish(MSG_DEBUG, "%p tag=<%s> var_server sending %d ascii bytes:\n%s\n",
&connection, connection.client_tag, (int)strlen(buf1), buf1) ;
}
ret = tc_write(&connection, (char *) buf1, (int)strlen(buf1));
if ( ret != (int)strlen(buf1) ) {