Changeset 643dfc4
- Timestamp:
- 2005-12-17T01:25:58Z (19 years ago)
- Branches:
- master
- Children:
- e3fb678
- Parents:
- 4146a07 (diff), 32c632f (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. - Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
conf.c
r4146a07 r643dfc4 55 55 conf->password = NULL; 56 56 conf->configdir = g_strdup( CONFIG ); 57 conf->plugindir = g_strdup( PLUGINDIR ); 57 58 conf->motdfile = g_strdup( ETCDIR "/motd.txt" ); 58 59 conf->ping_interval = 180; -
conf.h
r4146a07 r643dfc4 41 41 char *hostname; 42 42 char *configdir; 43 char *plugindir; 43 44 char *motdfile; 44 45 char *primary_storage; -
configure
r4146a07 r643dfc4 145 145 fi 146 146 147 if type pkg-config > /dev/null 2>/dev/null && pkg-config glib-2.0; then 147 if [ -z "$PKG_CONFIG" ]; then 148 PKG_CONFIG=pkg-config 149 fi 150 151 if $PKG_CONFIG --version > /dev/null 2>/dev/null && $PKG_CONFIG glib-2.0; then 148 152 cat<<EOF>>Makefile.settings 149 EFLAGS+=` pkg-config--libs glib-2.0 gmodule-2.0`150 CFLAGS+=` pkg-config--cflags glib-2.0 gmodule-2.0`153 EFLAGS+=`$PKG_CONFIG --libs glib-2.0 gmodule-2.0` 154 CFLAGS+=`$PKG_CONFIG --cflags glib-2.0 gmodule-2.0` 151 155 EOF 152 156 echo '#define GLIB2' >> config.h … … 190 194 detect_nss() 191 195 { 192 if type pkg-config > /dev/null 2>/dev/null && pkg-configmozilla-nss; then196 if $PKG_CONFIG --version > /dev/null 2>/dev/null && $PKG_CONFIG mozilla-nss; then 193 197 cat<<EOF>>Makefile.settings 194 EFLAGS+=` pkg-config--libs mozilla-nss`195 CFLAGS+=` pkg-config--cflags mozilla-nss`198 EFLAGS+=`$PKG_CONFIG --libs mozilla-nss` 199 CFLAGS+=`$PKG_CONFIG --cflags mozilla-nss` 196 200 EOF 197 201 -
protocols/nogaim.c
r4146a07 r643dfc4 82 82 GError *error = NULL; 83 83 84 dir = g_dir_open( PLUGINDIR, 0, &error);84 dir = g_dir_open(global.conf->plugindir, 0, &error); 85 85 86 86 if (dir) { … … 89 89 90 90 while ((entry = g_dir_read_name(dir))) { 91 path = g_build_filename( PLUGINDIR, entry, NULL);91 path = g_build_filename(global.conf->plugindir, entry, NULL); 92 92 if(!path) { 93 93 log_message(LOGLVL_WARNING, "Can't build path for %s\n", entry); -
protocols/oscar/conn.c
r4146a07 r643dfc4 627 627 } 628 628 629 #ifndef _WIN32 630 fcntl(conn->fd, F_SETFL, 0); /* XXX should restore original flags */ 631 #endif 629 sock_make_blocking(conn->fd); 632 630 633 631 conn->status &= ~AIM_CONN_STATUS_INPROGRESS; -
protocols/proxy.c
r4146a07 r643dfc4 133 133 return; 134 134 } 135 fcntl(source, F_SETFL, 0);136 135 #endif 136 sock_make_blocking(source); 137 137 gaim_input_remove(phb->inpa); 138 138 if( phb->proxy_func ) … … 229 229 return; 230 230 } 231 #ifdef F_SETFL 232 fcntl(source, F_SETFL, 0); 233 #endif 231 sock_make_blocking(source); 234 232 235 233 g_snprintf(cmd, sizeof(cmd), "CONNECT %s:%d HTTP/1.1\r\nHost: %s:%d\r\n", phb->host, phb->port, … … 322 320 return; 323 321 } 324 #ifdef F_SETFL 325 fcntl(source, F_SETFL, 0); 326 #endif 322 sock_make_blocking(source); 327 323 328 324 /* XXX does socks4 not support host name lookups by the proxy? */ … … 509 505 return; 510 506 } 511 #ifdef F_SETFL 512 fcntl(source, F_SETFL, 0); 513 #endif 507 sock_make_blocking(source); 514 508 515 509 i = 0; -
protocols/ssl_bogus.c
r4146a07 r643dfc4 26 26 #include "ssl_client.h" 27 27 28 int ssl_errno; 29 28 30 void *ssl_connect( char *host, int port, SslInputFunction func, gpointer data ) 29 31 { -
protocols/ssl_client.h
r4146a07 r643dfc4 27 27 #include "proxy.h" 28 28 29 #define SSL_OK 0 30 #define SSL_NOHANDSHAKE 1 31 #define SSL_AGAIN 2 32 33 extern int ssl_errno; 34 29 35 typedef void (*SslInputFunction)(gpointer, void*, GaimInputCondition); 30 36 -
protocols/ssl_gnutls.c
r4146a07 r643dfc4 25 25 26 26 #include <gnutls/gnutls.h> 27 #include <fcntl.h> 28 #include <unistd.h> 27 29 #include "proxy.h" 28 30 #include "ssl_client.h" 29 31 #include "sock.h" 30 32 #include "stdlib.h" 33 34 int ssl_errno = 0; 31 35 32 36 static gboolean initialized = FALSE; … … 38 42 int fd; 39 43 gboolean established; 44 int inpa; 40 45 41 46 gnutls_session session; … … 44 49 45 50 static void ssl_connected( gpointer data, gint source, GaimInputCondition cond ); 46 47 51 48 52 … … 54 58 conn->func = func; 55 59 conn->data = data; 60 conn->inpa = -1; 56 61 57 62 if( conn->fd < 0 ) … … 76 81 } 77 82 83 static void ssl_handshake( gpointer data, gint source, GaimInputCondition cond ); 84 78 85 static void ssl_connected( gpointer data, gint source, GaimInputCondition cond ) 79 86 { … … 81 88 82 89 if( source == -1 ) 83 goto ssl_connected_failure; 90 { 91 conn->func( conn->data, NULL, cond ); 92 93 gnutls_deinit( conn->session ); 94 gnutls_certificate_free_credentials( conn->xcred ); 95 96 g_free( conn ); 97 98 return; 99 } 84 100 101 sock_make_nonblocking( conn->fd ); 85 102 gnutls_transport_set_ptr( conn->session, (gnutls_transport_ptr) conn->fd ); 86 103 87 if( gnutls_handshake( conn->session ) < 0 ) 88 goto ssl_connected_failure; 104 ssl_handshake( data, source, cond ); 105 } 106 107 static void ssl_handshake( gpointer data, gint source, GaimInputCondition cond ) 108 { 109 struct scd *conn = data; 110 int st; 89 111 90 conn->established = TRUE; 91 conn->func( conn->data, conn, cond ); 92 return; 112 if( conn->inpa != -1 ) 113 gaim_input_remove( conn->inpa ); 93 114 94 ssl_connected_failure: 95 conn->func( conn->data, NULL, cond ); 96 97 gnutls_deinit( conn->session ); 98 gnutls_certificate_free_credentials( conn->xcred ); 99 if( source >= 0 ) closesocket( source ); 100 g_free( conn ); 115 if( ( st = gnutls_handshake( conn->session ) ) < 0 ) 116 { 117 if( st == GNUTLS_E_AGAIN || st == GNUTLS_E_INTERRUPTED ) 118 { 119 conn->inpa = gaim_input_add( conn->fd, 120 gnutls_record_get_direction( conn->session ) ? 121 GAIM_INPUT_WRITE : GAIM_INPUT_READ, 122 ssl_handshake, data ); 123 } 124 else 125 { 126 conn->func( conn->data, NULL, cond ); 127 128 gnutls_deinit( conn->session ); 129 gnutls_certificate_free_credentials( conn->xcred ); 130 closesocket( conn->fd ); 131 132 g_free( conn ); 133 } 134 } 135 else 136 { 137 /* For now we can't handle non-blocking perfectly everywhere... */ 138 sock_make_blocking( conn->fd ); 139 140 conn->established = TRUE; 141 conn->func( conn->data, conn, cond ); 142 } 101 143 } 102 144 … … 104 146 { 105 147 if( !((struct scd*)conn)->established ) 106 return( 0 ); 148 { 149 ssl_errno = SSL_NOHANDSHAKE; 150 return( -1 ); 151 } 107 152 108 153 return( gnutls_record_recv( ((struct scd*)conn)->session, buf, len ) ); 154 109 155 } 110 156 … … 112 158 { 113 159 if( !((struct scd*)conn)->established ) 114 return( 0 ); 160 { 161 ssl_errno = SSL_NOHANDSHAKE; 162 return( -1 ); 163 } 115 164 116 165 return( gnutls_record_send( ((struct scd*)conn)->session, buf, len ) ); -
protocols/ssl_nss.c
r4146a07 r643dfc4 38 38 #include <secerr.h> 39 39 #include <sslerr.h> 40 41 int ssl_errno = 0; 40 42 41 43 static gboolean initialized = FALSE; -
protocols/ssl_openssl.c
r4146a07 r643dfc4 34 34 #include "ssl_client.h" 35 35 #include "sock.h" 36 37 int ssl_errno = 0; 36 38 37 39 static gboolean initialized = FALSE; -
sock.h
r4146a07 r643dfc4 6 6 #include <netdb.h> 7 7 #define sock_make_nonblocking(fd) fcntl(fd, F_SETFL, O_NONBLOCK) 8 #define sock_make_blocking(fd) fcntl(fd, F_SETFL, 0) 8 9 #define sockerr_again() (errno == EINPROGRESS || errno == EINTR) 9 10 #define closesocket(a) close(a) … … 17 18 # define write(a,b,c) send(a,b,c,0) 18 19 # define sock_make_nonblocking(fd) { int non_block = 1; ioctlsocket(fd, FIONBIO, &non_block); } 20 # define sock_make_blocking(fd) { int non_block = 0; ioctlsocket(fd, FIONBIO, &non_block); } 19 21 # define sockerr_again() (WSAGetLastError() == WSAEINTR || WSAGetLastError() == WSAEINPROGRESS || WSAGetLastError() == WSAEWOULDBLOCK) 20 22 # define ETIMEDOUT WSAETIMEDOUT -
storage_text.c
r4146a07 r643dfc4 42 42 { 43 43 switch (id) { 44 case 1: return find_protocol("oscar");44 case 0: case 1: case 3: return find_protocol("oscar"); 45 45 case 4: return find_protocol("msn"); 46 46 case 2: return find_protocol("yahoo");
Note: See TracChangeset
for help on using the changeset viewer.