Replaced fprintf(stderr with DEBUG_WARN

This commit is contained in:
Armin Novak 2014-08-07 22:20:53 +02:00
parent b897c6a433
commit 084da200cf
9 changed files with 70 additions and 70 deletions

View File

@ -34,19 +34,19 @@ static const AUDIO_FORMAT supported_audio_formats[] =
static void mf_peer_audin_opening(audin_server_context* context)
{
fprintf(stderr, "AUDIN opening.\n");
DEBUG_WARN( "AUDIN opening.\n");
/* Simply choose the first format supported by the client. */
context->SelectFormat(context, 0);
}
static void mf_peer_audin_open_result(audin_server_context* context, UINT32 result)
{
fprintf(stderr, "AUDIN open result %d.\n", result);
DEBUG_WARN( "AUDIN open result %d.\n", result);
}
static void mf_peer_audin_receive_samples(audin_server_context* context, const void* buf, int nframes)
{
fprintf(stderr, "AUDIN receive %d frames.\n", nframes);
DEBUG_WARN( "AUDIN receive %d frames.\n", nframes);
}
void mf_peer_audin_init(mfPeerContext* context)

View File

@ -51,7 +51,7 @@ void mf_signal_event(mfEventQueue* event_queue)
length = write(event_queue->pipe_fd[1], "sig", 4);
if (length != 4)
fprintf(stderr, "mf_signal_event: error\n");
DEBUG_WARN( "mf_signal_event: error\n");
}
void mf_set_event(mfEventQueue* event_queue)
@ -61,7 +61,7 @@ void mf_set_event(mfEventQueue* event_queue)
length = write(event_queue->pipe_fd[1], "sig", 4);
if (length != 4)
fprintf(stderr, "mf_set_event: error\n");
DEBUG_WARN( "mf_set_event: error\n");
}
void mf_clear_events(mfEventQueue* event_queue)
@ -73,7 +73,7 @@ void mf_clear_events(mfEventQueue* event_queue)
length = read(event_queue->pipe_fd[0], &length, 4);
if (length != 4)
fprintf(stderr, "mf_clear_event: error\n");
DEBUG_WARN( "mf_clear_event: error\n");
}
}
@ -84,7 +84,7 @@ void mf_clear_event(mfEventQueue* event_queue)
length = read(event_queue->pipe_fd[0], &length, 4);
if (length != 4)
fprintf(stderr, "mf_clear_event: error\n");
DEBUG_WARN( "mf_clear_event: error\n");
}
void mf_event_push(mfEventQueue* event_queue, mfEvent* event)
@ -188,7 +188,7 @@ mfEventQueue* mf_event_queue_new()
event_queue->events = (mfEvent**) malloc(sizeof(mfEvent*) * event_queue->size);
if (pipe(event_queue->pipe_fd) < 0)
fprintf(stderr, "mf_event_queue_new: pipe failed\n");
DEBUG_WARN( "mf_event_queue_new: pipe failed\n");
pthread_mutex_init(&(event_queue->mutex), NULL);
}

View File

