- Timestamp:
- 2006-03-01T22:48:37Z (19 years ago)
- Branches:
- master
- Children:
- 46ad029
- Parents:
- 8e419cb (diff), 9a1555d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- protocols
- Files:
-
- 1 deleted
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/jabber.c
r8e419cb ra4dc9f7 413 413 if (jd->die) 414 414 signoff(GJ_GC(gjc)); 415 } else if (len < 0 || errno != EAGAIN) {415 } else if (len == 0 || (len < 0 && (!sockerr_again() || gjc->ssl))) { 416 416 STATE_EVT(JCONN_STATE_OFF) 417 417 } -
protocols/msn/msn.c
r8e419cb ra4dc9f7 84 84 { 85 85 m = l->data; 86 87 serv_got_crap( gc, "Warning: Closing down MSN connection with unsent message to %s, you'll have to resend it.", m->who ); 86 88 g_free( m->who ); 87 89 g_free( m->text ); … … 89 91 } 90 92 g_slist_free( md->msgq ); 91 92 serv_got_crap( gc, "Warning: Closing down MSN connection with unsent message(s), you'll have to resend them." );93 93 } 94 94 -
protocols/msn/sb.c
r8e419cb ra4dc9f7 213 213 { 214 214 m = l->data; 215 215 216 g_free( m->who ); 216 217 g_free( m->text ); … … 219 220 g_slist_free( sb->msgq ); 220 221 221 serv_got_crap( gc, "Warning: Closing down MSN switchboard connection with unsent message(s), you'll have to resend them." ); 222 serv_got_crap( gc, "Warning: Closing down MSN switchboard connection with " 223 "unsent message to %s, you'll have to resend it.", 224 m->who ? m->who : "(unknown)" ); 222 225 } 223 226 -
protocols/oscar/oscar.c
r8e419cb ra4dc9f7 608 608 return; 609 609 } 610 /* [WvG] Wheeeee! Who needs error checking anyway? ;-) */ 610 611 read(pos->fd, m, 16); 611 612 m[16] = '\0'; -
protocols/oscar/rxqueue.c
r8e419cb ra4dc9f7 353 353 return -1; /* its a aim_conn_close()'d connection */ 354 354 355 if (conn->fd < 3) /* can happen when people abuse the interface */ 355 /* KIDS, THIS IS WHAT HAPPENS IF YOU USE CODE WRITTEN FOR GUIS IN A DAEMON! 356 357 And wouldn't it make sense to return something that prevents this function 358 from being called again IMMEDIATELY (and making the program suck up all 359 CPU time)?... 360 361 if (conn->fd < 3) 356 362 return 0; 363 */ 357 364 358 365 if (conn->status & AIM_CONN_STATUS_INPROGRESS) -
protocols/oscar/service.c
r8e419cb ra4dc9f7 736 736 737 737 tlvlen = aim_addtlvtochain32(&tl, 0x0006, data); 738 739 printf("%d\n", tlvlen);740 738 741 739 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10 + 8))) -
protocols/ssl_openssl.c
r8e419cb ra4dc9f7 5 5 \********************************************************************/ 6 6 7 /* SSL module - GnuTLS version */7 /* SSL module - OpenTLS version */ 8 8 9 9 /* … … 41 41 struct scd 42 42 { 43 ssl_input_function func;43 SslInputFunction func; 44 44 gpointer data; 45 45 int fd; 46 46 gboolean established; 47 47 48 int inpa;49 int lasterr; /* Necessary for SSL_get_error */50 48 SSL *ssl; 51 49 SSL_CTX *ssl_ctx; … … 56 54 57 55 58 void *ssl_connect( char *host, int port, ssl_input_function func, gpointer data )56 void *ssl_connect( char *host, int port, SslInputFunction func, gpointer data ) 59 57 { 60 58 struct scd *conn = g_new0( struct scd, 1 ); … … 95 93 } 96 94 97 static void ssl_handshake( gpointer data, gint source, GaimInputCondition cond );98 99 95 static void ssl_connected( gpointer data, gint source, GaimInputCondition cond ) 100 96 { … … 102 98 103 99 if( source == -1 ) 104 return ssl_handshake( data, -1, cond );100 goto ssl_connected_failure; 105 101 106 /* Make it non-blocking at least during the handshake... */107 sock_make_nonblocking( conn->fd );108 102 SSL_set_fd( conn->ssl, conn->fd ); 109 103 110 return ssl_handshake( data, source, cond ); 111 } 112 113 static void ssl_handshake( gpointer data, gint source, GaimInputCondition cond ) 114 { 115 struct scd *conn = data; 116 int st; 117 118 if( conn->inpa != -1 ) 119 { 120 gaim_input_remove( conn->inpa ); 121 conn->inpa = -1; 122 } 123 124 if( ( st = SSL_connect( conn->ssl ) ) < 0 ) 125 { 126 conn->lasterr = SSL_get_error( conn->ssl, st ); 127 if( conn->lasterr != SSL_ERROR_WANT_READ && conn->lasterr != SSL_ERROR_WANT_WRITE ) 128 goto ssl_connected_failure; 129 130 conn->inpa = gaim_input_add( conn->fd, ssl_getdirection( conn ), ssl_handshake, data ); 131 return; 132 } 104 if( SSL_connect( conn->ssl ) < 0 ) 105 goto ssl_connected_failure; 133 106 134 107 conn->established = TRUE; 135 sock_make_blocking( conn->fd ); /* For now... */136 108 conn->func( conn->data, conn, cond ); 137 109 return; … … 155 127 int ssl_read( void *conn, char *buf, int len ) 156 128 { 157 int st; 129 if( !((struct scd*)conn)->established ) 130 return( 0 ); 158 131 159 if( !((struct scd*)conn)->established ) 160 { 161 ssl_errno = SSL_NOHANDSHAKE; 162 return -1; 163 } 164 165 st = SSL_read( ((struct scd*)conn)->ssl, buf, len ); 166 167 ssl_errno = SSL_OK; 168 if( st <= 0 ) 169 { 170 ((struct scd*)conn)->lasterr = SSL_get_error( ((struct scd*)conn)->ssl, st ); 171 if( ((struct scd*)conn)->lasterr == SSL_ERROR_WANT_READ || ((struct scd*)conn)->lasterr == SSL_ERROR_WANT_WRITE ) 172 ssl_errno = SSL_AGAIN; 173 } 174 175 return st; 132 return( SSL_read( ((struct scd*)conn)->ssl, buf, len ) ); 176 133 } 177 134 178 135 int ssl_write( void *conn, const char *buf, int len ) 179 136 { 180 int st; 137 if( !((struct scd*)conn)->established ) 138 return( 0 ); 181 139 182 if( !((struct scd*)conn)->established ) 183 { 184 ssl_errno = SSL_NOHANDSHAKE; 185 return -1; 186 } 187 188 st = SSL_write( ((struct scd*)conn)->ssl, buf, len ); 189 190 ssl_errno = SSL_OK; 191 if( st <= 0 ) 192 { 193 ((struct scd*)conn)->lasterr = SSL_get_error( ((struct scd*)conn)->ssl, st ); 194 if( ((struct scd*)conn)->lasterr == SSL_ERROR_WANT_READ || ((struct scd*)conn)->lasterr == SSL_ERROR_WANT_WRITE ) 195 ssl_errno = SSL_AGAIN; 196 } 197 198 return st; 140 return( SSL_write( ((struct scd*)conn)->ssl, buf, len ) ); 199 141 } 200 142 … … 202 144 { 203 145 struct scd *conn = conn_; 204 205 if( conn->inpa != -1 )206 gaim_input_remove( conn->inpa );207 146 208 147 if( conn->established ) … … 220 159 return( ((struct scd*)conn)->fd ); 221 160 } 222 223 GaimInputCondition ssl_getdirection( void *conn )224 {225 return( ((struct scd*)conn)->lasterr == SSL_ERROR_WANT_WRITE ? GAIM_INPUT_WRITE : GAIM_INPUT_READ );226 } -
protocols/yahoo/Makefile
r8e419cb ra4dc9f7 10 10 11 11 # [SH] Program variables 12 objects = yahoo.o crypt.o libyahoo2.o yahoo_fn.o yahoo_httplib.o yahoo_ list.o yahoo_util.o12 objects = yahoo.o crypt.o libyahoo2.o yahoo_fn.o yahoo_httplib.o yahoo_util.o 13 13 14 14 CFLAGS += -Wall -DSTDC_HEADERS -DHAVE_STRING_H -DHAVE_STRCHR -DHAVE_MEMCPY -DHAVE_GLIB -
protocols/yahoo/yahoo.c
r8e419cb ra4dc9f7 189 189 { 190 190 struct byahoo_data *yd = (struct byahoo_data *) gc->proto_data; 191 191 192 192 gc->away = NULL; 193 194 if (msg)193 194 if( msg ) 195 195 { 196 196 yd->current_status = YAHOO_STATUS_CUSTOM; 197 197 gc->away = ""; 198 198 } 199 else if (state)199 if( state ) 200 200 { 201 201 gc->away = ""; 202 if( g_strcasecmp( state, "Available" ) == 0 )202 if( g_strcasecmp( state, "Available" ) == 0 ) 203 203 { 204 204 yd->current_status = YAHOO_STATUS_AVAILABLE; … … 235 235 } 236 236 } 237 else if 237 else if( gc->is_idle ) 238 238 yd->current_status = YAHOO_STATUS_IDLE; 239 239 else 240 240 yd->current_status = YAHOO_STATUS_AVAILABLE; 241 241 242 yahoo_set_away( yd->y2_id, yd->current_status, msg, gc->away != NULL ); 242 if( yd->current_status == YAHOO_STATUS_INVISIBLE ) 243 yahoo_set_away( yd->y2_id, yd->current_status, NULL, gc->away != NULL ); 244 else 245 yahoo_set_away( yd->y2_id, yd->current_status, msg, gc->away != NULL ); 243 246 } 244 247 -
protocols/yahoo/yahoo_list.h
r8e419cb ra4dc9f7 21 21 */ 22 22 23 /*24 * This is a replacement for the GList. It only provides functions that25 * we use in Ayttm. Thanks to Meredyyd from everybuddy dev for doing26 * most of it.27 */28 29 23 #ifndef __YLIST_H__ 30 24 #define __YLIST_H__ 31 25 32 #ifdef __cplusplus 33 extern "C" { 26 /* GLib has linked list already, so I don't see why libyahoo2 has to copy this... */ 27 28 typedef GList YList; 29 30 #define y_list_append g_list_append 31 #define y_list_concat g_list_concat 32 #define y_list_copy g_list_copy 33 #define y_list_empty g_list_empty 34 #define y_list_find g_list_find 35 #define y_list_find_custom g_list_find_custom 36 #define y_list_foreach g_list_foreach 37 #define y_list_free g_list_free 38 #define y_list_free_1 g_list_free_1 39 #define y_list_insert_sorted g_list_insert_sorted 40 #define y_list_length g_list_length 41 #define y_list_next g_list_next 42 #define y_list_nth g_list_nth 43 #define y_list_prepend g_list_prepend 44 #define y_list_remove g_list_remove 45 #define y_list_remove_link g_list_remove_link 46 #define y_list_singleton g_list_singleton 47 34 48 #endif 35 36 typedef struct _YList {37 struct _YList *next;38 struct _YList *prev;39 void *data;40 } YList;41 42 typedef int (*YListCompFunc) (const void *, const void *);43 typedef void (*YListFunc) (void *, void *);44 45 YList *y_list_append(YList * list, void *data);46 YList *y_list_prepend(YList * list, void *data);47 YList *y_list_remove_link(YList * list, const YList * link);48 YList *y_list_remove(YList * list, void *data);49 50 YList *y_list_insert_sorted(YList * list, void * data, YListCompFunc comp);51 52 YList *y_list_copy(YList * list);53 54 YList *y_list_concat(YList * list, YList * add);55 56 YList *y_list_find(YList * list, const void *data);57 YList *y_list_find_custom(YList * list, const void *data, YListCompFunc comp);58 59 YList *y_list_nth(YList * list, int n);60 61 void y_list_foreach(YList * list, YListFunc fn, void *user_data);62 63 void y_list_free_1(YList * list);64 void y_list_free(YList * list);65 int y_list_length(const YList * list);66 int y_list_empty(const YList * list);67 int y_list_singleton(const YList * list);68 69 #define y_list_next(list) list->next70 71 #ifdef __cplusplus72 }73 #endif74 #endif
Note: See TracChangeset
for help on using the changeset viewer.