<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[Freeswitch-trunk][16828] </title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<div id="header">FreeSWITCH Subversion</div>
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://fisheye.freeswitch.org/changelog/FreeSWITCH?cs=16828">16828</a></dd>
<dt>Author</dt> <dd>gmaruzz</dd>
<dt>Date</dt> <dd>2010-02-25 13:18:21 -0600 (Thu, 25 Feb 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>skypiax: cleaning</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#freeswitchtrunksrcmodendpointsmod_skypiaxskypiax_protocolc">freeswitch/trunk/src/mod/endpoints/mod_skypiax/skypiax_protocol.c</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="freeswitchtrunksrcmodendpointsmod_skypiaxskypiax_protocolc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/endpoints/mod_skypiax/skypiax_protocol.c (16827 => 16828)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/endpoints/mod_skypiax/skypiax_protocol.c        2010-02-25 19:02:42 UTC (rev 16827)
+++ freeswitch/trunk/src/mod/endpoints/mod_skypiax/skypiax_protocol.c        2010-02-25 19:18:21 UTC (rev 16828)
</span><span class="lines">@@ -60,8 +60,6 @@
</span><span class="cx">         start_port = (unsigned short) next_port();
</span><span class="cx"> #endif
</span><span class="cx">         my_addr.sin_port = htons(start_port);
</span><del>-        //fcntl(s, F_SETFL, O_NONBLOCK);
-        //tech_pvt->tcp_cli_port = start_port;
</del><span class="cx">         *which_port = start_port;
</span><span class="cx">         while (bind(s, (struct sockaddr *) &my_addr, sizeof(struct sockaddr)) < 0) {
</span><span class="cx">                 DEBUGA_SKYPE("*which_port=%d, tech_pvt->tcp_cli_port=%d, tech_pvt->tcp_srv_port=%d\n", SKYPIAX_P_LOG, *which_port, tech_pvt->tcp_cli_port,
</span><span class="lines">@@ -229,9 +227,6 @@
</span><span class="cx">                                 }
</span><span class="cx">                         }
</span><span class="cx">
</span><del>-
-
-
</del><span class="cx">                         skypiax_strncpy(message_2, message, sizeof(message) - 1);
</span><span class="cx">                         buf = message;
</span><span class="cx">                         stringp = &buf;
</span><span class="lines">@@ -240,13 +235,6 @@
</span><span class="cx">                                 WARNINGA("Skype MSG without spaces: %s\n", SKYPIAX_P_LOG, message);
</span><span class="cx">                         }
</span><span class="cx">
</span><del>-
-
-
-
-
-
-
</del><span class="cx">                         if (!strcasecmp(message, "CURRENTUSERHANDLE")) {
</span><span class="cx">                                 skypiax_strncpy(obj, where, sizeof(obj) - 1);
</span><span class="cx">                                 where = strsep(stringp, " ");
</span><span class="lines">@@ -489,19 +477,11 @@
</span><span class="cx">                                 }
</span><span class="cx">                                 if (!strcasecmp(prop, "PARTNER_DISPNAME")) {
</span><span class="cx">                                         snprintf(tech_pvt->callid_name, sizeof(tech_pvt->callid_name) - 1, "%s%s%s", value, where ? " " : "", where ? where : "");
</span><del>-                                        //DEBUGA_SKYPE
-                                        //("the skype_call %s caller PARTNER_DISPNAME (tech_pvt->callid_name) is: %s\n",
-                                        //SKYPIAX_P_LOG, id, tech_pvt->callid_name);
</del><span class="cx">                                 }
</span><span class="cx">                                 if (!strcasecmp(prop, "CONF_ID") && !strcasecmp(value, "0")) {
</span><del>-                                        //DEBUGA_SKYPE("the skype_call %s is NOT a conference call\n", SKYPIAX_P_LOG, id);
-                                        //if (tech_pvt->interface_state == SKYPIAX_STATE_DOWN)
-                                        //tech_pvt->interface_state = SKYPIAX_STATE_PRERING;
</del><span class="cx">                                 }
</span><span class="cx">                                 if (!strcasecmp(prop, "CONF_ID") && strcasecmp(value, "0")) {
</span><span class="cx">                                         DEBUGA_SKYPE("the skype_call %s is a conference call\n", SKYPIAX_P_LOG, id);
</span><del>-                                        //if (tech_pvt->interface_state == SKYPIAX_STATE_DOWN)
-                                        //tech_pvt->interface_state = SKYPIAX_STATE_PRERING;
</del><span class="cx">                                 }
</span><span class="cx">                                 if (!strcasecmp(prop, "DTMF")) {
</span><span class="cx">                                         DEBUGA_SKYPE("Call %s received a DTMF: %s\n", SKYPIAX_P_LOG, id, value);
</span><span class="lines">@@ -531,7 +511,6 @@
</span><span class="cx">                                         sprintf(msg_to_skype, "ALTER CALL %s HANGUP", id);
</span><span class="cx">                                         skypiax_signaling_write(tech_pvt, msg_to_skype);
</span><span class="cx">                                         skypiax_sleep(10000);
</span><del>-                                        //return CALLFLOW_INCOMING_HANGUP;
</del><span class="cx">                                 }
</span><span class="cx">
</span><span class="cx">                                 if (!strcasecmp(prop, "STATUS")) {
</span><span class="lines">@@ -586,13 +565,9 @@
</span><span class="cx">                                         } else if (!strcasecmp(value, "MISSED")) {
</span><span class="cx">                                                 DEBUGA_SKYPE("We missed skype_call %s\n", SKYPIAX_P_LOG, id);
</span><span class="cx">                                         } else if (!strcasecmp(value, "FINISHED")) {
</span><del>-                                                //DEBUGA_SKYPE("skype_call %s now is DOWN\n", SKYPIAX_P_LOG, id);
</del><span class="cx">                                                 if (!strcasecmp(tech_pvt->skype_call_id, id)) {
</span><del>-                                                        //tech_pvt->skype_callflow = CALLFLOW_STATUS_FINISHED;
</del><span class="cx">                                                         DEBUGA_SKYPE("skype_call %s is MY call, now I'm going DOWN\n", SKYPIAX_P_LOG, id);
</span><del>-                                                        //tech_pvt->skype_call_id[0] = '\0';
</del><span class="cx">                                                         if (tech_pvt->interface_state != SKYPIAX_STATE_HANGUP_REQUESTED) {
</span><del>-                                                                //tech_pvt->interface_state = SKYPIAX_STATE_DOWN;
</del><span class="cx">                                                                 return CALLFLOW_INCOMING_HANGUP;
</span><span class="cx">                                                         } else {
</span><span class="cx">                                                                 tech_pvt->interface_state = SKYPIAX_STATE_DOWN;
</span><span class="lines">@@ -668,10 +643,10 @@
</span><span class="cx">                                                                                         return CALLFLOW_INCOMING_HANGUP;
</span><span class="cx">                                                                                 }
</span><span class="cx">                                                                         }
</span><del>-                                                                        skypiax_sleep(1000);        //FIXME
</del><ins>+                                                                        skypiax_sleep(1000);
</ins><span class="cx">                                                                         sprintf(msg_to_skype, "ALTER CALL %s SET_INPUT PORT=\"%d\"", id, tech_pvt->tcp_cli_port);
</span><span class="cx">                                                                         skypiax_signaling_write(tech_pvt, msg_to_skype);
</span><del>-                                                                        skypiax_sleep(1000);        //FIXME
</del><ins>+                                                                        skypiax_sleep(1000);
</ins><span class="cx">                                                                         sprintf(msg_to_skype, "#output ALTER CALL %s SET_OUTPUT PORT=\"%d\"", id, tech_pvt->tcp_srv_port);
</span><span class="cx">                                                                         skypiax_signaling_write(tech_pvt, msg_to_skype);
</span><span class="cx">                                                                 }
</span><span class="lines">@@ -723,20 +698,14 @@
</span><span class="cx">                         }                                        //CALL
</span><span class="cx">                         /* the "numbered" messages that follows are used by the directory application, not yet ported */
</span><span class="cx">                         if (!strcasecmp(message, "#333")) {
</span><del>-                                /* DEBUGA_SKYPE("Skype MSG: message_2: %s, message2[11]: %s\n", SKYPIAX_P_LOG,
-                                 * message_2, &message_2[11]); */
</del><span class="cx">                                 memset(tech_pvt->skype_friends, 0, 4096);
</span><span class="cx">                                 skypiax_strncpy(tech_pvt->skype_friends, &message_2[11], 4095);
</span><span class="cx">                         }
</span><span class="cx">                         if (!strcasecmp(message, "#222")) {
</span><del>-                                /* DEBUGA_SKYPE("Skype MSG: message_2: %s, message2[10]: %s\n", SKYPIAX_P_LOG,
-                                 * message_2, &message_2[10]); */
</del><span class="cx">                                 memset(tech_pvt->skype_fullname, 0, 512);
</span><span class="cx">                                 skypiax_strncpy(tech_pvt->skype_fullname, &message_2[10], 511);
</span><span class="cx">                         }
</span><span class="cx">                         if (!strcasecmp(message, "#765")) {
</span><del>-                                /* DEBUGA_SKYPE("Skype MSG: message_2: %s, message2[10]: %s\n", SKYPIAX_P_LOG,
-                                 * message_2, &message_2[10]); */
</del><span class="cx">                                 memset(tech_pvt->skype_displayname, 0, 512);
</span><span class="cx">                                 skypiax_strncpy(tech_pvt->skype_displayname, &message_2[10], 511);
</span><span class="cx">                         }
</span><span class="lines">@@ -751,8 +720,6 @@
</span><span class="cx">         private_t *tech_pvt = obj;
</span><span class="cx">         int s;
</span><span class="cx">         unsigned int len;
</span><del>-        //unsigned int i;
-        //unsigned int a;
</del><span class="cx"> #if defined(WIN32) && !defined(__CYGWIN__)
</span><span class="cx">         int sin_size;
</span><span class="cx">         int size = sizeof(int);
</span><span class="lines">@@ -762,13 +729,7 @@
</span><span class="cx"> #endif /* WIN32 */
</span><span class="cx">         unsigned int fd;
</span><span class="cx">         short srv_in[SAMPLES_PER_FRAME * 10];
</span><del>-        //short srv_out[SAMPLES_PER_FRAME / 2];
-        //struct sockaddr_in my_addr;
</del><span class="cx">         struct sockaddr_in remote_addr;
</span><del>-        //int exit = 0;
-        //unsigned int kill_cli_size;
-        //short kill_cli_buff[SAMPLES_PER_FRAME];
-        //short totalbuf[SAMPLES_PER_FRAME];
</del><span class="cx">         int sockbufsize = 0;
</span><span class="cx">
</span><span class="cx">         s = skypiax_socket_create_and_bind(tech_pvt, &tech_pvt->tcp_srv_port);
</span><span class="lines">@@ -782,7 +743,6 @@
</span><span class="cx">
</span><span class="cx">         sin_size = sizeof(remote_addr);
</span><span class="cx">
</span><del>-        /****************************/
</del><span class="cx">         while (tech_pvt && tech_pvt->interface_state != SKYPIAX_STATE_DOWN
</span><span class="cx">                  && (tech_pvt->skype_callflow == CALLFLOW_STATUS_INPROGRESS
</span><span class="cx">                          || tech_pvt->skype_callflow == CALLFLOW_STATUS_EARLYMEDIA
</span><span class="lines">@@ -805,8 +765,6 @@
</span><span class="cx">
</span><span class="cx">                 if (rtgio) {
</span><span class="cx">
</span><del>-                        /****************************/
-
</del><span class="cx">                         while (s > 0 && (fd = accept(s, (struct sockaddr *) &remote_addr, &sin_size)) > 0) {
</span><span class="cx">                                 DEBUGA_SKYPE("ACCEPTED here I send you %d\n", SKYPIAX_P_LOG, tech_pvt->tcp_srv_port);
</span><span class="cx">
</span><span class="lines">@@ -907,15 +865,10 @@
</span><span class="cx"> {
</span><span class="cx">         private_t *tech_pvt = obj;
</span><span class="cx">         int s;
</span><del>-        //struct sockaddr_in my_addr;
</del><span class="cx">         struct sockaddr_in remote_addr;
</span><del>-        //unsigned int got;
</del><span class="cx">         unsigned int len;
</span><del>-        //unsigned int i;
-        //unsigned int a;
</del><span class="cx">         unsigned int fd;
</span><span class="cx">         short cli_out[SAMPLES_PER_FRAME * 2 * 10];
</span><del>-        //short cli_in[SAMPLES_PER_FRAME];
</del><span class="cx"> #ifdef WIN32
</span><span class="cx">         int sin_size;
</span><span class="cx">         int size = sizeof(int);
</span><span class="lines">@@ -939,7 +892,6 @@
</span><span class="cx">
</span><span class="cx">         sin_size = sizeof(remote_addr);
</span><span class="cx">
</span><del>-        /****************************/
</del><span class="cx">         while (tech_pvt && tech_pvt->interface_state != SKYPIAX_STATE_DOWN
</span><span class="cx">                  && (tech_pvt->skype_callflow == CALLFLOW_STATUS_INPROGRESS
</span><span class="cx">                          || tech_pvt->skype_callflow == CALLFLOW_STATUS_EARLYMEDIA
</span><span class="lines">@@ -962,8 +914,6 @@
</span><span class="cx">
</span><span class="cx">                 if (rtgio) {
</span><span class="cx">
</span><del>-                        /****************************/
-
</del><span class="cx">                         while (s > 0 && (fd = accept(s, (struct sockaddr *) &remote_addr, &sin_size)) > 0) {
</span><span class="cx">                                 DEBUGA_SKYPE("ACCEPTED here you send me %d\n", SKYPIAX_P_LOG, tech_pvt->tcp_cli_port);
</span><span class="cx">
</span><span class="lines">@@ -1074,48 +1024,6 @@
</span><span class="cx">         return NULL;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-int skypiax_audio_read(private_t * tech_pvt)
-{
-        unsigned int samples;
-        int waitin;
-        int max_waitin = 30;
-
-        waitin = 0;
-        while (tech_pvt->flag_audio_srv == 0) {
-#ifdef WIN32
-                skypiax_sleep(1000);        //0.1 millisec
-#else
-                skypiax_sleep(1000);        //1 millisec
-#endif //WIN32
-                waitin++;
-
-                if (waitin == max_waitin) {
-                        DEBUGA_SKYPE("read is now at max_waitin: %d\n", SKYPIAX_P_LOG, waitin);
-                        break;
-                }
-                //WARNINGA("read now is 0\n", SKYPIAX_P_LOG);
-        }
-        if (waitin > 22) {
-                DEBUGA_SKYPE("read is now %d\n", SKYPIAX_P_LOG, waitin);
-        }
-        //samples = skypiax_pipe_read(tech_pvt->audiopipe_srv[0], tech_pvt->read_frame.data, SAMPLES_PER_FRAME * sizeof(short));
-        switch_mutex_lock(tech_pvt->mutex_audio_srv);
-        memcpy(tech_pvt->read_frame.data, tech_pvt->audiobuf_srv, SAMPLES_PER_FRAME * sizeof(short));
-        tech_pvt->flag_audio_srv = 0;
-        switch_mutex_unlock(tech_pvt->mutex_audio_srv);
-
-        samples = SAMPLES_PER_FRAME * sizeof(short);
-        if (samples != SAMPLES_PER_FRAME * sizeof(short)) {
-                if (samples)
-                        WARNINGA("read samples=%u expected=%u\n", SKYPIAX_P_LOG, samples, (int) (SAMPLES_PER_FRAME * sizeof(short)));
-                return 0;
-        } else {
-                /* A real frame */
-                tech_pvt->read_frame.datalen = samples;
-        }
-        return 1;
-}
-
</del><span class="cx"> int skypiax_senddigit(private_t * tech_pvt, char digit)
</span><span class="cx"> {
</span><span class="cx">         char msg_to_skype[1024];
</span><span class="lines">@@ -1131,12 +1039,7 @@
</span><span class="cx"> {
</span><span class="cx">         char msg_to_skype[1024];
</span><span class="cx">
</span><del>-        //skypiax_sleep(5000);
</del><span class="cx">         DEBUGA_SKYPE("Calling Skype, rdest is: %s\n", SKYPIAX_P_LOG, rdest);
</span><del>-        //skypiax_signaling_write(tech_pvt, "SET AGC OFF");
-        //skypiax_sleep(10000);
-        //skypiax_signaling_write(tech_pvt, "SET AEC OFF");
-        //skypiax_sleep(10000);
</del><span class="cx">
</span><span class="cx">         sprintf(msg_to_skype, "CALL %s", rdest);
</span><span class="cx">         if (skypiax_signaling_write(tech_pvt, msg_to_skype) < 0) {
</span><span class="lines">@@ -1289,7 +1192,6 @@
</span><span class="cx">         DEBUGA_SKYPE("SENDING: |||%s||||\n", SKYPIAX_P_LOG, msg_to_skype);
</span><span class="cx">
</span><span class="cx">         sprintf(acInputRow, "%s", msg_to_skype);
</span><del>-        //DEBUGA_SKYPE("acInputRow: |||%s||||\n", SKYPIAX_P_LOG, acInputRow);
</del><span class="cx">         /* send command to skype */
</span><span class="cx">         oCopyData.dwData = 0;
</span><span class="cx">         oCopyData.lpData = acInputRow;
</span><span class="lines">@@ -1316,8 +1218,6 @@
</span><span class="cx">         lReturnCode = 0;
</span><span class="cx">         fIssueDefProc = 0;
</span><span class="cx">         tech_pvt = (private_t *) GetWindowLong(hWindow, GWL_USERDATA);
</span><del>-        //if (!running)
-        // return lReturnCode;
</del><span class="cx">
</span><span class="cx">         if (!running) {
</span><span class="cx">                 DEBUGA_SKYPE("let's DIE!\n", SKYPIAX_P_LOG);
</span><span class="lines">@@ -1348,7 +1248,6 @@
</span><span class="cx">
</span><span class="cx">                         howmany = strlen(msg_from_skype) + 1;
</span><span class="cx">                         howmany = skypiax_pipe_write(tech_pvt->SkypiaxHandles.fdesc[1], (short *) msg_from_skype, howmany);
</span><del>-                        //DEBUGA_SKYPE("From Skype API: %s\n", SKYPIAX_P_LOG, msg_from_skype);
</del><span class="cx">                         lReturnCode = 1;
</span><span class="cx">                 }
</span><span class="cx">                 break;
</span><span class="lines">@@ -1365,15 +1264,7 @@
</span><span class="cx">                                         }
</span><span class="cx">                                         break;
</span><span class="cx">                                 case SKYPECONTROLAPI_ATTACH_PENDING_AUTHORIZATION:
</span><del>-                                        //DEBUGA_SKYPE ("\n\n\tIf I do not (almost) immediately connect to Skype API,\n\tplease give the Skype client authorization to be connected \n\tby Asterisk and to not ask you again.\n\n", SKYPIAX_P_LOG);
</del><span class="cx">                                         skypiax_sleep(5000);
</span><del>-#if 0
-                                        if (!tech_pvt->SkypiaxHandles.currentuserhandle) {
-                                                SendMessage(HWND_BROADCAST,
-                                                                        tech_pvt->SkypiaxHandles.
-                                                                        win32_uiGlobal_MsgID_SkypeControlAPIDiscover, (WPARAM) tech_pvt->SkypiaxHandles.win32_hInit_MainWindowHandle, 0);
-                                        }
-#endif
</del><span class="cx">                                         break;
</span><span class="cx">                                 case SKYPECONTROLAPI_ATTACH_REFUSED:
</span><span class="cx">                                         ERRORA("Skype client refused to be connected by Skypiax!\n", SKYPIAX_P_LOG);
</span><span class="lines">@@ -1384,13 +1275,6 @@
</span><span class="cx">                                 case SKYPECONTROLAPI_ATTACH_API_AVAILABLE:
</span><span class="cx">                                         DEBUGA_SKYPE("Skype API available\n", SKYPIAX_P_LOG);
</span><span class="cx">                                         skypiax_sleep(5000);
</span><del>-#if 0
-                                        if (!tech_pvt->SkypiaxHandles.currentuserhandle) {
-                                                SendMessage(HWND_BROADCAST,
-                                                                        tech_pvt->SkypiaxHandles.
-                                                                        win32_uiGlobal_MsgID_SkypeControlAPIDiscover, (WPARAM) tech_pvt->SkypiaxHandles.win32_hInit_MainWindowHandle, 0);
-                                        }
-#endif
</del><span class="cx">                                         break;
</span><span class="cx">                                 default:
</span><span class="cx">                                         WARNINGA("GOT AN UNKNOWN SKYPE WINDOWS MSG\n", SKYPIAX_P_LOG);
</span><span class="lines">@@ -1525,8 +1409,7 @@
</span><span class="cx">         (void) dpy;
</span><span class="cx">
</span><span class="cx">         xerror = err->error_code;
</span><del>-        ERRORA("Received error code %d from X Server\n\n", SKYPIAX_P_LOG, xerror);        ///FIXME why crash the entire skypiax? just crash the interface, instead
-        //running = 0;
</del><ins>+        ERRORA("Received error code %d from X Server\n\n", SKYPIAX_P_LOG, xerror);
</ins><span class="cx">         return 0;                                        /* ignore the error */
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1549,7 +1432,6 @@
</span><span class="cx">         Display *disp = SkypiaxHandles->disp;
</span><span class="cx">         Window handle_P = SkypiaxHandles->win;
</span><span class="cx">         int ok;
</span><del>-        //private_t *tech_pvt = NULL;
</del><span class="cx">
</span><span class="cx">
</span><span class="cx">         Atom atom1 = XInternAtom(disp, "SKYPECONTROLAPI_MESSAGE_BEGIN", False);
</span><span class="lines">@@ -1566,7 +1448,6 @@
</span><span class="cx">         e.xclient.format = 8;
</span><span class="cx">
</span><span class="cx">         X11_errors_trap();
</span><del>-        //XLockDisplay(disp);
</del><span class="cx">         do {
</span><span class="cx">                 unsigned int i;
</span><span class="cx">                 for (i = 0; i < 20 && i + pos <= len; ++i)
</span><span class="lines">@@ -1585,7 +1466,6 @@
</span><span class="cx">                 tech_pvt->running = 0;
</span><span class="cx">                 return 0;
</span><span class="cx">         }
</span><del>-        //XUnlockDisplay(disp);
</del><span class="cx">
</span><span class="cx">         return 1;
</span><span class="cx"> }
</span><span class="lines">@@ -1620,11 +1500,9 @@
</span><span class="cx">         private_t *tech_pvt = NULL;
</span><span class="cx">
</span><span class="cx">         X11_errors_trap();
</span><del>-        //XLockDisplay(disp);
</del><span class="cx">         status =
</span><span class="cx">                 XGetWindowProperty(SkypiaxHandles->disp, DefaultRootWindow(SkypiaxHandles->disp),
</span><span class="cx">                                                  skype_inst, 0, 1, False, XA_WINDOW, &type_ret, &format_ret, &nitems_ret, &bytes_after_ret, &prop);
</span><del>-        //XUnlockDisplay(disp);
</del><span class="cx">         X11_errors_untrap();
</span><span class="cx">
</span><span class="cx">         /* sanity check */
</span><span class="lines">@@ -1713,8 +1591,6 @@
</span><span class="cx">                 if (!skypiax_send_message(tech_pvt, buf)) {
</span><span class="cx">                         ERRORA("Sending message failed - probably Skype crashed. Please run/restart Skype manually and launch Skypiax again\n", SKYPIAX_P_LOG);
</span><span class="cx">                         running = 0;
</span><del>-                        //if(disp)
-                        //XCloseDisplay(disp);
</del><span class="cx">                         return NULL;
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="lines">@@ -1722,8 +1598,6 @@
</span><span class="cx">                 if (!skypiax_send_message(tech_pvt, buf)) {
</span><span class="cx">                         ERRORA("Sending message failed - probably Skype crashed. Please run/restart Skype manually and launch Skypiax again\n", SKYPIAX_P_LOG);
</span><span class="cx">                         running = 0;
</span><del>-                        //if(disp)
-                        //XCloseDisplay(disp);
</del><span class="cx">                         return NULL;
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="lines">@@ -1761,11 +1635,7 @@
</span><span class="cx">
</span><span class="cx">                                         buf[i] = '\0';
</span><span class="cx">
</span><del>-                                        //DEBUGA_SKYPE ("BUF=|||%s|||\n", SKYPIAX_P_LOG, buf);
-
</del><span class="cx">                                         if (an_event.xclient.message_type == atom_begin) {
</span><del>-                                                //DEBUGA_SKYPE ("BEGIN BUF=|||%s|||\n", SKYPIAX_P_LOG, buf);
-
</del><span class="cx">                                                 if (strlen(buffer)) {
</span><span class="cx">                                                         unsigned int howmany;
</span><span class="cx">                                                         howmany = strlen(b) + 1;
</span><span class="lines">@@ -1781,8 +1651,6 @@
</span><span class="cx">                                                 }
</span><span class="cx">                                         }
</span><span class="cx">                                         if (an_event.xclient.message_type == atom_continue) {
</span><del>-                                                //DEBUGA_SKYPE ("CONTINUE BUF=|||%s|||\n", SKYPIAX_P_LOG, buf);
-
</del><span class="cx">                                                 if (!strlen(buffer)) {
</span><span class="cx">                                                         DEBUGA_SKYPE
</span><span class="cx">                                                                 ("Got a 'continue' XAtom without a previous 'begin'. It's value (between vertical bars) is=|||%s|||, let's store it and hope next 'begin' will be the good one\n",
</span><span class="lines">@@ -1804,20 +1672,15 @@
</span><span class="cx">                                                 skypiax_sleep(1000);        //0.1 msec
</span><span class="cx">                                                 continue;
</span><span class="cx">                                         }
</span><del>-                                        //DEBUGA_SKYPE ("i=%d, buffer=|||%s|||\n", SKYPIAX_P_LOG, i, buffer);
</del><span class="cx">                                         strcat(buffer, buf);
</span><del>-                                        //DEBUGA_SKYPE ("i=%d, buffer=|||%s|||\n", SKYPIAX_P_LOG, i, buffer);
</del><span class="cx">                                         strcat(buffer, continuebuffer);
</span><del>-                                        //DEBUGA_SKYPE ("i=%d, buffer=|||%s|||\n", SKYPIAX_P_LOG, i, buffer);
</del><span class="cx">                                         memset(continuebuffer, '\0', 17000);
</span><span class="cx">
</span><span class="cx">                                         if (i < 20 || there_were_continues) {        /* last fragment */
</span><span class="cx">                                                 unsigned int howmany;
</span><span class="cx">
</span><span class="cx">                                                 howmany = strlen(b) + 1;
</span><del>-
</del><span class="cx">                                                 howmany = write(SkypiaxHandles->fdesc[1], b, howmany);
</span><del>-                                                //DEBUGA_SKYPE ("RECEIVED=|||%s|||\n", SKYPIAX_P_LOG, buffer);
</del><span class="cx">                                                 memset(buffer, '\0', 17000);
</span><span class="cx">                                                 XFlush(disp);
</span><span class="cx">                                                 there_were_continues = 0;
</span><span class="lines">@@ -1834,13 +1697,8 @@
</span><span class="cx">         } else {
</span><span class="cx">                 ERRORA("Skype is not running, maybe crashed. Please run/restart Skype and relaunch Skypiax\n", SKYPIAX_P_LOG);
</span><span class="cx">                 running = 0;
</span><del>-                //if(disp)
-                //XCloseDisplay(disp);
</del><span class="cx">                 return NULL;
</span><span class="cx">         }
</span><del>-        //running = 0;
-        //if(disp)
-        //XCloseDisplay(disp);
</del><span class="cx">         return NULL;
</span><span class="cx">
</span><span class="cx"> }
</span></span></pre>
</div>
</div>
<div id="footer">See you at ClueCon</div>
</body>
</html>