Changeset c7304b2 for skype/skype.c
- Timestamp:
- 2008-01-12T20:07:10Z (16 years ago)
- Branches:
- master
- Children:
- 55664fc
- Parents:
- e65ceaa
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
skype/skype.c
re65ceaa rc7304b2 28 28 #include <poll.h> 29 29 #include <bitlbee.h> 30 #include <bitlbee/ssl_client.h> 30 31 #include <glib.h> 31 32 … … 63 64 * we're connected and when we aren't. */ 64 65 int bfd; 66 /* ssl_getfd() uses this to get the file desciptor. */ 67 void *ssl; 65 68 /* When we receive a new message id, we query the properties, finally 66 69 * the chatname. Store the properties here so that we can use … … 146 149 if(pfd[0].revents & POLLHUP) 147 150 { 148 imcb_error( ic, "Could not connect to server" );149 151 imc_logout( ic, TRUE ); 150 152 return FALSE; 151 153 } 152 write( sd->fd, buf, len );154 ssl_write( sd->ssl, buf, len ); 153 155 154 156 return TRUE; … … 210 212 return FALSE; 211 213 /* Read the whole data. */ 212 st = read( sd->fd, buf, sizeof( buf ) );214 st = ssl_read( sd->ssl, buf, sizeof( buf ) ); 213 215 if( st > 0 ) 214 216 { … … 720 722 } 721 723 } 724 else if(!strncmp(line, "PASSWORD ", 9)) 725 { 726 if(!strncmp(line+9, "OK", 2)) 727 imcb_connected(ic); 728 else 729 { 730 imcb_error(ic, "Authentication Failed"); 731 imc_logout( ic, TRUE ); 732 } 733 } 722 734 lineptr++; 723 735 } … … 766 778 } 767 779 768 gboolean skype_connected( gpointer data, gintsource, b_input_condition cond )780 gboolean skype_connected( gpointer data, void *source, b_input_condition cond ) 769 781 { 770 782 struct im_connection *ic = data; 771 imcb_connected(ic); 783 struct skype_data *sd = ic->proto_data; 784 if(!source) 785 { 786 sd->ssl = NULL; 787 imcb_error( ic, "Could not connect to server" ); 788 imc_logout( ic, TRUE ); 789 return FALSE; 790 } 791 imcb_log( ic, "Connected to server, logging in" ); 772 792 return skype_start_stream(ic); 773 793 } … … 781 801 782 802 imcb_log( ic, "Connecting" ); 783 sd->fd = proxy_connect(set_getstr( &acc->set, "server" ), set_getint( &acc->set, "port" ), skype_connected, ic ); 803 sd->ssl = ssl_connect(set_getstr( &acc->set, "server" ), set_getint( &acc->set, "port" ), skype_connected, ic ); 804 sd->fd = sd->ssl ? ssl_getfd( sd->ssl ) : -1; 784 805 sd->username = g_strdup( acc->user ); 785 806
Note: See TracChangeset
for help on using the changeset viewer.