@ -356,8 +356,8 @@ void mf_input_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code)
/*
if (flags & KBD_FLAGS_EXTENDED)
fprintf(stderr, "extended ");
fprintf(stderr, "keypress: down = %d, SCAN=%#0X, VK=%#0X\n", keyDown, code, keymap[code]);
DEBUG_WARN( "extended ");
DEBUG_WARN( "keypress: down = %d, SCAN=%#0X, VK=%#0X\n", keyDown, code, keymap[code]);
*/
}
@ -548,7 +548,7 @@ void mf_input_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y)
void mf_input_extended_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y)
{
fprintf(stderr, "Unhandled mouse event!!!\n");
DEBUG_WARN( "Unhandled mouse event!!!\n");
/*
if ((flags & PTR_XFLAGS_BUTTON1) || (flags & PTR_XFLAGS_BUTTON2))
{

View File

@ -83,7 +83,7 @@ BOOL mf_peer_check_fds(freerdp_peer* client)
{
if (event->type == MF_EVENT_TYPE_REGION)
{
fprintf(stderr, "unhandled event\n");
DEBUG_WARN( "unhandled event\n");
}
else if (event->type == MF_EVENT_TYPE_FRAME_TICK)
{
@ -237,10 +237,10 @@ void mf_peer_init(freerdp_peer* client)
if(info_timer)
{
//fprintf(stderr, "created timer\n");
//DEBUG_WARN( "created timer\n");
dispatch_source_set_timer(info_timer, DISPATCH_TIME_NOW, 42ull * NSEC_PER_MSEC, 100ull * NSEC_PER_MSEC);
dispatch_source_set_event_handler(info_timer, ^{
//fprintf(stderr, "dispatch\n");
//DEBUG_WARN( "dispatch\n");
mfEvent* event = mf_event_new(MF_EVENT_TYPE_FRAME_TICK);
mf_event_push(info_event_queue, (mfEvent*) event);}
);
@ -253,17 +253,17 @@ BOOL mf_peer_post_connect(freerdp_peer* client)
mfPeerContext* context = (mfPeerContext*) client->context;
rdpSettings* settings = client->settings;
fprintf(stderr, "Client %s post connect\n", client->hostname);
DEBUG_WARN( "Client %s post connect\n", client->hostname);
if (client->settings->AutoLogonEnabled)
{
fprintf(stderr, " and wants to login automatically as %s\\%s",
DEBUG_WARN( " and wants to login automatically as %s\\%s",
client->settings->Domain ? client->settings->Domain : "",
client->settings->Username);
/* A real server may perform OS login here if NLA is not executed previously. */
}
fprintf(stderr, "\n");
DEBUG_WARN( "\n");
mfInfo* mfi = mf_info_get_instance();
mfi->scale = 1;
@ -274,7 +274,7 @@ BOOL mf_peer_post_connect(freerdp_peer* client)
if ((settings->DesktopWidth != mfi->servscreen_width) || (settings->DesktopHeight != mfi->servscreen_height))
{
fprintf(stderr, "Client requested resolution %dx%d, but will resize to %dx%d\n",
DEBUG_WARN( "Client requested resolution %dx%d, but will resize to %dx%d\n",
settings->DesktopWidth, settings->DesktopHeight, mfi->servscreen_width, mfi->servscreen_height);
}
@ -314,12 +314,12 @@ BOOL mf_peer_activate(freerdp_peer* client)
void mf_peer_synchronize_event(rdpInput* input, UINT32 flags)
{
fprintf(stderr, "Client sent a synchronize event (flags:0x%08X)\n", flags);
DEBUG_WARN( "Client sent a synchronize event (flags:0x%08X)\n", flags);
}
void mf_peer_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code)
{
fprintf(stderr, "Client sent a keyboard event (flags:0x%04X code:0x%04X)\n", flags, code);
DEBUG_WARN( "Client sent a keyboard event (flags:0x%04X code:0x%04X)\n", flags, code);
UINT16 down = 0x4000;
//UINT16 up = 0x8000;
@ -341,28 +341,28 @@ void mf_peer_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code)
void mf_peer_unicode_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code)
{
fprintf(stderr, "Client sent a unicode keyboard event (flags:0x%04X code:0x%04X)\n", flags, code);
DEBUG_WARN( "Client sent a unicode keyboard event (flags:0x%04X code:0x%04X)\n", flags, code);
}
/*void mf_peer_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y)
{
//fprintf(stderr, "Client sent a mouse event (flags:0x%04X pos: %d,%d)\n", flags, x, y);
//DEBUG_WARN( "Client sent a mouse event (flags:0x%04X pos: %d,%d)\n", flags, x, y);
}
void mf_peer_extended_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y)
{
//fprintf(stderr, "Client sent an extended mouse event (flags:0x%04X pos: %d,%d)\n", flags, x, y);
//DEBUG_WARN( "Client sent an extended mouse event (flags:0x%04X pos: %d,%d)\n", flags, x, y);
}
*/
/*static void mf_peer_refresh_rect(rdpContext* context, BYTE count, RECTANGLE_16* areas)
{
BYTE i;
fprintf(stderr, "Client requested to refresh:\n");
DEBUG_WARN( "Client requested to refresh:\n");
for (i = 0; i < count; i++)
{
fprintf(stderr, " (%d, %d) (%d, %d)\n", areas[i].left, areas[i].top, areas[i].right, areas[i].bottom);
DEBUG_WARN( " (%d, %d) (%d, %d)\n", areas[i].left, areas[i].top, areas[i].right, areas[i].bottom);
}
}*/
@ -370,11 +370,11 @@ static void mf_peer_suppress_output(rdpContext* context, BYTE allow, RECTANGLE_1
{
if (allow > 0)
{
fprintf(stderr, "Client restore output (%d, %d) (%d, %d).\n", area->left, area->top, area->right, area->bottom);
DEBUG_WARN( "Client restore output (%d, %d) (%d, %d).\n", area->left, area->top, area->right, area->bottom);
}
else
{
fprintf(stderr, "Client minimized and suppress output.\n");
DEBUG_WARN( "Client minimized and suppress output.\n");
}
}
@ -425,7 +425,7 @@ void* mf_peer_main_loop(void* arg)
client->Initialize(client);
context = (mfPeerContext*) client->context;
fprintf(stderr, "We've got a client %s\n", client->local ? "(local)" : client->hostname);
DEBUG_WARN( "We've got a client %s\n", client->local ? "(local)" : client->hostname);
while (1)
{
@ -433,12 +433,12 @@ void* mf_peer_main_loop(void* arg)
if (client->GetFileDescriptor(client, rfds, &rcount) != TRUE)
{
fprintf(stderr, "Failed to get FreeRDP file descriptor\n");
DEBUG_WARN( "Failed to get FreeRDP file descriptor\n");
break;
}
if (mf_peer_get_fds(client, rfds, &rcount) != TRUE)
{
fprintf(stderr, "Failed to get mfreerdp file descriptor\n");
DEBUG_WARN( "Failed to get mfreerdp file descriptor\n");
break;
}
@ -468,20 +468,20 @@ void* mf_peer_main_loop(void* arg)
(errno == EINPROGRESS) ||
(errno == EINTR))) /* signal occurred */
{
fprintf(stderr, "select failed\n");
DEBUG_WARN( "select failed\n");
break;
}
}
if (client->CheckFileDescriptor(client) != TRUE)
{
fprintf(stderr, "Failed to check freerdp file descriptor\n");
DEBUG_WARN( "Failed to check freerdp file descriptor\n");
break;
}
if ((mf_peer_check_fds(client)) != TRUE)
{
fprintf(stderr, "Failed to check mfreerdp file descriptor\n");
DEBUG_WARN( "Failed to check mfreerdp file descriptor\n");
break;
}
@ -491,7 +491,7 @@ void* mf_peer_main_loop(void* arg)
}
}
fprintf(stderr, "Client %s disconnected.\n", client->local ? "(local)" : client->hostname);
DEBUG_WARN( "Client %s disconnected.\n", client->local ? "(local)" : client->hostname);
client->Disconnect(client);
freerdp_peer_context_free(client);

