Add stub ack handler. Call SFTP functions when download code received.

This commit is contained in:
Michael Jumper 2013-10-28 08:40:19 -07:00
parent 1dad3dc0d7
commit 50fbd5dabb
4 changed files with 17 additions and 2 deletions

View File

@ -167,7 +167,14 @@ int guac_sftp_end_handler(guac_client* client, guac_stream* stream) {
} }
guac_stream* guac_sftp_download_file(guac_client* client, const char* filename) { int guac_sftp_ack_handler(guac_client* client, guac_stream* stream,
char* message, guac_protocol_status status) {
return 0;
}
guac_stream* guac_sftp_download_file(guac_client* client,
const char* filename) {
/* STUB */ /* STUB */
return NULL; return NULL;
} }

View File

@ -58,6 +58,12 @@ int guac_sftp_blob_handler(guac_client* client, guac_stream* stream,
*/ */
int guac_sftp_end_handler(guac_client* client, guac_stream* stream); int guac_sftp_end_handler(guac_client* client, guac_stream* stream);
/**
* Handler for ack messages which continues an SFTP download.
*/
int guac_sftp_ack_handler(guac_client* client, guac_stream* stream,
char* message, guac_protocol_status status);
/** /**
* Begins (and automatically continues) an SFTP file download to the user. * Begins (and automatically continues) an SFTP file download to the user.
*/ */

View File

@ -248,6 +248,7 @@ void* ssh_client_thread(void* data) {
} }
/* Set file handlers */ /* Set file handlers */
client->ack_handler = guac_sftp_ack_handler;
client->file_handler = guac_sftp_file_handler; client->file_handler = guac_sftp_file_handler;
client->blob_handler = guac_sftp_blob_handler; client->blob_handler = guac_sftp_blob_handler;
client->end_handler = guac_sftp_end_handler; client->end_handler = guac_sftp_end_handler;

View File

@ -38,6 +38,7 @@
#include <stdlib.h> #include <stdlib.h>
#include "common.h" #include "common.h"
#include "sftp.h"
#include "terminal.h" #include "terminal.h"
#include "terminal_handlers.h" #include "terminal_handlers.h"
#include "char_mappings.h" #include "char_mappings.h"
@ -920,7 +921,7 @@ int guac_terminal_guac_download(guac_terminal* term, char c) {
if (c == 0x9C || c == 0x5C || c == 0x07) { if (c == 0x9C || c == 0x5C || c == 0x07) {
filename[length++] = '\0'; filename[length++] = '\0';
term->char_handler = guac_terminal_echo; term->char_handler = guac_terminal_echo;
guac_client_log_info(term->client, "STUB: get: %s", filename); guac_sftp_download_file(term->client, filename);
length = 0; length = 0;
} }