no logic change, remove tabs
This commit is contained in:
parent
fdc6aaad8b
commit
87ab0218e2
@ -67,7 +67,7 @@ xrdp_mcs_delete(struct xrdp_mcs* self)
|
|||||||
xrdp_iso_delete(self->iso_layer);
|
xrdp_iso_delete(self->iso_layer);
|
||||||
/* make sure we get null pointer exception if struct is used again. */
|
/* make sure we get null pointer exception if struct is used again. */
|
||||||
DEBUG(("xrdp_mcs_delete processed"))
|
DEBUG(("xrdp_mcs_delete processed"))
|
||||||
g_memset(self,0,sizeof(struct xrdp_mcs)) ;
|
g_memset(self,0,sizeof(struct xrdp_mcs)) ;
|
||||||
g_free(self);
|
g_free(self);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -135,7 +135,7 @@ xrdp_mcs_recv(struct xrdp_mcs* self, struct stream* s, int* chan)
|
|||||||
/* this is channels getting added from the client */
|
/* this is channels getting added from the client */
|
||||||
if (appid == MCS_CJRQ)
|
if (appid == MCS_CJRQ)
|
||||||
{
|
{
|
||||||
g_writeln("channel join request received");
|
g_writeln("channel join request received");
|
||||||
in_uint16_be(s, userid);
|
in_uint16_be(s, userid);
|
||||||
in_uint16_be(s, chanid);
|
in_uint16_be(s, chanid);
|
||||||
DEBUG(("xrdp_mcs_recv adding channel %4.4x", chanid));
|
DEBUG(("xrdp_mcs_recv adding channel %4.4x", chanid));
|
||||||
|
26
xrdp/xrdp.c
26
xrdp/xrdp.c
@ -50,7 +50,7 @@ g_xrdp_sync(long (*sync_func)(long param1, long param2), long sync_param1,
|
|||||||
long sync_result;
|
long sync_result;
|
||||||
int sync_command;
|
int sync_command;
|
||||||
|
|
||||||
/* If the function is called from the main thread, the function can
|
/* If the function is called from the main thread, the function can
|
||||||
* be called directly. g_threadid= main thread ID*/
|
* be called directly. g_threadid= main thread ID*/
|
||||||
if (tc_threadid_equal(tc_get_threadid(), g_threadid))
|
if (tc_threadid_equal(tc_get_threadid(), g_threadid))
|
||||||
{
|
{
|
||||||
@ -61,33 +61,33 @@ g_xrdp_sync(long (*sync_func)(long param1, long param2), long sync_param1,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* All threads have to wait here until the main thread
|
/* All threads have to wait here until the main thread
|
||||||
* process the function. g_process_waiting_function() is called
|
* process the function. g_process_waiting_function() is called
|
||||||
* from the listening thread. g_process_waiting_function() process the function*/
|
* from the listening thread. g_process_waiting_function() process the function*/
|
||||||
tc_mutex_lock(g_sync1_mutex);
|
tc_mutex_lock(g_sync1_mutex);
|
||||||
tc_mutex_lock(g_sync_mutex);
|
tc_mutex_lock(g_sync_mutex);
|
||||||
g_sync_param1 = sync_param1;
|
g_sync_param1 = sync_param1;
|
||||||
g_sync_param2 = sync_param2;
|
g_sync_param2 = sync_param2;
|
||||||
g_sync_func = sync_func;
|
g_sync_func = sync_func;
|
||||||
/* set a value THREAD_WAITING so the g_process_waiting_function function
|
/* set a value THREAD_WAITING so the g_process_waiting_function function
|
||||||
* know if any function must be processed */
|
* know if any function must be processed */
|
||||||
g_sync_command = THREAD_WAITING;
|
g_sync_command = THREAD_WAITING;
|
||||||
tc_mutex_unlock(g_sync_mutex);
|
tc_mutex_unlock(g_sync_mutex);
|
||||||
/* set this event so that the main thread know if
|
/* set this event so that the main thread know if
|
||||||
* g_process_waiting_function() must be called */
|
* g_process_waiting_function() must be called */
|
||||||
g_set_wait_obj(g_sync_event);
|
g_set_wait_obj(g_sync_event);
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
g_sleep(100);
|
g_sleep(100);
|
||||||
tc_mutex_lock(g_sync_mutex);
|
tc_mutex_lock(g_sync_mutex);
|
||||||
/* load new value from global to see if the g_process_waiting_function()
|
/* load new value from global to see if the g_process_waiting_function()
|
||||||
* function has processed the function */
|
* function has processed the function */
|
||||||
sync_command = g_sync_command;
|
sync_command = g_sync_command;
|
||||||
sync_result = g_sync_result;
|
sync_result = g_sync_result;
|
||||||
tc_mutex_unlock(g_sync_mutex);
|
tc_mutex_unlock(g_sync_mutex);
|
||||||
}
|
}
|
||||||
while (sync_command != 0); /* loop until g_process_waiting_function()
|
while (sync_command != 0); /* loop until g_process_waiting_function()
|
||||||
* has processed the request*/
|
* has processed the request */
|
||||||
tc_mutex_unlock(g_sync1_mutex);
|
tc_mutex_unlock(g_sync1_mutex);
|
||||||
/*g_writeln("g_xrdp_sync processed BY main thread -> continue");*/
|
/*g_writeln("g_xrdp_sync processed BY main thread -> continue");*/
|
||||||
}
|
}
|
||||||
@ -521,7 +521,7 @@ main(int argc, char** argv)
|
|||||||
{
|
{
|
||||||
g_writeln("error creating g_sync_event");
|
g_writeln("error creating g_sync_event");
|
||||||
}
|
}
|
||||||
g_listen->startup_params = startup_params;
|
g_listen->startup_params = startup_params;
|
||||||
xrdp_listen_main_loop(g_listen);
|
xrdp_listen_main_loop(g_listen);
|
||||||
xrdp_listen_delete(g_listen);
|
xrdp_listen_delete(g_listen);
|
||||||
tc_mutex_delete(g_sync_mutex);
|
tc_mutex_delete(g_sync_mutex);
|
||||||
|
@ -352,8 +352,8 @@ xrdp_bitmap_load(struct xrdp_bitmap* self, const char* filename, int* palette)
|
|||||||
|
|
||||||
if (!g_file_exist(filename))
|
if (!g_file_exist(filename))
|
||||||
{
|
{
|
||||||
log_message(LOG_LEVEL_ERROR,
|
log_message(LOG_LEVEL_ERROR, "xrdp_bitmap_load: error bitmap file [%s] "
|
||||||
"xrdp_bitmap_load: error bitmap file [%s] does not exist",filename);
|
"does not exist", filename);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
s = (struct stream *)NULL;
|
s = (struct stream *)NULL;
|
||||||
@ -363,15 +363,15 @@ xrdp_bitmap_load(struct xrdp_bitmap* self, const char* filename, int* palette)
|
|||||||
/* read file type */
|
/* read file type */
|
||||||
if (g_file_read(fd, type1, 2) != 2)
|
if (g_file_read(fd, type1, 2) != 2)
|
||||||
{
|
{
|
||||||
log_message(LOG_LEVEL_ERROR,
|
log_message(LOG_LEVEL_ERROR, "xrdp_bitmap_load: error bitmap file [%s] "
|
||||||
"xrdp_bitmap_load: error bitmap file [%s] read error",filename);
|
"read error", filename);
|
||||||
g_file_close(fd);
|
g_file_close(fd);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if ((type1[0] != 'B') || (type1[1] != 'M'))
|
if ((type1[0] != 'B') || (type1[1] != 'M'))
|
||||||
{
|
{
|
||||||
log_message(LOG_LEVEL_ERROR,
|
log_message(LOG_LEVEL_ERROR, "xrdp_bitmap_load: error bitmap file [%s] "
|
||||||
"xrdp_bitmap_load: error bitmap file [%s] not BMP file", filename);
|
"not BMP file", filename);
|
||||||
g_file_close(fd);
|
g_file_close(fd);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -398,8 +398,8 @@ xrdp_bitmap_load(struct xrdp_bitmap* self, const char* filename, int* palette)
|
|||||||
if ((header.bit_count != 4) && (header.bit_count != 8) &&
|
if ((header.bit_count != 4) && (header.bit_count != 8) &&
|
||||||
(header.bit_count != 24))
|
(header.bit_count != 24))
|
||||||
{
|
{
|
||||||
log_message(LOG_LEVEL_ERROR,
|
log_message(LOG_LEVEL_ERROR, "xrdp_bitmap_load: error bitmap file [%s] "
|
||||||
"xrdp_bitmap_load: error bitmap file [%s] bad bpp %d",filename, header.bit_count);
|
"bad bpp %d", filename, header.bit_count);
|
||||||
free_stream(s);
|
free_stream(s);
|
||||||
g_file_close(fd);
|
g_file_close(fd);
|
||||||
return 1;
|
return 1;
|
||||||
@ -417,8 +417,8 @@ xrdp_bitmap_load(struct xrdp_bitmap* self, const char* filename, int* palette)
|
|||||||
k = g_file_read(fd, s->data + i * size, size);
|
k = g_file_read(fd, s->data + i * size, size);
|
||||||
if (k != size)
|
if (k != size)
|
||||||
{
|
{
|
||||||
log_message(LOG_LEVEL_ERROR,
|
log_message(LOG_LEVEL_ERROR, "xrdp_bitmap_load: error bitmap "
|
||||||
"xrdp_bitmap_load: error bitmap file [%s] read",filename);
|
"file [%s] read", filename);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (i = 0; i < self->height; i++)
|
for (i = 0; i < self->height; i++)
|
||||||
@ -471,8 +471,8 @@ xrdp_bitmap_load(struct xrdp_bitmap* self, const char* filename, int* palette)
|
|||||||
k = g_file_read(fd, s->data + i * size, size);
|
k = g_file_read(fd, s->data + i * size, size);
|
||||||
if (k != size)
|
if (k != size)
|
||||||
{
|
{
|
||||||
log_message(LOG_LEVEL_ERROR,
|
log_message(LOG_LEVEL_ERROR, "xrdp_bitmap_load: error bitmap "
|
||||||
"xrdp_bitmap_load: error bitmap file [%s] read", filename);
|
"file [%s] read", filename);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (i = 0; i < self->height; i++)
|
for (i = 0; i < self->height; i++)
|
||||||
@ -521,8 +521,8 @@ xrdp_bitmap_load(struct xrdp_bitmap* self, const char* filename, int* palette)
|
|||||||
k = g_file_read(fd, s->data + i * size, size);
|
k = g_file_read(fd, s->data + i * size, size);
|
||||||
if (k != size)
|
if (k != size)
|
||||||
{
|
{
|
||||||
log_message(LOG_LEVEL_ERROR,
|
log_message(LOG_LEVEL_ERROR, "xrdp_bitmap_load: error bitmap "
|
||||||
"xrdp_bitmap_load: error bitmap file [%s] read",filename);
|
"file [%s] read", filename);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (i = 0; i < self->height; i++)
|
for (i = 0; i < self->height; i++)
|
||||||
@ -564,8 +564,8 @@ xrdp_bitmap_load(struct xrdp_bitmap* self, const char* filename, int* palette)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
log_message(LOG_LEVEL_ERROR,
|
log_message(LOG_LEVEL_ERROR, "xrdp_bitmap_load: error loading bitmap "
|
||||||
"xrdp_bitmap_load: error loading bitmap from file [%s]", filename);
|
"from file [%s]", filename);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@ -1305,7 +1305,7 @@ xrdp_bitmap_invalidate(struct xrdp_bitmap* self, struct xrdp_rect* rect)
|
|||||||
h = (h / 2) + 2;
|
h = (h / 2) + 2;
|
||||||
y = y + (h / 2) + 1;
|
y = y + (h / 2) + 1;
|
||||||
painter->fg_color = self->wm->black;
|
painter->fg_color = self->wm->black;
|
||||||
for (i=w; i>0; i=i-2)
|
for (i=w; i>0; i=i-2)
|
||||||
{
|
{
|
||||||
xrdp_painter_fill_rect(painter, self, x, y, i, 1);
|
xrdp_painter_fill_rect(painter, self, x, y, i, 1);
|
||||||
y++;
|
y++;
|
||||||
|
@ -355,7 +355,7 @@ xrdp_listen_main_loop(struct xrdp_listen* self)
|
|||||||
timeout = -1;
|
timeout = -1;
|
||||||
if (trans_get_wait_objs(self->listen_trans, robjs, &robjs_count) != 0)
|
if (trans_get_wait_objs(self->listen_trans, robjs, &robjs_count) != 0)
|
||||||
{
|
{
|
||||||
g_writeln("Listening socket is in wrong state we terminate listener") ;
|
g_writeln("Listening socket is in wrong state we terminate listener") ;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* wait - timeout -1 means wait indefinitely*/
|
/* wait - timeout -1 means wait indefinitely*/
|
||||||
@ -375,7 +375,7 @@ xrdp_listen_main_loop(struct xrdp_listen* self)
|
|||||||
}
|
}
|
||||||
if (g_is_wait_obj_set(done_obj)) /* pro_done_event */
|
if (g_is_wait_obj_set(done_obj)) /* pro_done_event */
|
||||||
{
|
{
|
||||||
g_reset_wait_obj(done_obj);
|
g_reset_wait_obj(done_obj);
|
||||||
/* a process has died remove it from lists*/
|
/* a process has died remove it from lists*/
|
||||||
xrdp_listen_delete_done_pro(self);
|
xrdp_listen_delete_done_pro(self);
|
||||||
}
|
}
|
||||||
|
@ -1845,7 +1845,7 @@ void init_channel_allowed(struct xrdp_wm* wm)
|
|||||||
/* first reset allowedchannels */
|
/* first reset allowedchannels */
|
||||||
for (i = 0; i < MAX_NR_CHANNELS; i++)
|
for (i = 0; i < MAX_NR_CHANNELS; i++)
|
||||||
{
|
{
|
||||||
/* 0 is a valid channel so we use -1 to mark the index as unused */
|
/* 0 is a valid channel so we use -1 to mark the index as unused */
|
||||||
wm->allowedchannels[i] = -1;
|
wm->allowedchannels[i] = -1;
|
||||||
}
|
}
|
||||||
names = list_create();
|
names = list_create();
|
||||||
|
Loading…
Reference in New Issue
Block a user