Indent fixes
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1428 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
parent
5f90d7f9f0
commit
f6e5fe5f38
16
rdp.c
16
rdp.c
@ -246,7 +246,7 @@ int
|
|||||||
rdp_in_unistr(STREAM s, char *string, int str_size, int in_len)
|
rdp_in_unistr(STREAM s, char *string, int str_size, int in_len)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_ICONV
|
#ifdef HAVE_ICONV
|
||||||
size_t ibl = in_len, obl = str_size-1;
|
size_t ibl = in_len, obl = str_size - 1;
|
||||||
char *pin = (char *) s->p, *pout = string;
|
char *pin = (char *) s->p, *pout = string;
|
||||||
static iconv_t iconv_h = (iconv_t) - 1;
|
static iconv_t iconv_h = (iconv_t) - 1;
|
||||||
|
|
||||||
@ -291,14 +291,14 @@ rdp_in_unistr(STREAM s, char *string, int str_size, int in_len)
|
|||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
int len = in_len/2;
|
int len = in_len / 2;
|
||||||
int rem = 0;
|
int rem = 0;
|
||||||
|
|
||||||
if (len > str_size-1)
|
if (len > str_size - 1)
|
||||||
{
|
{
|
||||||
warning("server sent an unexpectedly long string, truncating\n");
|
warning("server sent an unexpectedly long string, truncating\n");
|
||||||
len = str_size-1;
|
len = str_size - 1;
|
||||||
rem = in_len - 2*len;
|
rem = in_len - 2 * len;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (i < len)
|
while (i < len)
|
||||||
@ -1350,10 +1350,10 @@ process_redirect_pdu(STREAM s /*, uint32 * ext_disc_reason */ )
|
|||||||
in_uint32_le(s, len);
|
in_uint32_le(s, len);
|
||||||
|
|
||||||
/* read cookie string (plain ASCII) */
|
/* read cookie string (plain ASCII) */
|
||||||
if (len > sizeof(g_redirect_cookie)-1)
|
if (len > sizeof(g_redirect_cookie) - 1)
|
||||||
{
|
{
|
||||||
uint32 rem = len - (sizeof(g_redirect_cookie)-1);
|
uint32 rem = len - (sizeof(g_redirect_cookie) - 1);
|
||||||
len = sizeof(g_redirect_cookie)-1;
|
len = sizeof(g_redirect_cookie) - 1;
|
||||||
|
|
||||||
warning("Unexpectedly large redirection cookie\n");
|
warning("Unexpectedly large redirection cookie\n");
|
||||||
in_uint8a(s, g_redirect_cookie, len);
|
in_uint8a(s, g_redirect_cookie, len);
|
||||||
|
3
rdpdr.c
3
rdpdr.c
@ -622,7 +622,8 @@ rdpdr_process_irp(STREAM s)
|
|||||||
in_uint8s(s, 0x17);
|
in_uint8s(s, 0x17);
|
||||||
if (length && length < 2 * 255)
|
if (length && length < 2 * 255)
|
||||||
{
|
{
|
||||||
rdp_in_unistr(s, filename, sizeof(filename), length);
|
rdp_in_unistr(s, filename, sizeof(filename),
|
||||||
|
length);
|
||||||
convert_to_unix_filename(filename);
|
convert_to_unix_filename(filename);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
21
scard.c
21
scard.c
@ -1420,9 +1420,10 @@ copyIORequest_MyPCSCToServer(MYPCSC_LPSCARD_IO_REQUEST src, SERVER_LPSCARD_IO_RE
|
|||||||
size_t bytesToCopy = src->cbPciLength - sizeof(MYPCSC_SCARD_IO_REQUEST);
|
size_t bytesToCopy = src->cbPciLength - sizeof(MYPCSC_SCARD_IO_REQUEST);
|
||||||
srcBytes = ((unsigned char *) src + sizeof(MYPCSC_SCARD_IO_REQUEST));
|
srcBytes = ((unsigned char *) src + sizeof(MYPCSC_SCARD_IO_REQUEST));
|
||||||
dstBytes = ((unsigned char *) dst + sizeof(SERVER_SCARD_IO_REQUEST));
|
dstBytes = ((unsigned char *) dst + sizeof(SERVER_SCARD_IO_REQUEST));
|
||||||
dst->dwProtocol = swap32((uint32_t)src->dwProtocol);
|
dst->dwProtocol = swap32((uint32_t) src->dwProtocol);
|
||||||
dst->cbPciLength = swap32((uint32_t)src->cbPciLength
|
dst->cbPciLength = swap32((uint32_t) src->cbPciLength
|
||||||
- sizeof(MYPCSC_SCARD_IO_REQUEST) + sizeof(SERVER_SCARD_IO_REQUEST));
|
- sizeof(MYPCSC_SCARD_IO_REQUEST) +
|
||||||
|
sizeof(SERVER_SCARD_IO_REQUEST));
|
||||||
memcpy(dstBytes, srcBytes, bytesToCopy);
|
memcpy(dstBytes, srcBytes, bytesToCopy);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2480,8 +2481,7 @@ thread_function(PThreadListElement listElement)
|
|||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
while (listElement->data == NULL)
|
while (listElement->data == NULL)
|
||||||
pthread_cond_wait(&listElement->nodata,
|
pthread_cond_wait(&listElement->nodata, &listElement->busy);
|
||||||
&listElement->busy);
|
|
||||||
|
|
||||||
SC_deviceControl(listElement->data);
|
SC_deviceControl(listElement->data);
|
||||||
listElement->data = NULL;
|
listElement->data = NULL;
|
||||||
@ -2498,15 +2498,18 @@ SC_handleRequest(PSCThreadData data)
|
|||||||
int Result = 0;
|
int Result = 0;
|
||||||
PThreadListElement cur;
|
PThreadListElement cur;
|
||||||
|
|
||||||
for (cur = threadList; cur != NULL; cur = cur->next) {
|
for (cur = threadList; cur != NULL; cur = cur->next)
|
||||||
if (cur->data == NULL) {
|
{
|
||||||
|
if (cur->data == NULL)
|
||||||
|
{
|
||||||
pthread_mutex_lock(&cur->busy);
|
pthread_mutex_lock(&cur->busy);
|
||||||
/* double check with lock held.... */
|
/* double check with lock held.... */
|
||||||
if (cur->data != NULL) {
|
if (cur->data != NULL)
|
||||||
|
{
|
||||||
pthread_mutex_unlock(&cur->busy);
|
pthread_mutex_unlock(&cur->busy);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Wake up thread */
|
/* Wake up thread */
|
||||||
cur->data = data;
|
cur->data = data;
|
||||||
pthread_cond_broadcast(&cur->nodata);
|
pthread_cond_broadcast(&cur->nodata);
|
||||||
|
Loading…
Reference in New Issue
Block a user