Merge branch 'master' of github.com:FreeRDP/FreeRDP
This commit is contained in:
commit
db01d942a5
@ -336,32 +336,30 @@ void* freerdp_channels_load_static_addin_entry(LPCSTR pszName, LPSTR pszSubsyste
|
|||||||
|
|
||||||
for (i = 0; CLIENT_STATIC_ADDIN_TABLE[i].name != NULL; i++)
|
for (i = 0; CLIENT_STATIC_ADDIN_TABLE[i].name != NULL; i++)
|
||||||
{
|
{
|
||||||
if (pszSubsystem != NULL)
|
if (strcmp(CLIENT_STATIC_ADDIN_TABLE[i].name, pszName) == 0)
|
||||||
{
|
{
|
||||||
subsystems = (STATIC_SUBSYSTEM_ENTRY*) CLIENT_STATIC_ADDIN_TABLE[i].table;
|
if (pszSubsystem != NULL)
|
||||||
|
|
||||||
for (j = 0; subsystems[j].name != NULL; j++)
|
|
||||||
{
|
{
|
||||||
if (strcmp(subsystems[j].name, pszSubsystem) == 0)
|
subsystems = (STATIC_SUBSYSTEM_ENTRY*) CLIENT_STATIC_ADDIN_TABLE[i].table;
|
||||||
|
|
||||||
|
for (j = 0; subsystems[j].name != NULL; j++)
|
||||||
{
|
{
|
||||||
if (pszType)
|
if (strcmp(subsystems[j].name, pszSubsystem) == 0)
|
||||||
{
|
{
|
||||||
if (strcmp(subsystems[j].type, pszType) == 0)
|
if (pszType)
|
||||||
|
{
|
||||||
|
if (strcmp(subsystems[j].type, pszType) == 0)
|
||||||
|
return (void*) subsystems[j].entry;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
return (void*) subsystems[j].entry;
|
return (void*) subsystems[j].entry;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
return (void*) subsystems[j].entry;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
else
|
|
||||||
{
|
|
||||||
if (strcmp(CLIENT_STATIC_ADDIN_TABLE[i].name, pszName) == 0)
|
|
||||||
{
|
|
||||||
return (void*) CLIENT_STATIC_ADDIN_TABLE[i].entry;
|
return (void*) CLIENT_STATIC_ADDIN_TABLE[i].entry;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1327,3 +1325,7 @@ void freerdp_channels_close(rdpChannels* channels, freerdp* instance)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Local variables: */
|
||||||
|
/* c-basic-offset: 8 */
|
||||||
|
/* c-file-style: "linux" */
|
||||||
|
/* End: */
|
||||||
|
@ -269,44 +269,73 @@ BOOL transport_accept_nla(rdpTransport* transport)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int transport_read(rdpTransport* transport, STREAM* s)
|
static int tr(rdpTransport* transport, UINT8* data, int bytes)
|
||||||
{
|
{
|
||||||
int status = -1;
|
int status = -1;
|
||||||
|
|
||||||
while (TRUE)
|
if (transport->layer == TRANSPORT_LAYER_TLS)
|
||||||
{
|
status = tls_read(transport->TlsIn, data, bytes);
|
||||||
if (transport->layer == TRANSPORT_LAYER_TLS)
|
else if (transport->layer == TRANSPORT_LAYER_TCP)
|
||||||
status = tls_read(transport->TlsIn, stream_get_tail(s), stream_get_left(s));
|
status = tcp_read(transport->TcpIn, data, bytes);
|
||||||
else if (transport->layer == TRANSPORT_LAYER_TCP)
|
else if (transport->layer == TRANSPORT_LAYER_TSG)
|
||||||
status = tcp_read(transport->TcpIn, stream_get_tail(s), stream_get_left(s));
|
status = tsg_read(transport->tsg, data, bytes);
|
||||||
else if (transport->layer == TRANSPORT_LAYER_TSG)
|
|
||||||
status = tsg_read(transport->tsg, stream_get_tail(s), stream_get_left(s));
|
|
||||||
|
|
||||||
if ((status == 0) && (transport->blocking))
|
|
||||||
{
|
|
||||||
freerdp_usleep(transport->usleep_interval);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef WITH_DEBUG_TRANSPORT
|
|
||||||
if (status > 0)
|
|
||||||
{
|
|
||||||
printf("Local < Remote\n");
|
|
||||||
freerdp_hexdump(s->data, status);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int transport_read(rdpTransport* transport, STREAM* s)
|
||||||
|
{
|
||||||
|
int status;
|
||||||
|
int pdu_bytes;
|
||||||
|
int s_bytes;
|
||||||
|
int rv;
|
||||||
|
|
||||||
|
rv = 0;
|
||||||
|
/* first check if we have header */
|
||||||
|
s_bytes = stream_get_length(s);
|
||||||
|
if (s_bytes < 4)
|
||||||
|
{
|
||||||
|
status = tr(transport, s->data + s_bytes, 4 - s_bytes);
|
||||||
|
if (status < 0)
|
||||||
|
{
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
rv += status;
|
||||||
|
if (status + s_bytes < 4)
|
||||||
|
{
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
s_bytes += status;
|
||||||
|
}
|
||||||
|
/* if header is present, read in exactly one PDU */
|
||||||
|
if (s->data[0] == 0x03)
|
||||||
|
{
|
||||||
|
pdu_bytes = (s->data[2] << 8) | s->data[3];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (s->data[1] & 0x80)
|
||||||
|
{
|
||||||
|
pdu_bytes = ((s->data[1] & 0x7f) << 8) | s->data[2];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pdu_bytes = s->data[1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
status = tr(transport, s->data + s_bytes, pdu_bytes - s_bytes);
|
||||||
|
if (status < 0)
|
||||||
|
{
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
rv += status;
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
|
||||||
static int transport_read_nonblocking(rdpTransport* transport)
|
static int transport_read_nonblocking(rdpTransport* transport)
|
||||||
{
|
{
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
stream_check_size(transport->recv_buffer, 4096);
|
stream_check_size(transport->recv_buffer, 32 * 1024);
|
||||||
status = transport_read(transport, transport->recv_buffer);
|
status = transport_read(transport, transport->recv_buffer);
|
||||||
|
|
||||||
if (status <= 0)
|
if (status <= 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user