View File

@ -60,7 +60,7 @@ static void mf_server_main_loop(freerdp_listener* instance)
if (instance->GetFileDescriptor(instance, rfds, &rcount) != TRUE)
{
fprintf(stderr, "Failed to get FreeRDP file descriptor\n");
DEBUG_WARN( "Failed to get FreeRDP file descriptor\n");
break;
}
@ -88,14 +88,14 @@ static void mf_server_main_loop(freerdp_listener* instance)
(errno == EINPROGRESS) ||
(errno == EINTR))) /* signal occurred */
{
fprintf(stderr, "select failed\n");
DEBUG_WARN( "select failed\n");
break;
}
}
if (instance->CheckFileDescriptor(instance) != TRUE)
{
fprintf(stderr, "Failed to check FreeRDP file descriptor\n");
DEBUG_WARN( "Failed to check FreeRDP file descriptor\n");
break;
}
}

View File

@ -44,7 +44,7 @@ int xf_cursor_init(xfInfo* xfi)
if (!XFixesQueryExtension(xfi->display, &event, &error))
{
fprintf(stderr, "XFixesQueryExtension failed\n");
DEBUG_WARN( "XFixesQueryExtension failed\n");
return -1;
}

View File

@ -34,7 +34,7 @@
void xf_input_synchronize_event(rdpInput* input, UINT32 flags)
{
fprintf(stderr, "Client sent a synchronize event (flags:0x%X)\n", flags);
DEBUG_WARN( "Client sent a synchronize event (flags:0x%X)\n", flags);
}
void xf_input_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code)
@ -71,7 +71,7 @@ void xf_input_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code)
void xf_input_unicode_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code)
{
fprintf(stderr, "Client sent a unicode keyboard event (flags:0x%X code:0x%X)\n", flags, code);
DEBUG_WARN( "Client sent a unicode keyboard event (flags:0x%X code:0x%X)\n", flags, code);
}
void xf_input_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y)

View File

@ -53,7 +53,7 @@ void* xf_server_thread(void* param)
ZeroMemory(rfds, sizeof(rfds));
if (listener->GetFileDescriptor(listener, rfds, &rcount) != TRUE)
{
fprintf(stderr, "Failed to get FreeRDP file descriptor\n");
DEBUG_WARN( "Failed to get FreeRDP file descriptor\n");
break;
}
@ -81,14 +81,14 @@ void* xf_server_thread(void* param)
(errno == EINPROGRESS) ||
(errno == EINTR))) /* signal occurred */
{
fprintf(stderr, "select failed\n");
DEBUG_WARN( "select failed\n");
break;
}
}
if (listener->CheckFileDescriptor(listener) != TRUE)
{
fprintf(stderr, "Failed to check FreeRDP file descriptor\n");
DEBUG_WARN( "Failed to check FreeRDP file descriptor\n");
break;
}
}

View File

@ -64,7 +64,7 @@ void xf_xdamage_init(xfInfo* xfi)
if (XDamageQueryExtension(xfi->display, &damage_event, &damage_error) == 0)
{
fprintf(stderr, "XDamageQueryExtension failed\n");
DEBUG_WARN( "XDamageQueryExtension failed\n");
return;
}
@ -72,12 +72,12 @@ void xf_xdamage_init(xfInfo* xfi)
if (XDamageQueryVersion(xfi->display, &major, &minor) == 0)
{
fprintf(stderr, "XDamageQueryVersion failed\n");
DEBUG_WARN( "XDamageQueryVersion failed\n");
return;
}
else if (major < 1)
{
fprintf(stderr, "XDamageQueryVersion failed: major:%d minor:%d\n", major, minor);
DEBUG_WARN( "XDamageQueryVersion failed: major:%d minor:%d\n", major, minor);
return;
}
@ -86,7 +86,7 @@ void xf_xdamage_init(xfInfo* xfi)
if (xfi->xdamage == None)
{
fprintf(stderr, "XDamageCreate failed\n");
DEBUG_WARN( "XDamageCreate failed\n");
return;
}
@ -95,7 +95,7 @@ void xf_xdamage_init(xfInfo* xfi)
if (xfi->xdamage_region == None)
{
fprintf(stderr, "XFixesCreateRegion failed\n");
DEBUG_WARN( "XFixesCreateRegion failed\n");
XDamageDestroy(xfi->display, xfi->xdamage);
xfi->xdamage = None;
return;
@ -120,13 +120,13 @@ int xf_xshm_init(xfInfo* xfi)
if (pixmaps != True)
{
fprintf(stderr, "XShmQueryVersion failed\n");
DEBUG_WARN( "XShmQueryVersion failed\n");
return -1;
}
}
else
{
fprintf(stderr, "XShmQueryExtension failed\n");
DEBUG_WARN( "XShmQueryExtension failed\n");
return -1;
}
@ -138,7 +138,7 @@ int xf_xshm_init(xfInfo* xfi)
if (!xfi->fb_image)
{
fprintf(stderr, "XShmCreateImage failed\n");
DEBUG_WARN( "XShmCreateImage failed\n");
return -1;
}
@ -147,7 +147,7 @@ int xf_xshm_init(xfInfo* xfi)
if (xfi->fb_shm_info.shmid == -1)
{
fprintf(stderr, "shmget failed\n");
DEBUG_WARN( "shmget failed\n");
return -1;
}
@ -157,7 +157,7 @@ int xf_xshm_init(xfInfo* xfi)
if (xfi->fb_shm_info.shmaddr == ((char*) -1))
{
fprintf(stderr, "shmat failed\n");
DEBUG_WARN( "shmat failed\n");
return -1;
}
@ -166,7 +166,7 @@ int xf_xshm_init(xfInfo* xfi)
shmctl(xfi->fb_shm_info.shmid, IPC_RMID, 0);
fprintf(stderr, "display: %p root_window: %p width: %d height: %d depth: %d\n",
DEBUG_WARN( "display: %p root_window: %p width: %d height: %d depth: %d\n",
xfi->display, (void*) xfi->root_window, xfi->fb_image->width, xfi->fb_image->height, xfi->fb_image->depth);
xfi->fb_pixmap = XShmCreatePixmap(xfi->display,
@ -212,13 +212,13 @@ xfInfo* xf_info_init()
setenv("DISPLAY", ":0", 1); /* Set DISPLAY variable if not already set */
if (!XInitThreads())
fprintf(stderr, "warning: XInitThreads() failure\n");
DEBUG_WARN( "warning: XInitThreads() failure\n");
xfi->display = XOpenDisplay(NULL);
if (!xfi->display)
{
fprintf(stderr, "failed to open display: %s\n", XDisplayName(NULL));
DEBUG_WARN( "failed to open display: %s\n", XDisplayName(NULL));
exit(1);
}
@ -236,7 +236,7 @@ xfInfo* xf_info_init()
if (!pfs)
{
fprintf(stderr, "XListPixmapFormats failed\n");
DEBUG_WARN( "XListPixmapFormats failed\n");
exit(1);
}
@ -261,7 +261,7 @@ xfInfo* xf_info_init()
if (!vis)
{
fprintf(stderr, "XGetVisualInfo failed\n");
DEBUG_WARN( "XGetVisualInfo failed\n");
exit(1);
}
@ -420,23 +420,23 @@ BOOL xf_peer_post_connect(freerdp_peer* client)
* The server may start sending graphics output and receiving keyboard/mouse input after this
* callback returns.
*/
fprintf(stderr, "Client %s is activated", client->hostname);
DEBUG_WARN( "Client %s is activated", client->hostname);
if (client->settings->AutoLogonEnabled)
{
fprintf(stderr, " and wants to login automatically as %s\\%s",
DEBUG_WARN( " and wants to login automatically as %s\\%s",
client->settings->Domain ? client->settings->Domain : "",
client->settings->Username);
/* A real server may perform OS login here if NLA is not executed previously. */
}
fprintf(stderr, "\n");
DEBUG_WARN( "\n");
fprintf(stderr, "Client requested desktop: %dx%dx%d\n",
DEBUG_WARN( "Client requested desktop: %dx%dx%d\n",
client->settings->DesktopWidth, client->settings->DesktopHeight, client->settings->ColorDepth);
if (!client->settings->RemoteFxCodec)
{
fprintf(stderr, "Client does not support RemoteFX\n");
DEBUG_WARN( "Client does not support RemoteFX\n");
return FALSE;
}
@ -530,7 +530,7 @@ static void* xf_peer_main_loop(void* arg)
ZeroMemory(rfds, sizeof(rfds));
ZeroMemory(&timeout, sizeof(struct timeval));
fprintf(stderr, "We've got a client %s\n", client->hostname);
DEBUG_WARN( "We've got a client %s\n", client->hostname);
xf_peer_init(client);
xfp = (xfPeerContext*) client->context;
@ -559,13 +559,13 @@ static void* xf_peer_main_loop(void* arg)
if (client->GetFileDescriptor(client, rfds, &rcount) != TRUE)
{
fprintf(stderr, "Failed to get FreeRDP file descriptor\n");
DEBUG_WARN( "Failed to get FreeRDP file descriptor\n");
break;
}
if (xf_peer_get_fds(client, rfds, &rcount) != TRUE)
{
fprintf(stderr, "Failed to get xfreerdp file descriptor\n");
DEBUG_WARN( "Failed to get xfreerdp file descriptor\n");
break;
}
@ -596,25 +596,25 @@ static void* xf_peer_main_loop(void* arg)
(errno == EINPROGRESS) ||
(errno == EINTR))) /* signal occurred */
{
fprintf(stderr, "select failed\n");
DEBUG_WARN( "select failed\n");
break;
}
}
if (client->CheckFileDescriptor(client) != TRUE)
{
fprintf(stderr, "Failed to check freerdp file descriptor\n");
DEBUG_WARN( "Failed to check freerdp file descriptor\n");
break;
}
if ((xf_peer_check_fds(client)) != TRUE)
{
fprintf(stderr, "Failed to check xfreerdp file descriptor\n");
DEBUG_WARN( "Failed to check xfreerdp file descriptor\n");
break;
}
}
fprintf(stderr, "Client %s disconnected.\n", client->hostname);
DEBUG_WARN( "Client %s disconnected.\n", client->hostname);
client->Disconnect(client);