libfreerdp-core: remove unnecessary usage of freerdp_channels_data

This commit is contained in:
Marc-André Moreau 2014-02-15 15:26:34 -05:00
parent 7d54669a6e
commit 4bbd78a80b
11 changed files with 21 additions and 42 deletions

View File

@ -246,11 +246,6 @@ BOOL android_verify_changed_certificate(freerdp* instance, char* subject, char*
return android_verify_certificate(instance, subject, issuer, new_fingerprint);
}
int android_receive_channel_data(freerdp* instance, int channelId, UINT8* data, int size, int flags, int total_size)
{
return freerdp_channels_data(instance, channelId, data, size, flags, total_size);
}
static void android_process_channel_event(rdpChannels* channels, freerdp* instance)
{
wMessage* event;
@ -635,8 +630,6 @@ JNIEXPORT jint JNICALL jni_freerdp_new(JNIEnv *env, jclass cls)
instance->Authenticate = android_authenticate;
instance->VerifyCertificate = android_verify_certificate;
instance->VerifyChangedCertificate = android_verify_changed_certificate;
instance->ReceiveChannelData = android_receive_channel_data;
// create context
instance->ContextSize = sizeof(androidContext);

View File

@ -98,7 +98,7 @@
BOOL mac_pre_connect(freerdp* instance);
BOOL mac_post_connect(freerdp* instance);
BOOL mac_authenticate(freerdp* instance, char** username, char** password, char** domain);
int mac_receive_channel_data(freerdp* instance, int chan_id, BYTE* data, int size, int flags, int total_size);
DWORD mac_client_thread(void* param);
#endif // MRDPVIEW_H

View File

@ -1257,15 +1257,6 @@ static void channel_activity_cb(freerdp* instance)
}
}
/** *********************************************************************
* called when channel data is available
***********************************************************************/
int mac_receive_channel_data(freerdp* instance, int chan_id, BYTE* data, int size, int flags, int total_size)
{
return freerdp_channels_data(instance, chan_id, data, size, flags, total_size);
}
/**
* Used to load plugins based on the commandline parameters.
* This function is provided as a parameter to freerdp_parse_args(), that will call it

View File

@ -93,7 +93,6 @@ int mfreerdp_client_new(freerdp* instance, rdpContext* context)
context->instance->PreConnect = mac_pre_connect;
context->instance->PostConnect = mac_post_connect;
context->instance->ReceiveChannelData = mac_receive_channel_data;
context->instance->Authenticate = mac_authenticate;
context->channels = freerdp_channels_new();

View File

@ -1122,11 +1122,6 @@ int xf_logon_error_info(freerdp* instance, UINT32 data, UINT32 type)
return 1;
}
int xf_receive_channel_data(freerdp* instance, int channelId, BYTE* data, int size, int flags, int total_size)
{
return freerdp_channels_data(instance, channelId, data, size, flags, total_size);
}
void xf_process_channel_event(rdpChannels* channels, freerdp* instance)
{
xfContext* xfc;
@ -1861,7 +1856,6 @@ static int xfreerdp_client_new(freerdp* instance, rdpContext* context)
instance->Authenticate = xf_authenticate;
instance->VerifyCertificate = xf_verify_certificate;
instance->LogonErrorInfo = xf_logon_error_info;
instance->ReceiveChannelData = xf_receive_channel_data;
context->channels = freerdp_channels_new();

View File

@ -92,11 +92,6 @@ static BOOL ios_post_connect(freerdp* instance)
return TRUE;
}
static int ios_receive_channel_data(freerdp* instance, int channelId, UINT8* data, int size, int flags, int total_size)
{
return freerdp_channels_data(instance, channelId, data, size, flags, total_size);
}
void ios_process_channel_event(rdpChannels* channels, freerdp* instance)
{
wMessage* event = freerdp_channels_pop_event(channels);
@ -283,7 +278,6 @@ freerdp* ios_freerdp_new()
inst->Authenticate = ios_ui_authenticate;
inst->VerifyCertificate = ios_ui_check_certificate;
inst->VerifyChangedCertificate = ios_ui_check_changed_certificate;
inst->ReceiveChannelData = ios_receive_channel_data;
inst->ContextSize = sizeof(mfContext);
inst->ContextNew = ios_context_new;

View File

@ -39,8 +39,6 @@ FREERDP_API int freerdp_channels_load_plugin(rdpChannels* channels, rdpSettings*
const char* name, void* data);
FREERDP_API int freerdp_channels_pre_connect(rdpChannels* channels, freerdp* instance);
FREERDP_API int freerdp_channels_post_connect(rdpChannels* channels, freerdp* instance);
FREERDP_API int freerdp_channels_data(freerdp* instance, int channel_id, void* data, int data_size,
int flags, int total_size);
FREERDP_API int freerdp_channels_send_event(rdpChannels* channels, wMessage* event);
FREERDP_API BOOL freerdp_channels_get_fds(rdpChannels* channels, freerdp* instance, void** read_fds,
int* read_count, void** write_fds, int* write_count);
@ -53,6 +51,9 @@ FREERDP_API void* freerdp_channels_get_static_channel_interface(rdpChannels* cha
FREERDP_API HANDLE freerdp_channels_get_event_handle(freerdp* instance);
FREERDP_API int freerdp_channels_process_pending_messages(freerdp* instance);
FREERDP_API int freerdp_channels_data(freerdp* instance,
UINT16 channelId, BYTE* data, int dataSize, int flags, int totalSize);
#ifdef __cplusplus
}
#endif

View File

@ -65,8 +65,8 @@ typedef int (*pVerifyX509Certificate)(freerdp* instance, BYTE* data, int length,
typedef int (*pLogonErrorInfo)(freerdp* instance, UINT32 data, UINT32 type);
typedef int (*pSendChannelData)(freerdp* instance, int channelId, BYTE* data, int size);
typedef int (*pReceiveChannelData)(freerdp* instance, int channelId, BYTE* data, int size, int flags, int total_size);
typedef int (*pSendChannelData)(freerdp* instance, UINT16 channelId, BYTE* data, int size);
typedef int (*pReceiveChannelData)(freerdp* instance, UINT16 channelId, BYTE* data, int size, int flags, int totalSize);
/**
* Defines the context for a given instance of RDP connection.

View File

@ -41,6 +41,7 @@
#include <freerdp/channels/channels.h>
#include "rdp.h"
#include "client.h"
#include "channels.h"
BOOL freerdp_channel_send(rdpRdp* rdp, UINT16 channelId, BYTE* data, int size)
@ -117,8 +118,16 @@ BOOL freerdp_channel_process(freerdp* instance, wStream* s, UINT16 channelId)
Stream_Read_UINT32(s, flags);
chunkLength = Stream_GetRemainingLength(s);
IFCALL(instance->ReceiveChannelData, instance,
channelId, Stream_Pointer(s), chunkLength, flags, length);
if (instance->ReceiveChannelData)
{
IFCALL(instance->ReceiveChannelData, instance,
channelId, Stream_Pointer(s), chunkLength, flags, length);
}
else
{
freerdp_channels_data(instance,
channelId, Stream_Pointer(s), chunkLength, flags, length);
}
return TRUE;
}

View File

@ -242,11 +242,7 @@ int freerdp_channels_post_connect(rdpChannels* channels, freerdp* instance)
return 0;
}
/**
* data coming from the server to the client
* called only from main thread
*/
int freerdp_channels_data(freerdp* instance, int channelId, void* data, int dataSize, int flags, int totalSize)
int freerdp_channels_data(freerdp* instance, UINT16 channelId, BYTE* data, int dataSize, int flags, int totalSize)
{
int index;
rdpChannel* channel;

View File

@ -39,6 +39,7 @@
#include <freerdp/error.h>
#include <freerdp/event.h>
#include <freerdp/locale/keyboard.h>
#include <freerdp/channels/channels.h>
#include <freerdp/version.h>
/* connectErrorCode is 'extern' in error.h. See comment there.*/
@ -298,7 +299,7 @@ int freerdp_message_queue_process_pending_messages(freerdp* instance, DWORD id)
return status;
}
static int freerdp_send_channel_data(freerdp* instance, int channelId, BYTE* data, int size)
static int freerdp_send_channel_data(freerdp* instance, UINT16 channelId, BYTE* data, int size)
{
return rdp_send_channel_data(instance->context->rdp, channelId, data, size);
}
@ -476,6 +477,7 @@ freerdp* freerdp_new()
ZeroMemory(instance, sizeof(freerdp));
instance->ContextSize = sizeof(rdpContext);
instance->SendChannelData = freerdp_send_channel_data;
instance->ReceiveChannelData = freerdp_channels_data;
}
return instance;