GUAC-630: Backport changes from GUAC-622.
This commit is contained in:
parent
c6a6c5b681
commit
e226a7aae0
@ -83,6 +83,10 @@ void guacd_handle_connection(guac_socket* socket) {
|
|||||||
guac_instruction* connect;
|
guac_instruction* connect;
|
||||||
int init_result;
|
int init_result;
|
||||||
|
|
||||||
|
/* Reset guac_error */
|
||||||
|
guac_error = GUAC_STATUS_SUCCESS;
|
||||||
|
guac_error_message = NULL;
|
||||||
|
|
||||||
/* Get protocol from select instruction */
|
/* Get protocol from select instruction */
|
||||||
select = guac_instruction_expect(
|
select = guac_instruction_expect(
|
||||||
socket, GUACD_USEC_TIMEOUT, "select");
|
socket, GUACD_USEC_TIMEOUT, "select");
|
||||||
|
@ -102,35 +102,51 @@ void guacd_client_log_error(guac_client* client, const char* format,
|
|||||||
|
|
||||||
void guacd_log_guac_error(const char* message) {
|
void guacd_log_guac_error(const char* message) {
|
||||||
|
|
||||||
/* If error message provided, include in log */
|
if (guac_error != GUAC_STATUS_SUCCESS) {
|
||||||
if (guac_error_message != NULL)
|
|
||||||
guacd_log_error("%s: %s: %s",
|
|
||||||
message,
|
|
||||||
guac_status_string(guac_error),
|
|
||||||
guac_error_message);
|
|
||||||
|
|
||||||
/* Otherwise just log with standard status string */
|
/* If error message provided, include in log */
|
||||||
|
if (guac_error_message != NULL)
|
||||||
|
guacd_log_error("%s: %s: %s",
|
||||||
|
message,
|
||||||
|
guac_status_string(guac_error),
|
||||||
|
guac_error_message);
|
||||||
|
|
||||||
|
/* Otherwise just log with standard status string */
|
||||||
|
else
|
||||||
|
guacd_log_error("%s: %s",
|
||||||
|
message,
|
||||||
|
guac_status_string(guac_error));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Just log message if no status code */
|
||||||
else
|
else
|
||||||
guacd_log_error("%s: %s",
|
guacd_log_error("%s", message);
|
||||||
message,
|
|
||||||
guac_status_string(guac_error));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void guacd_client_log_guac_error(guac_client* client, const char* message) {
|
void guacd_client_log_guac_error(guac_client* client, const char* message) {
|
||||||
|
|
||||||
/* If error message provided, include in log */
|
if (guac_error != GUAC_STATUS_SUCCESS) {
|
||||||
if (guac_error_message != NULL)
|
|
||||||
guac_client_log_error(client, "%s: %s: %s",
|
|
||||||
message,
|
|
||||||
guac_status_string(guac_error),
|
|
||||||
guac_error_message);
|
|
||||||
|
|
||||||
/* Otherwise just log with standard status string */
|
/* If error message provided, include in log */
|
||||||
|
if (guac_error_message != NULL)
|
||||||
|
guac_client_log_error(client, "%s: %s: %s",
|
||||||
|
message,
|
||||||
|
guac_status_string(guac_error),
|
||||||
|
guac_error_message);
|
||||||
|
|
||||||
|
/* Otherwise just log with standard status string */
|
||||||
|
else
|
||||||
|
guac_client_log_error(client, "%s: %s",
|
||||||
|
message,
|
||||||
|
guac_status_string(guac_error));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Just log message if no status code */
|
||||||
else
|
else
|
||||||
guac_client_log_error(client, "%s: %s",
|
guac_client_log_error(client, "%s", message);
|
||||||
message,
|
|
||||||
guac_status_string(guac_error));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -127,7 +127,8 @@ int __guac_handle_size(guac_client* client, guac_instruction* instruction) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int __guac_handle_disconnect(guac_client* client, guac_instruction* instruction) {
|
int __guac_handle_disconnect(guac_client* client, guac_instruction* instruction) {
|
||||||
/* Return error code to force disconnect */
|
guac_client_log_info(client, "Disconnect requested. Stopping client...");
|
||||||
return -1;
|
guac_client_stop(client);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user