Using guac_error_message
This commit is contained in:
parent
2d7b398c72
commit
f9f864815c
@ -68,6 +68,23 @@ void __guacd_log_error(guac_client* client, const char* format, va_list args) {
|
|||||||
vsyslog(LOG_ERR, format, args);
|
vsyslog(LOG_ERR, format, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void guacd_log_guac_error(const char* message) {
|
||||||
|
|
||||||
|
/* If error message provided, include in log */
|
||||||
|
if (guac_error_message != NULL)
|
||||||
|
syslog(LOG_ERR, "%s: %s: %s",
|
||||||
|
message,
|
||||||
|
guac_error_message,
|
||||||
|
guac_status_string(guac_error));
|
||||||
|
|
||||||
|
/* Otherwise just log with standard status string */
|
||||||
|
else
|
||||||
|
syslog(LOG_ERR, "%s: %s",
|
||||||
|
message,
|
||||||
|
guac_status_string(guac_error));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void* start_client_thread(void* data) {
|
void* start_client_thread(void* data) {
|
||||||
|
|
||||||
guac_client* client;
|
guac_client* client;
|
||||||
@ -87,8 +104,7 @@ void* start_client_thread(void* data) {
|
|||||||
if (select == NULL) {
|
if (select == NULL) {
|
||||||
|
|
||||||
/* Log error */
|
/* Log error */
|
||||||
syslog(LOG_ERR, "Error reading \"select\": %s",
|
guacd_log_guac_error("Error reading \"select\"");
|
||||||
guac_status_string(guac_error));
|
|
||||||
|
|
||||||
/* Free resources */
|
/* Free resources */
|
||||||
guac_socket_close(socket);
|
guac_socket_close(socket);
|
||||||
@ -118,8 +134,7 @@ void* start_client_thread(void* data) {
|
|||||||
if (plugin == NULL) {
|
if (plugin == NULL) {
|
||||||
|
|
||||||
/* Log error */
|
/* Log error */
|
||||||
syslog(LOG_ERR, "Error loading client plugin: %s",
|
guacd_log_guac_error("Error loading client plugin");
|
||||||
guac_status_string(guac_error));
|
|
||||||
|
|
||||||
/* Free resources */
|
/* Free resources */
|
||||||
guac_socket_close(socket);
|
guac_socket_close(socket);
|
||||||
@ -132,11 +147,10 @@ void* start_client_thread(void* data) {
|
|||||||
|| guac_socket_flush(socket)) {
|
|| guac_socket_flush(socket)) {
|
||||||
|
|
||||||
/* Log error */
|
/* Log error */
|
||||||
syslog(LOG_ERR, "Error sending \"args\": %s",
|
guacd_log_guac_error("Error sending \"args\"");
|
||||||
guac_status_string(guac_error));
|
|
||||||
|
|
||||||
if (guac_client_plugin_close(plugin))
|
if (guac_client_plugin_close(plugin))
|
||||||
syslog(LOG_ERR, "Error closing client plugin");
|
guacd_log_guac_error("Error closing client plugin");
|
||||||
|
|
||||||
guac_socket_close(socket);
|
guac_socket_close(socket);
|
||||||
free(data);
|
free(data);
|
||||||
@ -149,11 +163,10 @@ void* start_client_thread(void* data) {
|
|||||||
if (connect == NULL) {
|
if (connect == NULL) {
|
||||||
|
|
||||||
/* Log error */
|
/* Log error */
|
||||||
syslog(LOG_ERR, "Error reading \"connect\": %s",
|
guacd_log_guac_error("Error reading \"connect\"");
|
||||||
guac_status_string(guac_error));
|
|
||||||
|
|
||||||
if (guac_client_plugin_close(plugin))
|
if (guac_client_plugin_close(plugin))
|
||||||
syslog(LOG_ERR, "Error closing client plugin");
|
guacd_log_guac_error("Error closing client plugin");
|
||||||
|
|
||||||
guac_socket_close(socket);
|
guac_socket_close(socket);
|
||||||
free(data);
|
free(data);
|
||||||
@ -167,11 +180,10 @@ void* start_client_thread(void* data) {
|
|||||||
|
|
||||||
if (client == NULL) {
|
if (client == NULL) {
|
||||||
|
|
||||||
syslog(LOG_ERR, "Error instantiating client: %s",
|
guacd_log_guac_error("Error instantiating client");
|
||||||
guac_status_string(guac_error));
|
|
||||||
|
|
||||||
if (guac_client_plugin_close(plugin))
|
if (guac_client_plugin_close(plugin))
|
||||||
syslog(LOG_ERR, "Error closing client plugin");
|
guacd_log_guac_error("Error closing client plugin");
|
||||||
|
|
||||||
guac_socket_close(socket);
|
guac_socket_close(socket);
|
||||||
free(data);
|
free(data);
|
||||||
|
Loading…
Reference in New Issue
Block a user