( cvs diff -u -r 1.5 -r 1.6 src/folderutils.c; ) > 0.9.12cvs53.patchset
( cvs diff -u -r 1.71 -r 1.72 po/POTFILES.in; cvs diff -u -r 1.138 -r 1.139 src/main.c ) > 0.9.12cvs54.patchset
( cvs diff -u -r 1.139 -r 1.140 src/main.c; cvs diff -u -r 1.13 -r 1.14 src/common/ssl.c; cvs diff -u -r 1.7 -r 1.8 src/common/sylpheed.c; cvs diff -u -r 1.5 -r 1.6 src/common/sylpheed.h; ) > 0.9.12cvs55.patchset
+( cvs diff -u -r 1.140 -r 1.141 src/main.c; cvs diff -u -r 1.14 -r 1.15 src/common/ssl.c; cvs diff -u -r 1.8 -r 1.9 src/common/sylpheed.c; cvs diff -u -r 1.6 -r 1.7 src/common/sylpheed.h; ) > 0.9.12cvs56.patchset
#include <glib.h>
-#include "sylpheed.h"
#include "intl.h"
#include "utils.h"
#include "ssl.h"
#include "ssl_certificate.h"
-#ifdef USE_PTHREAD
-#include <pthread.h>
-#endif
-
-#ifdef USE_PTHREAD
-typedef struct _thread_data {
- SSL *ssl;
- gboolean done;
-} thread_data;
-#endif
-
-
static SSL_CTX *ssl_ctx;
void ssl_init(void)
SSL_CTX_free(ssl_ctx);
}
-#ifdef USE_PTHREAD
-void *SSL_connect_thread(void *data)
-{
- thread_data *td = (thread_data *)data;
- int result = SSL_connect(td->ssl);
- td->done = TRUE; /* let the caller thread join() */
- return GINT_TO_POINTER(result);
-}
-#endif
-
-gint SSL_connect_nb(SSL *ssl)
-{
-#ifdef USE_PTHREAD
- thread_data *td = g_new0(thread_data, 1);
- pthread_t pt;
- void *res = NULL;
-
- td->ssl = ssl;
- td->done = FALSE;
-
- /* try to create a thread to initialize the SSL connection,
- * fallback to blocking method in case of problem
- */
- if (pthread_create(&pt, PTHREAD_CREATE_JOINABLE,
- SSL_connect_thread, td) != 0)
- return SSL_connect(ssl);
-
- debug_print("waiting for SSL_connect thread...\n");
- while(!td->done) {
- /* don't let the interface freeze while waiting */
- sylpheed_do_idle();
- }
-
- /* get the thread's return value and clean its resources */
- pthread_join(pt, &res);
- g_free(td);
-
- debug_print("SSL_connect thread returned %d\n",
- GPOINTER_TO_INT(res));
-
- return GPOINTER_TO_INT(res);
-#else
- return SSL_connect(ssl);
-#endif
-}
-
gboolean ssl_init_socket(SockInfo *sockinfo)
{
return ssl_init_socket_with_method(sockinfo, SSL_METHOD_SSLv23);
}
SSL_set_fd(ssl, sockinfo->sock);
- if (SSL_connect_nb(ssl) == -1) {
+ if (SSL_connect(ssl) == -1) {
g_warning(_("SSL connect failed (%s)\n"),
ERR_error_string(ERR_get_error(), NULL));
SSL_free(ssl);
static gboolean sylpheed_initialized = FALSE;
static gchar *startup_dir;
-static void (*sylpheed_idle_function)(void) = NULL;
/**
* Parse program parameters and remove all parameters
{
return VERSION_NUMERIC;
}
-
-void sylpheed_register_idle_function (void (*idle_func)(void))
-{
- sylpheed_idle_function = idle_func;
-}
-
-void sylpheed_do_idle(void)
-{
- if (sylpheed_idle_function != NULL)
- sylpheed_idle_function();
-}
static MainWindow *static_mainwindow;
-void sylpheed_gtk_idle(void)
-{
- while(gtk_events_pending())
- gtk_main_iteration();
-}
-
int main(int argc, char *argv[])
{
gchar *userrc;
cmd.status_full_folders = NULL;
}
- sylpheed_register_idle_function(sylpheed_gtk_idle);
-
prefs_toolbar_init();
plugin_load_all("GTK");