mirror of https://github.com/FreeRDP/FreeRDP
libfreerdp-core: remove unnecessary usage of freerdp_channels_data
This commit is contained in:
parent
7d54669a6e
commit
4bbd78a80b
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue