printf -> writeln

ulab-original
jsorg71 19 years ago
parent b1b3ff9e7d
commit 770a27bfb3

@ -25,9 +25,11 @@
/* check for debug */
#ifdef XRDP_DEBUG
#define DEBUG(args) g_printf args;
#define DEBUG(args) g_writeln args;
#define LIB_DEBUG(_mod, _text) _mod->server_msg(_mod, _text, 1);
#else
#define DEBUG(args)
#define LIB_DEBUG(_mod, _text)
#endif
/* other macros */
#undef MIN

@ -85,7 +85,7 @@ libxrdp_process_data(struct xrdp_session* session)
rv = 1;
break;
}
DEBUG(("libxrdp_process_data code %d\r\n", code));
DEBUG(("libxrdp_process_data code %d", code));
switch (code)
{
case -1:
@ -102,13 +102,13 @@ libxrdp_process_data(struct xrdp_session* session)
if (xrdp_rdp_process_data((struct xrdp_rdp*)session->rdp,
session->s) != 0)
{
DEBUG(("libxrdp_process_data returned non zero\r\n"));
DEBUG(("libxrdp_process_data returned non zero"));
cont = 0;
session->term = 1;
}
break;
default:
g_printf("unknown in libxrdp_process_data\r\n");
g_writeln("unknown in libxrdp_process_data");
break;
}
if (cont)
@ -257,11 +257,11 @@ libxrdp_send_bitmap(struct xrdp_session* session, int width, int height,
}
if (j > 32768)
{
g_printf("error, decompressed size too big, its %d\r\n", j);
g_writeln("error, decompressed size too big, its %d", j);
}
if (bufsize > 8192)
{
g_printf("error, compressed size too big, its %d\r\n", bufsize);
g_writeln("error, compressed size too big, its %d", bufsize);
}
s->p = s->end;
} while (total_bufsize < 4096 && i > 0);
@ -271,7 +271,7 @@ libxrdp_send_bitmap(struct xrdp_session* session, int width, int height,
RDP_DATA_PDU_UPDATE);
if (total_bufsize > 8192)
{
g_printf("error, total compressed size too big, its %d\r\n",
g_writeln("error, total compressed size too big, its %d",
total_bufsize);
}
}

@ -90,18 +90,18 @@ xrdp_iso_recv(struct xrdp_iso* self, struct stream* s)
{
int code;
DEBUG((" in xrdp_iso_recv\r\n"));
DEBUG((" in xrdp_iso_recv"));
if (xrdp_iso_recv_msg(self, s, &code) != 0)
{
DEBUG((" out xrdp_iso_recv xrdp_iso_recv_msg return non zero\r\n"));
DEBUG((" out xrdp_iso_recv xrdp_iso_recv_msg return non zero"));
return 1;
}
if (code != ISO_PDU_DT)
{
DEBUG((" out xrdp_iso_recv code != ISO_PDU_DT\r\n"));
DEBUG((" out xrdp_iso_recv code != ISO_PDU_DT"));
return 1;
}
DEBUG((" out xrdp_iso_recv\r\n"));
DEBUG((" out xrdp_iso_recv"));
return 0;
}
@ -139,7 +139,7 @@ xrdp_iso_incoming(struct xrdp_iso* self)
make_stream(s);
init_stream(s, 8192);
DEBUG((" in xrdp_iso_incoming\r\n"));
DEBUG((" in xrdp_iso_incoming"));
if (xrdp_iso_recv_msg(self, s, &code) != 0)
{
free_stream(s);
@ -155,7 +155,7 @@ xrdp_iso_incoming(struct xrdp_iso* self)
free_stream(s);
return 1;
}
DEBUG((" out xrdp_iso_incoming\r\n"));
DEBUG((" out xrdp_iso_incoming"));
free_stream(s);
return 0;
}
@ -177,7 +177,7 @@ xrdp_iso_send(struct xrdp_iso* self, struct stream* s)
{
int len;
DEBUG((" in xrdp_iso_send\r\n"));
DEBUG((" in xrdp_iso_send"));
s_pop_layer(s, iso_hdr);
len = s->end - s->p;
out_uint8(s, 3);
@ -190,6 +190,6 @@ xrdp_iso_send(struct xrdp_iso* self, struct stream* s)
{
return 1;
}
DEBUG((" out xrdp_iso_send\r\n"));
DEBUG((" out xrdp_iso_send"));
return 0;
}

@ -90,19 +90,19 @@ xrdp_mcs_recv(struct xrdp_mcs* self, struct stream* s, int* chan)
int opcode;
int len;
DEBUG((" in xrdp_mcs_recv\r\n"));
DEBUG((" in xrdp_mcs_recv"));
while (1)
{
if (xrdp_iso_recv(self->iso_layer, s) != 0)
{
DEBUG((" out xrdp_mcs_recv xrdp_iso_recv returned non zero\r\n"));
DEBUG((" out xrdp_mcs_recv xrdp_iso_recv returned non zero"));
return 1;
}
in_uint8(s, opcode);
appid = opcode >> 2;
if (appid == MCS_DPUM)
{
DEBUG((" out xrdp_mcs_recv appid != MCS_DPUM\r\n"));
DEBUG((" out xrdp_mcs_recv appid != MCS_DPUM"));
return 1;
}
if (appid == MCS_CJRQ)
@ -114,7 +114,7 @@ xrdp_mcs_recv(struct xrdp_mcs* self, struct stream* s, int* chan)
}
if (appid != MCS_SDRQ)
{
DEBUG((" out xrdp_mcs_recv err got 0x%x need MCS_SDRQ\r\n", appid));
DEBUG((" out xrdp_mcs_recv err got 0x%x need MCS_SDRQ", appid));
return 1;
}
in_uint8s(s, 2);
@ -125,7 +125,7 @@ xrdp_mcs_recv(struct xrdp_mcs* self, struct stream* s, int* chan)
{
in_uint8s(s, 1);
}
DEBUG((" out xrdp_mcs_recv\r\n"));
DEBUG((" out xrdp_mcs_recv"));
return 0;
}
@ -523,7 +523,7 @@ xrdp_mcs_send_connect_response(struct xrdp_mcs* self)
int APP_CC
xrdp_mcs_incoming(struct xrdp_mcs* self)
{
DEBUG((" in xrdp_mcs_incoming\r\n"));
DEBUG((" in xrdp_mcs_incoming"));
if (xrdp_iso_incoming(self->iso_layer) != 0)
{
return 1;
@ -564,7 +564,7 @@ xrdp_mcs_incoming(struct xrdp_mcs* self)
{
return 1;
}
DEBUG((" out xrdp_mcs_incoming\r\n"));
DEBUG((" out xrdp_mcs_incoming"));
return 0;
}
@ -585,7 +585,7 @@ xrdp_mcs_send(struct xrdp_mcs* self, struct stream* s)
{
int len;
DEBUG((" in xrdp_mcs_send\r\n"));
DEBUG((" in xrdp_mcs_send"));
s_pop_layer(s, mcs_hdr);
len = (s->end - s->p) - 8;
len = len | 0x8000;
@ -598,7 +598,7 @@ xrdp_mcs_send(struct xrdp_mcs* self, struct stream* s)
{
return 1;
}
DEBUG((" out xrdp_mcs_send\r\n"));
DEBUG((" out xrdp_mcs_send"));
return 0;
}

@ -119,7 +119,7 @@ xrdp_orders_send(struct xrdp_orders* self)
if (self->order_level == 0 && self->order_count > 0)
{
s_mark_end(self->out_s);
DEBUG(("xrdp_orders_send sending %d orders\r\n", self->order_count));
DEBUG(("xrdp_orders_send sending %d orders", self->order_count));
self->order_count_ptr[0] = self->order_count;
self->order_count_ptr[1] = self->order_count >> 8;
self->order_count = 0;
@ -141,7 +141,7 @@ xrdp_orders_force_send(struct xrdp_orders* self)
if (self->order_level > 0 && self->order_count > 0)
{
s_mark_end(self->out_s);
DEBUG(("xrdp_orders_force_send sending %d orders\r\n", self->order_count));
DEBUG(("xrdp_orders_force_send sending %d orders", self->order_count));
self->order_count_ptr[0] = self->order_count;
self->order_count_ptr[1] = self->order_count >> 8;
if (xrdp_rdp_send_data(self->rdp_layer, self->out_s,
@ -1478,12 +1478,12 @@ xrdp_orders_send_raw_bitmap(struct xrdp_orders* self,
if (width > 64)
{
g_printf("error, width > 64\r\n");
g_writeln("error, width > 64");
return 1;
}
if (height > 64)
{
g_printf("error, height > 64\r\n");
g_writeln("error, height > 64");
return 1;
}
e = width % 4;
@ -1560,12 +1560,12 @@ xrdp_orders_send_bitmap(struct xrdp_orders* self,
if (width > 64)
{
g_printf("error, width > 64\r\n");
g_writeln("error, width > 64");
return 1;
}
if (height > 64)
{
g_printf("error, height > 64\r\n");
g_writeln("error, height > 64");
return 1;
}
e = width % 4;
@ -1585,8 +1585,8 @@ xrdp_orders_send_bitmap(struct xrdp_orders* self,
{
free_stream(s);
free_stream(temp_s);
g_printf("error in xrdp_orders_send_bitmap, lines_sending(%d) != \
height(%d)\r\n", lines_sending, height);
g_writeln("error in xrdp_orders_send_bitmap, lines_sending(%d) != \
height(%d)", lines_sending, height);
return 1;
}
bufsize = s->p - p;
@ -1681,12 +1681,12 @@ xrdp_orders_send_raw_bitmap2(struct xrdp_orders* self,
if (width > 64)
{
g_printf("error, width > 64\r\n");
g_writeln("error, width > 64");
return 1;
}
if (height > 64)
{
g_printf("error, height > 64\r\n");
g_writeln("error, height > 64");
return 1;
}
e = width % 4;
@ -1764,12 +1764,12 @@ xrdp_orders_send_bitmap2(struct xrdp_orders* self,
if (width > 64)
{
g_printf("error, width > 64\r\n");
g_writeln("error, width > 64");
return 1;
}
if (height > 64)
{
g_printf("error, height > 64\r\n");
g_writeln("error, height > 64");
return 1;
}
e = width % 4;
@ -1789,8 +1789,8 @@ xrdp_orders_send_bitmap2(struct xrdp_orders* self,
{
free_stream(s);
free_stream(temp_s);
g_printf("error in xrdp_orders_send_bitmap2, lines_sending(%d) != \
height(%d)\r\n", lines_sending, height);
g_writeln("error in xrdp_orders_send_bitmap2, lines_sending(%d) != \
height(%d)", lines_sending, height);
return 1;
}
bufsize = s->p - p;

@ -179,7 +179,7 @@ xrdp_rdp_recv(struct xrdp_rdp* self, struct stream* s, int* code)
int pdu_code;
int chan;
DEBUG(("in xrdp_rdp_recv\r\n"));
DEBUG(("in xrdp_rdp_recv"));
if (s->next_packet == 0 || s->next_packet >= s->end)
{
chan = 0;
@ -188,19 +188,19 @@ xrdp_rdp_recv(struct xrdp_rdp* self, struct stream* s, int* code)
{
s->next_packet = 0;
*code = -1;
DEBUG(("out xrdp_rdp_recv\r\n"));
DEBUG(("out xrdp_rdp_recv"));
return 0;
}
if (error != 0)
{
DEBUG(("out xrdp_rdp_recv error\r\n"));
DEBUG(("out xrdp_rdp_recv error"));
return 1;
}
if (chan != MCS_GLOBAL_CHANNEL && chan > 0)
{
s->next_packet = 0;
*code = 0;
DEBUG(("out xrdp_rdp_recv\r\n"));
DEBUG(("out xrdp_rdp_recv"));
return 0;
}
s->next_packet = s->p;
@ -214,14 +214,14 @@ xrdp_rdp_recv(struct xrdp_rdp* self, struct stream* s, int* code)
{
s->next_packet += 8;
*code = 0;
DEBUG(("out xrdp_rdp_recv\r\n"));
DEBUG(("out xrdp_rdp_recv"));
return 0;
}
in_uint16_le(s, pdu_code);
*code = pdu_code & 0xf;
in_uint8s(s, 2); /* mcs user id */
s->next_packet += len;
DEBUG(("out xrdp_rdp_recv\r\n"));
DEBUG(("out xrdp_rdp_recv"));
return 0;
}
@ -231,7 +231,7 @@ xrdp_rdp_send(struct xrdp_rdp* self, struct stream* s, int pdu_type)
{
int len;
DEBUG(("in xrdp_rdp_send\r\n"));
DEBUG(("in xrdp_rdp_send"));
s_pop_layer(s, rdp_hdr);
len = s->end - s->p;
out_uint16_le(s, len);
@ -239,10 +239,10 @@ xrdp_rdp_send(struct xrdp_rdp* self, struct stream* s, int pdu_type)
out_uint16_le(s, self->mcs_channel);
if (xrdp_sec_send(self->sec_layer, s) != 0)
{
DEBUG(("out xrdp_rdp_send error\r\n"));
DEBUG(("out xrdp_rdp_send error"));
return 1;
}
DEBUG(("out xrdp_rdp_send\r\n"));
DEBUG(("out xrdp_rdp_send"));
return 0;
}
@ -253,7 +253,7 @@ xrdp_rdp_send_data(struct xrdp_rdp* self, struct stream* s,
{
int len;
DEBUG(("in xrdp_rdp_send_data\r\n"));
DEBUG(("in xrdp_rdp_send_data"));
s_pop_layer(s, rdp_hdr);
len = s->end - s->p;
out_uint16_le(s, len);
@ -268,10 +268,10 @@ xrdp_rdp_send_data(struct xrdp_rdp* self, struct stream* s,
out_uint16_le(s, 0);
if (xrdp_sec_send(self->sec_layer, s) != 0)
{
DEBUG(("out xrdp_rdp_send_data error\r\n"));
DEBUG(("out xrdp_rdp_send_data error"));
return 1;
}
DEBUG(("out xrdp_rdp_send_data\r\n"));
DEBUG(("out xrdp_rdp_send_data"));
return 0;
}
@ -321,7 +321,7 @@ xrdp_rdp_parse_client_mcs_data(struct xrdp_rdp* self)
self->client_info.bpp = 16;
}
p->p = p->data;
DEBUG(("client width %d, client height %d bpp %d\r\n",
DEBUG(("client width %d, client height %d bpp %d",
self->client_info.width, self->client_info.height,
self->client_info.bpp));
return 0;
@ -331,7 +331,7 @@ xrdp_rdp_parse_client_mcs_data(struct xrdp_rdp* self)
int APP_CC
xrdp_rdp_incoming(struct xrdp_rdp* self)
{
DEBUG(("in xrdp_rdp_incoming\r\n"));
DEBUG(("in xrdp_rdp_incoming"));
if (xrdp_sec_incoming(self->sec_layer) != 0)
{
return 1;
@ -339,7 +339,7 @@ xrdp_rdp_incoming(struct xrdp_rdp* self)
self->mcs_channel = self->sec_layer->mcs_layer->userid +
MCS_USERCHANNEL_BASE;
xrdp_rdp_parse_client_mcs_data(self);
DEBUG(("out xrdp_rdp_incoming mcs channel %d\r\n", self->mcs_channel));
DEBUG(("out xrdp_rdp_incoming mcs channel %d", self->mcs_channel));
return 0;
}
@ -528,11 +528,11 @@ xrdp_process_capset_bmpcache(struct xrdp_rdp* self, struct stream* s,
in_uint16_le(s, self->client_info.cache2_size);
in_uint16_le(s, self->client_info.cache3_entries);
in_uint16_le(s, self->client_info.cache3_size);
DEBUG(("cache1 entries %d size %d\r\n", self->client_info.cache1_entries,
DEBUG(("cache1 entries %d size %d", self->client_info.cache1_entries,
self->client_info.cache1_size));
DEBUG(("cache2 entries %d size %d\r\n", self->client_info.cache2_entries,
DEBUG(("cache2 entries %d size %d", self->client_info.cache2_entries,
self->client_info.cache2_size));
DEBUG(("cache3 entries %d size %d\r\n", self->client_info.cache3_entries,
DEBUG(("cache3 entries %d size %d", self->client_info.cache3_entries,
self->client_info.cache3_size));
return 0;
}
@ -564,11 +564,11 @@ xrdp_process_capset_bmpcache2(struct xrdp_rdp* self, struct stream* s,
i = MIN(i, 2000);
self->client_info.cache3_entries = i;
self->client_info.cache3_size = 4096 * Bpp;
DEBUG(("cache1 entries %d size %d\r\n", self->client_info.cache1_entries,
DEBUG(("cache1 entries %d size %d", self->client_info.cache1_entries,
self->client_info.cache1_size));
DEBUG(("cache2 entries %d size %d\r\n", self->client_info.cache2_entries,
DEBUG(("cache2 entries %d size %d", self->client_info.cache2_entries,
self->client_info.cache2_size));
DEBUG(("cache3 entries %d size %d\r\n", self->client_info.cache3_entries,
DEBUG(("cache3 entries %d size %d", self->client_info.cache3_entries,
self->client_info.cache3_size));
return 0;
}
@ -600,7 +600,7 @@ xrdp_rdp_process_confirm_active(struct xrdp_rdp* self, struct stream* s)
int len;
char* p;
DEBUG(("in xrdp_rdp_process_confirm_active\r\n"));
DEBUG(("in xrdp_rdp_process_confirm_active"));
in_uint8s(s, 4); /* rdp_shareid */
in_uint8s(s, 2); /* userid */
in_uint16_le(s, source_len); /* sizeof RDP_SOURCE */
@ -616,71 +616,71 @@ xrdp_rdp_process_confirm_active(struct xrdp_rdp* self, struct stream* s)
switch (type)
{
case RDP_CAPSET_GENERAL: /* 1 */
DEBUG(("RDP_CAPSET_GENERAL\r\n"));
DEBUG(("RDP_CAPSET_GENERAL"));
xrdp_process_capset_general(self, s, len);
break;
case RDP_CAPSET_BITMAP: /* 2 */
DEBUG(("RDP_CAPSET_BITMAP\r\n"));
DEBUG(("RDP_CAPSET_BITMAP"));
break;
case RDP_CAPSET_ORDER: /* 3 */
DEBUG(("RDP_CAPSET_ORDER\r\n"));
DEBUG(("RDP_CAPSET_ORDER"));
xrdp_process_capset_order(self, s, len);
break;
case RDP_CAPSET_BMPCACHE: /* 4 */
DEBUG(("RDP_CAPSET_BMPCACHE\r\n"));
DEBUG(("RDP_CAPSET_BMPCACHE"));
xrdp_process_capset_bmpcache(self, s, len);
break;
case RDP_CAPSET_CONTROL: /* 5 */
DEBUG(("RDP_CAPSET_CONTROL\r\n"));
DEBUG(("RDP_CAPSET_CONTROL"));
break;
case RDP_CAPSET_ACTIVATE: /* 7 */
DEBUG(("RDP_CAPSET_ACTIVATE\r\n"));
DEBUG(("RDP_CAPSET_ACTIVATE"));
break;
case RDP_CAPSET_POINTER: /* 8 */
DEBUG(("RDP_CAPSET_POINTER\r\n"));
DEBUG(("RDP_CAPSET_POINTER"));
xrdp_process_capset_pointercache(self, s, len);
break;
case RDP_CAPSET_SHARE: /* 9 */
DEBUG(("RDP_CAPSET_SHARE\r\n"));
DEBUG(("RDP_CAPSET_SHARE"));
break;
case RDP_CAPSET_COLCACHE: /* 10 */
DEBUG(("RDP_CAPSET_COLCACHE\r\n"));
DEBUG(("RDP_CAPSET_COLCACHE"));
break;
case 12: /* 12 */
DEBUG(("--12\r\n"));
DEBUG(("--12"));
break;
case 13: /* 13 */
DEBUG(("--13\r\n"));
DEBUG(("--13"));
break;
case 14: /* 14 */
DEBUG(("--14\r\n"));
DEBUG(("--14"));
break;
case 15: /* 15 */
DEBUG(("--15\r\n"));
DEBUG(("--15"));
break;
case 16: /* 16 */
DEBUG(("--16\r\n"));
DEBUG(("--16"));
break;
case 17: /* 17 */
DEBUG(("--16\r\n"));
DEBUG(("--16"));
break;
case RDP_CAPSET_BMPCACHE2: /* 19 */
DEBUG(("RDP_CAPSET_BMPCACHE2\r\n"));
DEBUG(("RDP_CAPSET_BMPCACHE2"));
xrdp_process_capset_bmpcache2(self, s, len);
break;
case 20: /* 20 */
DEBUG(("--20\r\n"));
DEBUG(("--20"));
break;
case 21: /* 21 */
DEBUG(("--21\r\n"));
DEBUG(("--21"));
break;
default:
g_printf("unknown in xrdp_rdp_process_confirm_active %d\r\n", type);
g_writeln("unknown in xrdp_rdp_process_confirm_active %d", type);
break;
}
s->p = p + len;
}
DEBUG(("out xrdp_rdp_process_confirm_active\r\n"));
DEBUG(("out xrdp_rdp_process_confirm_active"));
return 0;
}
@ -706,7 +706,7 @@ xrdp_rdp_process_data_input(struct xrdp_rdp* self, struct stream* s)
in_uint16_le(s, num_events);
in_uint8s(s, 2); /* pad */
DEBUG(("in xrdp_rdp_process_data_input %d events\r\n", num_events));
DEBUG(("in xrdp_rdp_process_data_input %d events", num_events));
for (index = 0; index < num_events; index++)
{
in_uint32_le(s, time);
@ -715,7 +715,7 @@ xrdp_rdp_process_data_input(struct xrdp_rdp* self, struct stream* s)
in_sint16_le(s, param1);
in_sint16_le(s, param2);
DEBUG(("xrdp_rdp_process_data_input event %4.4x flags %4.4x param1 %d \
param2 %d time %d\r\n", msg_type, device_flags, param1, param2, time));
param2 %d time %d", msg_type, device_flags, param1, param2, time));
if (self->session->callback != 0)
{
/* msg_type can be
@ -727,7 +727,7 @@ param2 %d time %d\r\n", msg_type, device_flags, param1, param2, time));
device_flags, time);
}
}
DEBUG(("out xrdp_rdp_process_data_input\r\n"));
DEBUG(("out xrdp_rdp_process_data_input"));
return 0;
}
@ -942,7 +942,7 @@ xrdp_rdp_process_data(struct xrdp_rdp* self, struct stream* s)
in_uint8(s, data_type);
in_uint8(s, ctype);
in_uint16_le(s, clen);
DEBUG(("xrdp_rdp_process_data code %d\r\n", data_type));
DEBUG(("xrdp_rdp_process_data code %d", data_type));
switch (data_type)
{
case RDP_DATA_PDU_POINTER: /* 27 */
@ -976,7 +976,7 @@ xrdp_rdp_process_data(struct xrdp_rdp* self, struct stream* s)
xrdp_rdp_process_data_font(self, s);
break;
default:
g_printf("unknown in xrdp_rdp_process_data %d\r\n", data_type);
g_writeln("unknown in xrdp_rdp_process_data %d", data_type);
break;
}
return 0;

@ -392,7 +392,7 @@ xrdp_sec_process_logon_info(struct xrdp_sec* self, struct stream* s)
//g_hexdump(s->p, 100);
in_uint8s(s, 4);
in_uint32_le(s, flags);
DEBUG(("in xrdp_sec_process_logon_info flags $%x\r\n", flags));
DEBUG(("in xrdp_sec_process_logon_info flags $%x", flags));
/* this is the first test that the decrypt is working */
if ((flags & RDP_LOGON_NORMAL) != RDP_LOGON_NORMAL) /* 0x33 */
{ /* must be or error */
@ -583,14 +583,14 @@ xrdp_sec_recv(struct xrdp_sec* self, struct stream* s, int* chan)
int flags;
int len;
DEBUG((" in xrdp_sec_recv\r\n"));
DEBUG((" in xrdp_sec_recv"));
if (xrdp_mcs_recv(self->mcs_layer, s, chan) != 0)
{
DEBUG((" out xrdp_sec_recv error\r\n"));
DEBUG((" out xrdp_sec_recv error"));
return 1;
}
in_uint32_le(s, flags);
DEBUG((" in xrdp_sec_recv flags $%x\r\n", flags));
DEBUG((" in xrdp_sec_recv flags $%x", flags));
if (flags & SEC_ENCRYPT) /* 0x08 */
{
in_uint8s(s, 8); /* signature */
@ -604,36 +604,36 @@ xrdp_sec_recv(struct xrdp_sec* self, struct stream* s, int* chan)
self->pub_mod, self->pri_exp);
xrdp_sec_establish_keys(self);
*chan = 1; /* just set a non existing channel and exit */
DEBUG((" out xrdp_sec_recv\r\n"));
DEBUG((" out xrdp_sec_recv"));
return 0;
}
if (flags & SEC_LOGON_INFO) /* 0x40 */
{
if (xrdp_sec_process_logon_info(self, s) != 0)
{
DEBUG((" out xrdp_sec_recv error\r\n"));
DEBUG((" out xrdp_sec_recv error"));
return 1;
}
if (xrdp_sec_send_lic_initial(self) != 0)
{
DEBUG((" out xrdp_sec_recv error\r\n"));
DEBUG((" out xrdp_sec_recv error"));
return 1;
}
*chan = 1; /* just set a non existing channel and exit */
DEBUG((" out xrdp_sec_recv\r\n"));
DEBUG((" out xrdp_sec_recv"));
return 0;
}
if (flags & SEC_LICENCE_NEG) /* 0x80 */
{
if (xrdp_sec_send_lic_response(self) != 0)
{
DEBUG((" out xrdp_sec_recv error\r\n"));
DEBUG((" out xrdp_sec_recv error"));
return 1;
}
DEBUG((" out xrdp_sec_recv\r\n"));
DEBUG((" out xrdp_sec_recv"));
return -1; /* special error that means send demand active */
}
DEBUG((" out xrdp_sec_recv\r\n"));
DEBUG((" out xrdp_sec_recv"));
return 0;
}
@ -686,7 +686,7 @@ xrdp_sec_send(struct xrdp_sec* self, struct stream* s)
{
int datalen;
DEBUG((" in xrdp_sec_send\r\n"));
DEBUG((" in xrdp_sec_send"));
s_pop_layer(s, sec_hdr);
if (self->crypt_level > 1)
{
@ -703,7 +703,7 @@ xrdp_sec_send(struct xrdp_sec* self, struct stream* s)
{
return 1;
}
DEBUG((" out xrdp_sec_send\r\n"));
DEBUG((" out xrdp_sec_send"));
return 0;
}
@ -817,21 +817,21 @@ xrdp_sec_in_mcs_data(struct xrdp_sec* self)
int APP_CC
xrdp_sec_incoming(struct xrdp_sec* self)
{
DEBUG(("in xrdp_sec_incoming\r\n"));
DEBUG(("in xrdp_sec_incoming"));
xrdp_sec_out_mcs_data(self);
if (xrdp_mcs_incoming(self->mcs_layer) != 0)
{
return 1;
}
#ifdef XRDP_DEBUG
g_printf("client mcs data received\r\n");
g_writeln("client mcs data received");
g_hexdump(self->client_mcs_data.data,
self->client_mcs_data.end - self->client_mcs_data.data);
g_printf("server mcs data sent\r\n");
g_writeln("server mcs data sent");
g_hexdump(self->server_mcs_data.data,
self->server_mcs_data.end - self->server_mcs_data.data);
#endif
DEBUG(("out xrdp_sec_incoming\r\n"));
DEBUG(("out xrdp_sec_incoming"));
xrdp_sec_in_mcs_data(self);
return 0;
}

@ -60,10 +60,10 @@ xrdp_tcp_recv(struct xrdp_tcp* self, struct stream* s, int len)
if (self->sck_closed)
{
DEBUG((" in xrdp_tcp_recv, sck closed\r\n"));
DEBUG((" in xrdp_tcp_recv, sck closed"));
return 1;
}
DEBUG((" in xrdp_tcp_recv, gota get %d bytes\r\n", len));
DEBUG((" in xrdp_tcp_recv, gota get %d bytes", len));
init_stream(s, len);
while (len > 0)
{
@ -77,14 +77,14 @@ xrdp_tcp_recv(struct xrdp_tcp* self, struct stream* s, int len)
else
{
self->sck_closed = 1;
DEBUG((" error = -1 in xrdp_tcp_recv socket %d\r\n", self->sck));
DEBUG((" error = -1 in xrdp_tcp_recv socket %d", self->sck));
return 1;
}
}
else if (rcvd == 0)
{
self->sck_closed = 1;
DEBUG((" error = 0 in xrdp_tcp_recv socket %d\r\n", self->sck));
DEBUG((" error = 0 in xrdp_tcp_recv socket %d", self->sck));
return 1;
}
else
@ -93,7 +93,7 @@ xrdp_tcp_recv(struct xrdp_tcp* self, struct stream* s, int len)
len -= rcvd;
}
}
DEBUG((" out xrdp_tcp_recv\r\n"));
DEBUG((" out xrdp_tcp_recv"));
return 0;
}
@ -108,11 +108,11 @@ xrdp_tcp_send(struct xrdp_tcp* self, struct stream* s)
if (self->sck_closed)
{
DEBUG((" in xrdp_tcp_send, sck closed\r\n"));
DEBUG((" in xrdp_tcp_send, sck closed"));
return 1;
}
len = s->end - s->data;
DEBUG((" in xrdp_tcp_send, gota send %d bytes\r\n", len));
DEBUG((" in xrdp_tcp_send, gota send %d bytes", len));
total = 0;
while (total < len)
{
@ -126,14 +126,14 @@ xrdp_tcp_send(struct xrdp_tcp* self, struct stream* s)
else
{
self->sck_closed = 1;
DEBUG((" error = -1 in xrdp_tcp_send socket %d\r\n", self->sck));
DEBUG((" error = -1 in xrdp_tcp_send socket %d", self->sck));
return 1;
}
}
else if (sent == 0)
{
self->sck_closed = 1;
DEBUG((" error = 0 in xrdp_tcp_send socket %d\r\n", self->sck));
DEBUG((" error = 0 in xrdp_tcp_send socket %d", self->sck));
return 1;
}
else
@ -141,6 +141,6 @@ xrdp_tcp_send(struct xrdp_tcp* self, struct stream* s)
total = total + sent;
}
}
DEBUG((" out xrdp_tcp_send, sent %d bytes ok\r\n", len));
DEBUG((" out xrdp_tcp_send, sent %d bytes ok", len));
return 0;
}

@ -27,14 +27,14 @@
int DEFAULT_CC
lib_mod_start(struct mod* mod, int w, int h, int bpp)
{
DEBUG(("in lib_mod_start\r\n"));
DEBUG(("in lib_mod_start"));
mod->width = w;
mod->height = h;
mod->rdp_bpp = bpp;
mod->xrdp_bpp = bpp;
mod->keylayout = 0x409;
g_strncpy(mod->port, "3389", 255); /* default */
DEBUG(("out lib_mod_start\r\n"));
DEBUG(("out lib_mod_start"));
return 0;
}
@ -43,7 +43,7 @@ lib_mod_start(struct mod* mod, int w, int h, int bpp)
int DEFAULT_CC
lib_mod_connect(struct mod* mod)
{
DEBUG(("in lib_mod_connect\r\n"));
DEBUG(("in lib_mod_connect"));
/* clear screen */
mod->server_begin_update(mod);
mod->server_set_fgcolor(mod, 0);
@ -53,10 +53,10 @@ lib_mod_connect(struct mod* mod)
if (rdp_rdp_connect(mod->rdp_layer, mod->ip, mod->port) == 0)
{
mod->sck = mod->rdp_layer->sec_layer->mcs_layer->iso_layer->tcp_layer->sck;
DEBUG(("out lib_mod_connect\r\n"));
DEBUG(("out lib_mod_connect"));
return 0;
}
DEBUG(("out lib_mod_connect error\r\n"));
DEBUG(("out lib_mod_connect error"));
return 1;
}
@ -72,7 +72,7 @@ lib_mod_event(struct mod* mod, int msg, long param1, long param2,
{
return 0;
}
DEBUG(("in lib_mod_event\r\n"));
DEBUG(("in lib_mod_event"));
make_stream(s);
init_stream(s, 8192 * 2);
switch (msg)
@ -145,7 +145,7 @@ lib_mod_event(struct mod* mod, int msg, long param1, long param2,
break;
}
free_stream(s);
DEBUG(("out lib_mod_event\r\n"));
DEBUG(("out lib_mod_event"));
return 0;
}
@ -158,7 +158,7 @@ lib_mod_signal(struct mod* mod)
int cont;
struct stream* s;
DEBUG(("in lib_mod_signal\r\n"));
DEBUG(("in lib_mod_signal"));
if (mod->in_s == 0)
{
make_stream(mod->in_s);
@ -171,10 +171,10 @@ lib_mod_signal(struct mod* mod)
type = 0;
if (rdp_rdp_recv(mod->rdp_layer, s, &type) != 0)
{
DEBUG(("out lib_mod_signal error rdp_rdp_recv failed\r\n"));
DEBUG(("out lib_mod_signal error rdp_rdp_recv failed"));
return 1;
}
DEBUG(("lib_mod_signal type %d\r\n", type));
DEBUG(("lib_mod_signal type %d", type));
switch (type)
{
case RDP_PDU_DATA:
@ -196,7 +196,7 @@ lib_mod_signal(struct mod* mod)
}
cont = s->next_packet < s->end;
}
DEBUG(("out lib_mod_signal\r\n"));
DEBUG(("out lib_mod_signal"));
return 0;
}
@ -255,7 +255,7 @@ mod_init(void)
{
struct mod* mod;
DEBUG(("in mod_init\r\n"));
DEBUG(("in mod_init"));
mod = (struct mod*)g_malloc(sizeof(struct mod), 1);
mod->size = sizeof(struct mod);
mod->handle = (long)mod;
@ -266,7 +266,7 @@ mod_init(void)
mod->mod_end = lib_mod_end;
mod->mod_set_param = lib_mod_set_param;
mod->rdp_layer = rdp_rdp_create(mod);
DEBUG(("out mod_init\r\n"));
DEBUG(("out mod_init"));
return mod;
}
@ -274,8 +274,8 @@ mod_init(void)
int EXPORT_CC
mod_exit(struct mod* mod)
{
DEBUG(("in mod_exit\r\n"));
DEBUG(("in mod_exit"));
g_free(mod);
DEBUG(("out mod_exit\r\n"));
DEBUG(("out mod_exit"));
return 0;
}

@ -57,20 +57,20 @@ rdp_iso_recv_msg(struct rdp_iso* self, struct stream* s, int* code)
*code = 0;
if (rdp_tcp_recv(self->tcp_layer, s, 4) != 0)
{
DEBUG((" out rdp_iso_recv_msg error rdp_tcp_recv 1 failed\r\n"));
DEBUG((" out rdp_iso_recv_msg error rdp_tcp_recv 1 failed"));
return 1;
}
in_uint8(s, ver);
if (ver != 3)
{
DEBUG((" out rdp_iso_recv_msg error ver != 3\r\n"));
DEBUG((" out rdp_iso_recv_msg error ver != 3"));
return 1;
}
in_uint8s(s, 1);
in_uint16_be(s, len);
if (rdp_tcp_recv(self->tcp_layer, s, len - 4) != 0)
{
DEBUG((" out rdp_iso_recv_msg error rdp_tcp_recv 2 failed\r\n"));
DEBUG((" out rdp_iso_recv_msg error rdp_tcp_recv 2 failed"));
return 1;
}
in_uint8s(s, 1);
@ -168,20 +168,20 @@ rdp_iso_connect(struct rdp_iso* self, char* ip, char* port)
int code;
struct stream* s;
DEBUG((" in rdp_iso_connect\r\n"));
DEBUG((" in rdp_iso_connect"));
make_stream(s);
init_stream(s, 8192);
if (rdp_tcp_connect(self->tcp_layer, ip, port) != 0)
{
free_stream(s);
DEBUG((" out rdp_iso_connect error rdp_tcp_connect failed\r\n"));
DEBUG((" out rdp_iso_connect error rdp_tcp_connect failed"));
return 1;
}
if (rdp_iso_send_msg(self, s, ISO_PDU_CR) != 0)
{
free_stream(s);
rdp_tcp_disconnect(self->tcp_layer);
DEBUG((" out rdp_iso_connect error rdp_iso_send_msg failed\r\n"));
DEBUG((" out rdp_iso_connect error rdp_iso_send_msg failed"));
return 1;
}
init_stream(s, 8192);
@ -189,18 +189,18 @@ rdp_iso_connect(struct rdp_iso* self, char* ip, char* port)
{
free_stream(s);
rdp_tcp_disconnect(self->tcp_layer);
DEBUG((" out rdp_iso_connect error rdp_iso_recv_msg failed\r\n"));
DEBUG((" out rdp_iso_connect error rdp_iso_recv_msg failed"));
return 1;
}
if (code != ISO_PDU_CC)
{
free_stream(s);
rdp_tcp_disconnect(self->tcp_layer);
DEBUG((" out rdp_iso_connect error code != ISO_PDU_CC\r\n"));
DEBUG((" out rdp_iso_connect error code != ISO_PDU_CC"));
return 1;
}
free_stream(s);
DEBUG((" out rdp_iso_connect\r\n"));
DEBUG((" out rdp_iso_connect"));
return 0;
}

@ -60,7 +60,7 @@ rdp_mcs_recv(struct rdp_mcs* self, struct stream* s, int* chan)
int opcode;
int len;
DEBUG((" in rdp_mcs_recv\r\n"));
DEBUG((" in rdp_mcs_recv"));
if (rdp_iso_recv(self->iso_layer, s) != 0)
{
return 1;
@ -69,7 +69,7 @@ rdp_mcs_recv(struct rdp_mcs* self, struct stream* s, int* chan)
appid = opcode >> 2;
if (appid != MCS_SDIN)
{
DEBUG((" out rdp_mcs_recv error\r\n"));
DEBUG((" out rdp_mcs_recv error"));
return 1;
}
in_uint8s(s, 2);
@ -80,7 +80,7 @@ rdp_mcs_recv(struct rdp_mcs* self, struct stream* s, int* chan)
{
in_uint8s(s, 1);
}
DEBUG((" out rdp_mcs_recv\r\n"));
DEBUG((" out rdp_mcs_recv"));
return 0;
}
@ -489,10 +489,10 @@ rdp_mcs_recv_cjcf(struct rdp_mcs* self)
int APP_CC
rdp_mcs_connect(struct rdp_mcs* self, char* ip, char* port)
{
DEBUG((" in rdp_mcs_connect\r\n"));
DEBUG((" in rdp_mcs_connect"));
if (rdp_iso_connect(self->iso_layer, ip, port) != 0)
{
DEBUG((" out rdp_mcs_connect error rdp_iso_connect failed\r\n"));
DEBUG((" out rdp_mcs_connect error rdp_iso_connect failed"));
return 1;
}
rdp_mcs_send_connection_initial(self);
@ -500,7 +500,7 @@ rdp_mcs_connect(struct rdp_mcs* self, char* ip, char* port)
{
rdp_iso_disconnect(self->iso_layer);
DEBUG((" out rdp_mcs_connect error rdp_mcs_recv_connection_response \
failed\r\n"));
failed"));
return 1;
}
rdp_mcs_send_edrq(self);
@ -508,24 +508,24 @@ failed\r\n"));
if (rdp_mcs_recv_aucf(self) != 0)
{
rdp_iso_disconnect(self->iso_layer);
DEBUG((" out rdp_mcs_connect error rdp_mcs_recv_aucf failed\r\n"));
DEBUG((" out rdp_mcs_connect error rdp_mcs_recv_aucf failed"));
return 1;
}
rdp_mcs_send_cjrq(self, self->userid + 1001);
if (rdp_mcs_recv_cjcf(self) != 0)
{
rdp_iso_disconnect(self->iso_layer);
DEBUG((" out rdp_mcs_connect error rdp_mcs_recv_cjcf 1 failed\r\n"));
DEBUG((" out rdp_mcs_connect error rdp_mcs_recv_cjcf 1 failed"));
return 1;
}
rdp_mcs_send_cjrq(self, MCS_GLOBAL_CHANNEL);
if (rdp_mcs_recv_cjcf(self) != 0)
{
rdp_iso_disconnect(self->iso_layer);
DEBUG((" out rdp_mcs_connect error rdp_mcs_recv_cjcf 2 failed\r\n"));
DEBUG((" out rdp_mcs_connect error rdp_mcs_recv_cjcf 2 failed"));
return 1;
}
DEBUG((" out rdp_mcs_connect\r\n"));
DEBUG((" out rdp_mcs_connect"));
return 0;
}

@ -666,7 +666,7 @@ rdp_rdp_send_login_info(struct rdp_rdp* self, int flags)
int sec_flags;
struct stream* s;
DEBUG(("in rdp_rdp_send_login_info\r\n"));
DEBUG(("in rdp_rdp_send_login_info"));
make_stream(s);
init_stream(s, 8192);
len_domain = 2 * g_strlen(self->mod->domain);
@ -678,7 +678,7 @@ rdp_rdp_send_login_info(struct rdp_rdp* self, int flags)
if (rdp_sec_init(self->sec_layer, s, sec_flags) != 0)
{
free_stream(s);
DEBUG(("out rdp_rdp_send_login_info error 1\r\n"));
DEBUG(("out rdp_rdp_send_login_info error 1"));
return 1;
}
out_uint32_le(s, 0);
@ -697,11 +697,11 @@ rdp_rdp_send_login_info(struct rdp_rdp* self, int flags)
if (rdp_sec_send(self->sec_layer, s, sec_flags) != 0)
{
free_stream(s);
DEBUG(("out rdp_rdp_send_login_info error 2\r\n"));
DEBUG(("out rdp_rdp_send_login_info error 2"));
return 1;
}
free_stream(s);
DEBUG(("out rdp_rdp_send_login_info\r\n"));
DEBUG(("out rdp_rdp_send_login_info"));
return 0;
}
@ -711,7 +711,7 @@ rdp_rdp_connect(struct rdp_rdp* self, char* ip, char* port)
{
int flags;
DEBUG(("in rdp_rdp_connect\r\n"));
DEBUG(("in rdp_rdp_connect"));
flags = RDP_LOGON_NORMAL;
if (g_strlen(self->mod->password) > 0)
{
@ -719,15 +719,15 @@ rdp_rdp_connect(struct rdp_rdp* self, char* ip, char* port)
}
if (rdp_sec_connect(self->sec_layer, ip, port) != 0)
{
DEBUG(("out rdp_rdp_connect error rdp_sec_connect failed\r\n"));
DEBUG(("out rdp_rdp_connect error rdp_sec_connect failed"));
return 1;
}
if (rdp_rdp_send_login_info(self, flags) != 0)
{
DEBUG(("out rdp_rdp_connect error rdp_rdp_send_login_info failed\r\n"));
DEBUG(("out rdp_rdp_connect error rdp_rdp_send_login_info failed"));
return 1;
}
DEBUG(("out rdp_rdp_connect\r\n"));
DEBUG(("out rdp_rdp_connect"));
return 0;
}
@ -787,12 +787,12 @@ rdp_rdp_recv(struct rdp_rdp* self, struct stream* s, int* type)
int chan;
chan = 0;
DEBUG(("in rdp_rdp_recv\r\n"));
DEBUG(("in rdp_rdp_recv"));
if (s->next_packet >= s->end || s->next_packet == 0)
{
if (rdp_sec_recv(self->sec_layer, s, &chan) != 0)
{
DEBUG(("error in rdp_rdp_recv, rdp_sec_recv failed\r\n"));
DEBUG(("error in rdp_rdp_recv, rdp_sec_recv failed"));
return 1;
}
s->next_packet = s->p;
@ -805,11 +805,11 @@ rdp_rdp_recv(struct rdp_rdp* self, struct stream* s, int* type)
if (chan == MCS_GLOBAL_CHANNEL)
{
in_uint16_le(s, len);
DEBUG(("rdp_rdp_recv got %d len\r\n", len));
DEBUG(("rdp_rdp_recv got %d len", len));
if (len == 0x8000)
{
s->next_packet += 8;
DEBUG(("out rdp_rdp_recv\r\n"));
DEBUG(("out rdp_rdp_recv"));
return 0;
}
in_uint16_le(s, pdu_type);
@ -820,10 +820,10 @@ rdp_rdp_recv(struct rdp_rdp* self, struct stream* s, int* type)
else
{
/* todo, process channel data */
DEBUG(("got channel data channel %d\r\n", chan));
DEBUG(("got channel data channel %d", chan));
s->next_packet = s->end;
}
DEBUG(("out rdp_rdp_recv\r\n"));
DEBUG(("out rdp_rdp_recv"));
return 0;
}

@ -138,14 +138,14 @@ rdp_sec_recv(struct rdp_sec* self, struct stream* s, int* chan)
{
int flags;
DEBUG((" in rdp_sec_recv\r\n"));
DEBUG((" in rdp_sec_recv"));
if (rdp_mcs_recv(self->mcs_layer, s, chan) != 0)
{
DEBUG((" error in rdp_sec_recv, rdp_mcs_recv failed\r\n"));
DEBUG((" error in rdp_sec_recv, rdp_mcs_recv failed"));
return 1;
}
in_uint32_le(s, flags);
DEBUG((" rdp_sec_recv flags %8.8x\r\n", flags));
DEBUG((" rdp_sec_recv flags %8.8x", flags));
if (flags & SEC_ENCRYPT) /* 0x08 */
{
in_uint8s(s, 8); /* signature */
@ -153,11 +153,11 @@ rdp_sec_recv(struct rdp_sec* self, struct stream* s, int* chan)
}
if (flags & SEC_LICENCE_NEG) /* 0x80 */
{
DEBUG((" in rdp_sec_recv, got SEC_LICENCE_NEG\r\n"));
DEBUG((" in rdp_sec_recv, got SEC_LICENCE_NEG"));
rdp_lic_process(self->lic_layer, s);
*chan = 0;
}
DEBUG((" out rdp_sec_recv\r\n"));
DEBUG((" out rdp_sec_recv"));
return 0;
}
@ -297,7 +297,7 @@ rdp_sec_parse_crypt_info(struct rdp_sec* self, struct stream* s,
in_uint16_le(s, tag);
in_uint16_le(s, length);
next_tag = s->p + length;
DEBUG((" rdp_sec_parse_crypt_info tag %d length %d\r\n", tag, length));
DEBUG((" rdp_sec_parse_crypt_info tag %d length %d", tag, length));
switch (tag)
{
case SEC_TAG_PUBKEY:
@ -398,8 +398,8 @@ rdp_sec_generate_keys(struct rdp_sec* self)
self->server_random);
rdp_sec_hash_16(self->encrypt_key, session_key + 32, self->client_random,
self->server_random);
DEBUG((" rdp_sec_generate_keys, rc4_key_size is %d\r\n", self->rc4_key_size));
DEBUG((" rdp_sec_generate_keys, crypt_level is %d\r\n", self->crypt_level));
DEBUG((" rdp_sec_generate_keys, rc4_key_size is %d", self->rc4_key_size));
DEBUG((" rdp_sec_generate_keys, crypt_level is %d", self->crypt_level));
if (self->rc4_key_size == 1)
{
rdp_sec_make_40bit(self->sign_key);
@ -430,7 +430,7 @@ rdp_sec_process_crypt_info(struct rdp_sec* self, struct stream* s)
g_memset(exponent, 0, sizeof(exponent));
if (!rdp_sec_parse_crypt_info(self, s, modulus, exponent))
{
DEBUG((" error in rdp_sec_process_crypt_info\r\n"));
DEBUG((" error in rdp_sec_process_crypt_info"));
return;
}
/* Generate a client random, and determine encryption keys */
@ -463,7 +463,7 @@ rdp_sec_process_mcs_data(struct rdp_sec* self)
{
in_uint16_le(s, tag);
in_uint16_le(s, length);
DEBUG((" rdp_sec_process_mcs_data tag %d length %d\r\n", tag, length));
DEBUG((" rdp_sec_process_mcs_data tag %d length %d", tag, length));
if (length <= 4)
{
return;
@ -496,7 +496,7 @@ rdp_sec_establish_key(struct rdp_sec* self)
int flags;
struct stream* s;
DEBUG((" sending client random\r\n"));
DEBUG((" sending client random"));
make_stream(s);
init_stream(s, 8192);
length = SEC_MODULUS_SIZE + SEC_PADDING_SIZE;
@ -524,20 +524,20 @@ rdp_sec_establish_key(struct rdp_sec* self)
int APP_CC
rdp_sec_connect(struct rdp_sec* self, char* ip, char* port)
{
DEBUG((" in rdp_sec_connect\r\n"));
DEBUG((" in rdp_sec_connect"));
rdp_sec_out_mcs_data(self);
if (rdp_mcs_connect(self->mcs_layer, ip, port) != 0)
{
DEBUG((" out rdp_sec_connect error rdp_mcs_connect failed\r\n"));
DEBUG((" out rdp_sec_connect error rdp_mcs_connect failed"));
return 1;
}
rdp_sec_process_mcs_data(self);
if (rdp_sec_establish_key(self) != 0)
{
DEBUG((" out rdp_sec_connect error rdp_sec_establish_key failed\r\n"));
DEBUG((" out rdp_sec_connect error rdp_sec_establish_key failed"));
return 1;
}
DEBUG((" out rdp_sec_connect\r\n"));
DEBUG((" out rdp_sec_connect"));
return 0;
}
@ -627,7 +627,7 @@ rdp_sec_send(struct rdp_sec* self, struct stream* s, int flags)
{
int datalen;
DEBUG((" in rdp_sec_send flags %8.8x\r\n", flags));
DEBUG((" in rdp_sec_send flags %8.8x", flags));
s_pop_layer(s, sec_hdr);
out_uint32_le(s, flags);
if (flags & SEC_ENCRYPT)
@ -639,9 +639,9 @@ rdp_sec_send(struct rdp_sec* self, struct stream* s, int flags)
}
if (rdp_mcs_send(self->mcs_layer, s) != 0)
{
DEBUG((" out rdp_sec_send, rdp_mcs_send failed\r\n"));
DEBUG((" out rdp_sec_send, rdp_mcs_send failed"));
return 1;
}
DEBUG((" out rdp_sec_send\r\n"));
DEBUG((" out rdp_sec_send"));
return 0;
}

@ -57,11 +57,11 @@ rdp_tcp_recv(struct rdp_tcp* self, struct stream* s, int len)
{
int rcvd;
DEBUG((" in rdp_tcp_recv gota get %d bytes on sck %d\r\n",
DEBUG((" in rdp_tcp_recv gota get %d bytes on sck %d",
len, self->sck));
if (self->sck_closed)
{
DEBUG((" out rdp_tcp_recv error sck closed\r\n"));
DEBUG((" out rdp_tcp_recv error sck closed"));
return 1;
}
init_stream(s, len);
@ -77,14 +77,14 @@ rdp_tcp_recv(struct rdp_tcp* self, struct stream* s, int len)
else
{
self->sck_closed = 1;
DEBUG((" out rdp_tcp_recv error unknown\r\n"));
DEBUG((" out rdp_tcp_recv error unknown"));
return 1;
}
}
else if (rcvd == 0)
{
self->sck_closed = 1;
DEBUG((" out rdp_tcp_recv error connection dropped\r\n"));
DEBUG((" out rdp_tcp_recv error connection dropped"));
return 1;
}
else
@ -107,11 +107,11 @@ rdp_tcp_send(struct rdp_tcp* self, struct stream* s)
if (self->sck_closed)
{
DEBUG((" out rdp_tcp_send error sck closed\r\n"));
DEBUG((" out rdp_tcp_send error sck closed"));
return 1;
}
len = s->end - s->data;
DEBUG((" in rdp_tcp_send gota send %d bytes on sck %d\r\n", len,
DEBUG((" in rdp_tcp_send gota send %d bytes on sck %d", len,
self->sck));
total = 0;
while (total < len)
@ -126,14 +126,14 @@ rdp_tcp_send(struct rdp_tcp* self, struct stream* s)
else
{
self->sck_closed = 1;
DEBUG((" out rdp_tcp_send error unknown\r\n"));
DEBUG((" out rdp_tcp_send error unknown"));
return 1;
}
}
else if (sent == 0)
{
self->sck_closed = 1;
DEBUG((" out rdp_tcp_send error connection dropped\r\n"));
DEBUG((" out rdp_tcp_send error connection dropped"));
return 1;
}
else
@ -149,7 +149,7 @@ rdp_tcp_send(struct rdp_tcp* self, struct stream* s)
int APP_CC
rdp_tcp_connect(struct rdp_tcp* self, char* ip, char* port)
{
DEBUG((" in rdp_tcp_connect ip %s port %s\r\n", ip, port));
DEBUG((" in rdp_tcp_connect ip %s port %s", ip, port));
self->sck = g_tcp_socket();
if (g_tcp_connect(self->sck, ip, port) == 0)
{
@ -157,10 +157,10 @@ rdp_tcp_connect(struct rdp_tcp* self, char* ip, char* port)
}
else
{
DEBUG((" out rdp_tcp_connect error g_tcp_connect failed\r\n"));
DEBUG((" out rdp_tcp_connect error g_tcp_connect failed"));
return 1;
}
DEBUG((" out rdp_tcp_connect\r\n"));
DEBUG((" out rdp_tcp_connect"));
return 0;
}

@ -135,6 +135,7 @@ lib_mod_event(struct vnc* v, int msg, long param1, long param2,
int y;
int cx;
int cy;
char text[256];
error = 0;
make_stream(s);
@ -259,8 +260,9 @@ lib_mod_event(struct vnc* v, int msg, long param1, long param2,
key = 0xff13;
break;
default:
g_printf("unkown key lib_mod_event msg %d \
param1 0x%4.4x param2 0x%4.4x\r\n", msg, param1, param2);
g_sprintf(text, "unkown key lib_mod_event msg %d \
param1 0x%4.4x param2 0x%4.4x", msg, param1, param2);
v->server_msg(v, text, 1);
break;
}
}
@ -464,6 +466,7 @@ lib_framebuffer_update(struct vnc* v)
char* d2;
char cursor_data[32 * (32 * 3)];
char cursor_mask[32 * (32 / 8)];
char text[256];
int num_recs;
int i;
int j;
@ -580,7 +583,8 @@ lib_framebuffer_update(struct vnc* v)
}
else
{
g_printf("error in lib_framebuffer_update\r\n");
g_sprintf(text, "error in lib_framebuffer_update");
v->server_msg(v, text, 1);
}
}
}
@ -683,6 +687,7 @@ lib_mod_signal(struct vnc* v)
{
char type;
int error;
char text[256];
error = lib_recv(v, &type, 1);
if (error == 0)
@ -701,7 +706,8 @@ lib_mod_signal(struct vnc* v)
}
else
{
g_printf("unknown in lib_mod_signal %d\r\n", type);
g_sprintf(text, "unknown in lib_mod_signal %d", type);
v->server_msg(v, text, 1);
}
}
return error;

@ -91,8 +91,8 @@ xrdp_shutdown(int sig)
{
return;
}
g_printf("shutting down\r\n");
g_printf("signal %d threadid %d\r\n", sig, g_get_threadid());
g_writeln("shutting down");
g_writeln("signal %d threadid %d", sig, g_get_threadid());
listen = g_listen;
g_listen = 0;
if (listen != 0)
@ -145,7 +145,7 @@ void DEFAULT_CC
pipe_sig(int sig_num)
{
/* do nothing */
g_printf("got SIGPIPE(%d)\r\n", sig_num);
g_writeln("got SIGPIPE(%d)", sig_num);
}
/*****************************************************************************/
@ -291,7 +291,7 @@ main(int argc, char** argv)
char text[32];
#endif
/* check compiled endian with actual edian */
/* check compiled endian with actual endian */
test = 1;
host_be = !((int)(*(unsigned char*)(&test)));
#if defined(B_ENDIAN)
@ -301,23 +301,23 @@ main(int argc, char** argv)
if (host_be)
#endif
{
g_printf("endian wrong, edit arch.h\r\n");
g_writeln("endian wrong, edit arch.h");
return 0;
}
/* check long, int and void* sizes */
if (sizeof(int) != 4)
{
g_printf("unusable int size, must be 4\r\n");
g_writeln("unusable int size, must be 4");
return 0;
}
if (sizeof(long) != sizeof(void*))
{
g_printf("long size must match void* size\r\n");
g_writeln("long size must match void* size");
return 0;
}
if (sizeof(long) != 4 && sizeof(long) != 8)
{
g_printf("unusable long size, must be 4 or 8\r\n");
g_writeln("unusable long size, must be 4 or 8");
return 0;
}
#if defined(_WIN32)
@ -328,16 +328,16 @@ main(int argc, char** argv)
g_strncasecmp(argv[1], "--help", 255) == 0 ||
g_strncasecmp(argv[1], "-h", 255) == 0)
{
g_printf("\r\n");
g_printf("xrdp: A Remote Desktop Protocol server.\r\n");
g_printf("Copyright (C) Jay Sorg 2004-2005\r\n");
g_printf("See http://xrdp.sourceforge.net for more information.\r\n");
g_printf("\r\n");
g_printf("Usage: xrdp [options]\r\n");
g_printf(" -h: show help\r\n");
g_printf(" -install: install service\r\n");
g_printf(" -remove: remove service\r\n");
g_printf("\r\n");
g_writeln("");
g_writeln("xrdp: A Remote Desktop Protocol server.");
g_writeln("Copyright (C) Jay Sorg 2004-2005");
g_writeln("See http://xrdp.sourceforge.net for more information.");
g_writeln("");
g_writeln("Usage: xrdp [options]");
g_writeln(" -h: show help");
g_writeln(" -install: install service");
g_writeln(" -remove: remove service");
g_writeln("");
g_exit(0);
}
else if (g_strncasecmp(argv[1], "-install", 255) == 0 ||
@ -348,7 +348,7 @@ main(int argc, char** argv)
sc_man = OpenSCManager(0, 0, GENERIC_WRITE);
if (sc_man == 0)
{
g_printf("error OpenSCManager, do you have rights?\r\n");
g_writeln("error OpenSCManager, do you have rights?");
g_exit(0);
}
/* check if service is allready installed */
@ -364,7 +364,7 @@ main(int argc, char** argv)
}
else
{
g_printf("error service is allready installed\r\n");
g_writeln("error service is allready installed");
CloseServiceHandle(sc_ser);
CloseServiceHandle(sc_man);
g_exit(0);
@ -380,14 +380,14 @@ main(int argc, char** argv)
sc_man = OpenSCManager(0, 0, GENERIC_WRITE);
if (sc_man == 0)
{
g_printf("error OpenSCManager, do you have rights?\r\n");
g_writeln("error OpenSCManager, do you have rights?");
g_exit(0);
}
/* check if service is allready installed */
sc_ser = OpenService(sc_man, "xrdp", SERVICE_ALL_ACCESS);
if (sc_ser == 0)
{
g_printf("error service is not installed\r\n");
g_writeln("error service is not installed");
CloseServiceHandle(sc_man);
g_exit(0);
}
@ -397,17 +397,17 @@ main(int argc, char** argv)
}
else
{
g_printf("Unknown Parameter\r\n");
g_printf("xrdp -h for help\r\n");
g_printf("\r\n");
g_writeln("Unknown Parameter");
g_writeln("xrdp -h for help");
g_writeln("");
g_exit(0);
}
}
else if (argc > 1)
{
g_printf("Unknown Parameter\r\n");
g_printf("xrdp -h for help\r\n");
g_printf("\r\n");
g_writeln("Unknown Parameter");
g_writeln("xrdp -h for help");
g_writeln("");
g_exit(0);
}
if (run_as_service)
@ -429,7 +429,7 @@ main(int argc, char** argv)
if (g_strncasecmp(argv[1], "-kill", 255) == 0 ||
g_strncasecmp(argv[1], "--kill", 255) == 0)
{
g_printf("stopping xrdp\r\n");
g_writeln("stopping xrdp");
/* read the xrdp.pid file */
fd = -1;
if (g_file_exist(XRDP_PID_FILE)) /* xrdp.pid */
@ -438,15 +438,15 @@ main(int argc, char** argv)
}
if (fd == -1)
{
g_printf("problem opening to xrdp.pid\r\n");
g_printf("maybe its not running\r\n");
g_writeln("problem opening to xrdp.pid");
g_writeln("maybe its not running");
}
else
{
g_memset(text, 0, 32);
g_file_read(fd, text, 31);
pid = g_atoi(text);
g_printf("stopping process id %d\r\n", pid);
g_writeln("stopping process id %d", pid);
if (pid > 0)
{
g_sigterm(pid);
@ -464,37 +464,37 @@ main(int argc, char** argv)
g_strncasecmp(argv[1], "--help", 255) == 0 ||
g_strncasecmp(argv[1], "-h", 255) == 0)
{
g_printf("\r\n");
g_printf("xrdp: A Remote Desktop Protocol server.\r\n");
g_printf("Copyright (C) Jay Sorg 2004-2005\r\n");
g_printf("See http://xrdp.sourceforge.net for more information.\r\n");
g_printf("\r\n");
g_printf("Usage: xrdp [options]\r\n");
g_printf(" -h: show help\r\n");
g_printf(" -nodaemon: don't fork into background\r\n");
g_printf(" -kill: shut down xrdp\r\n");
g_printf("\r\n");
g_writeln("");
g_writeln("xrdp: A Remote Desktop Protocol server.");
g_writeln("Copyright (C) Jay Sorg 2004-2005");
g_writeln("See http://xrdp.sourceforge.net for more information.");
g_writeln("");
g_writeln("Usage: xrdp [options]");
g_writeln(" -h: show help");
g_writeln(" -nodaemon: don't fork into background");
g_writeln(" -kill: shut down xrdp");
g_writeln("");
g_exit(0);
}
else
{
g_printf("Unknown Parameter\r\n");
g_printf("xrdp -h for help\r\n");
g_printf("\r\n");
g_writeln("Unknown Parameter");
g_writeln("xrdp -h for help");
g_writeln("");
g_exit(0);
}
}
else if (argc > 1)
{
g_printf("Unknown Parameter\r\n");
g_printf("xrdp -h for help\r\n");
g_printf("\r\n");
g_writeln("Unknown Parameter");
g_writeln("xrdp -h for help");
g_writeln("");
g_exit(0);
}
if (g_file_exist(XRDP_PID_FILE)) /* xrdp.pid */
{
g_printf("It looks like xrdp is allready running,\r\n");
g_printf("if not delete the xrdp.pid file and try again\r\n");
g_writeln("It looks like xrdp is allready running,");
g_writeln("if not delete the xrdp.pid file and try again");
g_exit(0);
}
if (!no_daemon)
@ -503,12 +503,12 @@ main(int argc, char** argv)
pid = g_fork();
if (pid == -1)
{
g_printf("problem forking\r\n");
g_writeln("problem forking");
g_exit(1);
}
if (0 != pid)
{
g_printf("process %d started ok\r\n", pid);
g_writeln("process %d started ok", pid);
/* exit, this is the main process */
g_exit(0);
}
@ -526,9 +526,9 @@ main(int argc, char** argv)
fd = g_file_open(XRDP_PID_FILE); /* xrdp.pid */
if (fd == -1)
{
g_printf("trying to write process id to xrdp.pid\r\n");
g_printf("problem opening xrdp.pid\r\n");
g_printf("maybe no rights\r\n");
g_writeln("trying to write process id to xrdp.pid");
g_writeln("problem opening xrdp.pid");
g_writeln("maybe no rights");
}
else
{

@ -158,7 +158,7 @@ xrdp_cache_add_bitmap(struct xrdp_cache* self, struct xrdp_bitmap* bitmap)
#endif
{
self->bitmap_items[i][j].stamp = self->bitmap_stamp;
DEBUG(("found bitmap at %d %d\r\n", i, j));
DEBUG(("found bitmap at %d %d", i, j));
xrdp_bitmap_delete(bitmap);
return MAKELONG(j, i);
}
@ -176,7 +176,7 @@ xrdp_cache_add_bitmap(struct xrdp_cache* self, struct xrdp_bitmap* bitmap)
#endif
{
self->bitmap_items[i][j].stamp = self->bitmap_stamp;
DEBUG(("found bitmap at %d %d\r\n", i, j));
DEBUG(("found bitmap at %d %d", i, j));
xrdp_bitmap_delete(bitmap);
return MAKELONG(j, i);
}
@ -194,7 +194,7 @@ xrdp_cache_add_bitmap(struct xrdp_cache* self, struct xrdp_bitmap* bitmap)
#endif
{
self->bitmap_items[i][j].stamp = self->bitmap_stamp;
DEBUG(("found bitmap at %d %d\r\n", i, j));
DEBUG(("found bitmap at %d %d", i, j));
xrdp_bitmap_delete(bitmap);
return MAKELONG(j, i);
}
@ -202,7 +202,7 @@ xrdp_cache_add_bitmap(struct xrdp_cache* self, struct xrdp_bitmap* bitmap)
}
else
{
g_printf("error in xrdp_cache_add_bitmap, too big(%d)\r\n", bmp_size);
g_writeln("error in xrdp_cache_add_bitmap, too big(%d)", bmp_size);
}
/* look for oldest */
cache_id = 0;
@ -247,7 +247,7 @@ xrdp_cache_add_bitmap(struct xrdp_cache* self, struct xrdp_bitmap* bitmap)
}
}
}
DEBUG(("adding bitmap at %d %d\r\n", cache_id, cache_idx));
DEBUG(("adding bitmap at %d %d", cache_id, cache_idx));
/* set, send bitmap and return */
xrdp_bitmap_delete(self->bitmap_items[cache_id][cache_idx].bitmap);
self->bitmap_items[cache_id][cache_idx].bitmap = bitmap;
@ -358,7 +358,7 @@ xrdp_cache_add_char(struct xrdp_cache* self,
if (xrdp_font_item_compare(&self->char_items[i][j].font_item, font_item))
{
self->char_items[i][j].stamp = self->char_stamp;
DEBUG(("found font at %d %d\r\n", i, j));
DEBUG(("found font at %d %d", i, j));
return MAKELONG(j, i);
}
}
@ -379,7 +379,7 @@ xrdp_cache_add_char(struct xrdp_cache* self,
}
}
}
DEBUG(("adding char at %d %d\r\n", f, c));
DEBUG(("adding char at %d %d", f, c));
/* set, send char and return */
fi = &self->char_items[f][c].font_item;
g_free(fi->data);
@ -426,7 +426,7 @@ xrdp_cache_add_pointer(struct xrdp_cache* self,
self->pointer_items[i].stamp = self->pointer_stamp;
xrdp_wm_set_pointer(self->wm, i);
self->wm->current_pointer = i;
DEBUG(("found pointer at %d\r\n", i));
DEBUG(("found pointer at %d", i));
return i;
}
}
@ -454,7 +454,7 @@ xrdp_cache_add_pointer(struct xrdp_cache* self,
self->pointer_items[index].x,
self->pointer_items[index].y);
self->wm->current_pointer = index;
DEBUG(("adding pointer at %d\r\n", index));
DEBUG(("adding pointer at %d", index));
return index;
}
@ -482,6 +482,6 @@ xrdp_cache_add_pointer_static(struct xrdp_cache* self,
self->pointer_items[index].x,
self->pointer_items[index].y);
self->wm->current_pointer = index;
DEBUG(("adding pointer at %d\r\n", index));
DEBUG(("adding pointer at %d", index));
return index;
}

@ -186,8 +186,7 @@ server_msg(struct xrdp_mod* mod, char* msg, int code)
if (code == 1)
{
g_printf(msg);
g_printf("\r\n");
g_writeln(msg);
return 0;
}
wm = (struct xrdp_wm*)mod->wm;

@ -116,7 +116,7 @@ xrdp_listen_delete_pro(struct xrdp_listen* self, struct xrdp_process* pro)
{
if (self->process_list[i] == pro)
{
DEBUG(("process deleted\r\n"));
DEBUG(("process deleted"));
xrdp_process_delete(pro);
self->process_list[i] = 0;
return 0;
@ -130,9 +130,9 @@ xrdp_listen_delete_pro(struct xrdp_listen* self, struct xrdp_process* pro)
THREAD_RV THREAD_CC
xrdp_process_run(void* in_val)
{
DEBUG(("process started\r\n"));
DEBUG(("process started"));
xrdp_process_main_loop(g_process);
DEBUG(("process done\r\n"));
DEBUG(("process done"));
return 0;
}
@ -189,7 +189,7 @@ xrdp_listen_main_loop(struct xrdp_listen* self)
error = g_tcp_bind(self->sck, port);
if (error != 0)
{
g_printf("bind error in xrdp_listen_main_loop\r\n");
g_writeln("bind error in xrdp_listen_main_loop");
g_tcp_close(self->sck);
self->status = -1;
return 1;
@ -228,7 +228,7 @@ xrdp_listen_main_loop(struct xrdp_listen* self)
}
else
{
DEBUG(("listen error in xrdp_listen_main_loop\r\n"));
DEBUG(("listen error in xrdp_listen_main_loop"));
}
xrdp_listen_term_processes(self);
g_tcp_close(self->sck);

@ -128,7 +128,7 @@ xrdp_wm_setup_mod1(struct xrdp_wm* self,
}
if (func == 0)
{
g_printf("error finding proc mod_init in %s\r\n", mod_data->lib);
g_writeln("error finding proc mod_init in %s", mod_data->lib);
}
self->mod_init = (struct xrdp_mod* (*)(void))func;
func = g_get_proc_address(self->mod_handle, "mod_exit");
@ -138,7 +138,7 @@ xrdp_wm_setup_mod1(struct xrdp_wm* self,
}
if (func == 0)
{
g_printf("error finding proc mod_exit in %s\r\n", mod_data->lib);
g_writeln("error finding proc mod_exit in %s", mod_data->lib);
}
self->mod_exit = (int (*)(struct xrdp_mod*))func;
if (self->mod_init != 0 && self->mod_exit != 0)
@ -148,7 +148,7 @@ xrdp_wm_setup_mod1(struct xrdp_wm* self,
}
else
{
g_printf("error loading %s\r\n", mod_data->lib);
g_writeln("error loading %s", mod_data->lib);
}
if (self->mod != 0)
{
@ -179,7 +179,7 @@ xrdp_wm_setup_mod1(struct xrdp_wm* self,
/* id self->mod is null, there must be a problem */
if (self->mod == 0)
{
DEBUG(("problem loading lib in xrdp_wm_setup_mod1\r\n"));
DEBUG(("problem loading lib in xrdp_wm_setup_mod1"));
return 1;
}
return 0;

@ -90,7 +90,6 @@ xrdp_region_subtract_rect(struct xrdp_region* self,
r = (struct xrdp_rect*)list_get_item(self->rects, i);
rect1 = *r;
r = &rect1;
//g_printf("r is %d %d %d %d\n", r->left, r->top, r->right, r->bottom);
if (rect->left <= r->left &&
rect->top <= r->top &&
rect->right >= r->right &&
@ -275,7 +274,7 @@ xrdp_region_subtract_rect(struct xrdp_region* self,
}
else
{
g_printf("error in xrdp_region_subtract_rect\r\n");
g_writeln("error in xrdp_region_subtract_rect");
}
}
return 0;

@ -342,11 +342,11 @@ xrdp_wm_load_static_pointers(struct xrdp_wm* self)
{
struct xrdp_pointer_item pointer_item;
DEBUG(("sending cursor\r\n"));
DEBUG(("sending cursor"));
xrdp_wm_load_pointer(self, "cursor1.cur", pointer_item.data,
pointer_item.mask, &pointer_item.x, &pointer_item.y);
xrdp_cache_add_pointer_static(self->cache, &pointer_item, 1);
DEBUG(("sending cursor\r\n"));
DEBUG(("sending cursor"));
xrdp_wm_load_pointer(self, "cursor0.cur", pointer_item.data,
pointer_item.mask, &pointer_item.x, &pointer_item.y);
xrdp_cache_add_pointer_static(self->cache, &pointer_item, 0);
@ -1192,7 +1192,7 @@ static int APP_CC
xrdp_wm_process_input_mouse(struct xrdp_wm* self, int device_flags,
int x, int y)
{
DEBUG(("mouse event flags %4.4x x %d y %d\r\n", device_flags, x, y));
DEBUG(("mouse event flags %4.4x x %d y %d", device_flags, x, y));
if (device_flags & MOUSE_FLAG_MOVE) /* 0x0800 */
{
xrdp_wm_mouse_move(self->pro_layer->wm, x, y);

@ -113,11 +113,11 @@ lib_send(struct mod* mod, char* data, int len)
int DEFAULT_CC
lib_mod_start(struct mod* mod, int w, int h, int bpp)
{
DEBUG(("in lib_mod_start\r\n"));
LIB_DEBUG(mod, "in lib_mod_start");
mod->width = w;
mod->height = h;
mod->bpp = bpp;
DEBUG(("out lib_mod_start\r\n"));
LIB_DEBUG(mod, "out lib_mod_start");
return 0;
}
@ -137,7 +137,7 @@ lib_mod_connect(struct mod* mod)
struct stream* s;
char con_port[256];
DEBUG(("in lib_mod_connect\r\n"));
LIB_DEBUG(mod, "in lib_mod_connect");
/* clear screen */
mod->server_begin_update(mod);
mod->server_set_fgcolor(mod, 0);
@ -265,7 +265,7 @@ lib_mod_connect(struct mod* mod)
lib_send(mod, s->data, len);
}
free_stream(s);
DEBUG(("out lib_mod_connect error\r\n"));
LIB_DEBUG(mod, "out lib_mod_connect error");
if (error != 0)
{
mod->server_msg(mod, "some problem", 0);
@ -284,7 +284,7 @@ lib_mod_event(struct mod* mod, int msg, long param1, long param2,
int len;
int rv;
DEBUG(("in lib_mod_event\r\n"));
LIB_DEBUG(mod, "in lib_mod_event");
make_stream(s);
init_stream(s, 8192);
s_push_layer(s, iso_hdr, 4);
@ -300,7 +300,7 @@ lib_mod_event(struct mod* mod, int msg, long param1, long param2,
out_uint32_le(s, len);
rv = lib_send(mod, s->data, len);
free_stream(s);
DEBUG(("out lib_mod_event\r\n"));
LIB_DEBUG(mod, "out lib_mod_event");
return rv;
}
@ -335,7 +335,7 @@ lib_mod_signal(struct mod* mod)
char cur_data[32 * (32 * 3)];
char cur_mask[32 * (32 / 8)];
DEBUG(("in lib_mod_signal\r\n"));
LIB_DEBUG(mod, "in lib_mod_signal");
make_stream(s);
init_stream(s, 8192);
rv = lib_recv(mod, s->data, 8);
@ -442,7 +442,7 @@ lib_mod_signal(struct mod* mod)
}
}
free_stream(s);
DEBUG(("out lib_mod_signal\r\n"));
LIB_DEBUG(mod, "out lib_mod_signal");
return rv;
}
@ -484,7 +484,6 @@ mod_init(void)
{
struct mod* mod;
DEBUG(("in mod_init\r\n"));
mod = (struct mod*)g_malloc(sizeof(struct mod), 1);
mod->size = sizeof(struct mod);
mod->handle = (long)mod;
@ -494,7 +493,6 @@ mod_init(void)
mod->mod_signal = lib_mod_signal;
mod->mod_end = lib_mod_end;
mod->mod_set_param = lib_mod_set_param;
DEBUG(("out mod_init\r\n"));
return mod;
}
@ -502,13 +500,11 @@ mod_init(void)
int EXPORT_CC
mod_exit(struct mod* mod)
{
DEBUG(("in mod_exit\r\n"));
if (mod == 0)
{
return 0;
}
g_tcp_close(mod->sck);
g_free(mod);
DEBUG(("out mod_exit\r\n"));
return 0;
}

Loading…
Cancel
Save