+2003-05-26
+
+ * src/socket.[ch]:
+ sock_set_io_timeout(): new. It sets the timeout interval.
+ sock_gdk_input_add(): removed since it's not used anymore.
+ * src/prefs_common.[ch]: added an option to set the timeout parameter.
+
2003-05-26
* src/action.c: fixed a bug that didn't hidden user string in
+2003-05-27 [paul] 0.9.0claws3
+
+ * sync with 0.9.0cvs10
+ see ChangeLog 2003-05-26
+
2003-05-26 [paul] 0.9.0claws2
* sync with 0.9.0cvs9
+2003-05-26
+
+ * src/socket.[ch]:
+ sock_set_io_timeout(): ¿·µ¬¡£¥¿¥¤¥à¥¢¥¦¥È¤Î´Ö³Ö¤ò»ØÄꤹ¤ë¡£
+ sock_gdk_input_add(): ´û¤Ë»ÈÍѤµ¤ì¤Æ¤¤¤Ê¤¤¤¿¤áºï½ü¡£
+ * src/prefs_common.[ch]: ¥¿¥¤¥à¥¢¥¦¥È¤ÎÃͤò»ØÄꤹ¤ë¥ª¥×¥·¥ç¥ó¤òÄɲá£
+
2003-05-26
* src/action.c: create_io_dialog() ¤Ç¥æ¡¼¥¶Ê¸»úÎó¤ò±£¤·¤Æ¤¤¤Ê¤«¤Ã¤¿
MICRO_VERSION=0
INTERFACE_AGE=0
BINARY_AGE=0
-EXTRA_VERSION=claws2
+EXTRA_VERSION=claws3
VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
dnl set $target
#endif
#define BUFFSIZE 8192
-#define IO_TIMEOUT 60
+
+guint io_timeout = 60;
static gint sock_connect_with_timeout (gint sock,
const struct sockaddr *serv_addr,
gushort port,
gint sock);
+gint sock_set_io_timeout(guint sec)
+{
+ io_timeout = sec;
+ return 0;
+}
+
gint fd_connect_unix(const gchar *path)
{
gint sock;
struct timeval timeout;
fd_set fds;
- timeout.tv_sec = IO_TIMEOUT;
+ timeout.tv_sec = io_timeout;
timeout.tv_usec = 0;
FD_ZERO(&fds);
FD_SET(fd, &fds);
if (cond == G_IO_IN) {
- select(fd + 1, &fds, NULL, NULL, &timeout);
+ select(fd + 1, &fds, NULL, NULL,
+ io_timeout > 0 ? &timeout : NULL);
} else {
- select(fd + 1, NULL, &fds, NULL, &timeout);
+ select(fd + 1, NULL, &fds, NULL,
+ io_timeout > 0 ? &timeout : NULL);
}
if (FD_ISSET(fd, &fds)) {
{
struct hostent *hp;
void (*prev_handler)(gint);
- guint timeout_secs = IO_TIMEOUT;
alarm(0);
prev_handler = signal(SIGALRM, timeout_handler);
errno = 0;
return NULL;
}
- alarm(timeout_secs);
+ alarm(io_timeout);
if ((hp = gethostbyname(hostname)) == NULL) {
alarm(0);
{
struct hostent *hp;
struct sockaddr_in ad;
- guint timeout_secs = IO_TIMEOUT;
memset(&ad, 0, sizeof(ad));
ad.sin_family = AF_INET;
}
return sock_connect_with_timeout(sock, (struct sockaddr *)&ad,
- sizeof(ad), timeout_secs);
+ sizeof(ad), io_timeout);
}
#else /* INET6 */
{
gint sock = -1, gai_error;
struct addrinfo hints, *res, *ai;
- guint timeout_secs = IO_TIMEOUT;
gchar port_str[6];
memset(&hints, 0, sizeof(hints));
continue;
if (sock_connect_with_timeout
- (sock, ai->ai_addr, ai->ai_addrlen, timeout_secs) == 0)
+ (sock, ai->ai_addr, ai->ai_addrlen, io_timeout) == 0)
break;
close(sock);
{
return close(fd);
}
-
-gint sock_input_add(SockInfo *sock,
- GIOCondition condition,
- GIOFunc function,
- gpointer data)
-{
- GIOChannel *channel;
- guint result;
-
- g_return_val_if_fail(sock != NULL, -1);
-
- channel = g_io_channel_unix_new(sock->sock);
- /* :WK: We have to change some things here becuse most likey
- function() does take SockInfo * and not an gint */
- result = g_io_add_watch(channel, condition, function, data);
- g_io_channel_unref(channel);
-
- return result;
-}
#endif
};
+gint sock_set_io_timeout (guint sec);
+
gint sock_set_nonblocking_mode (SockInfo *sock, gboolean nonblock);
gboolean sock_is_nonblocking_mode (SockInfo *sock);
gint sock_puts (SockInfo *sock, const gchar *buf);
gint sock_close (SockInfo *sock);
-/* wrapper functions */
-gint sock_input_add (SockInfo *sock,
- GIOCondition condition,
- GIOFunc function,
- gpointer data);
-
/* Functions to directly work on FD. They are needed for pipes */
gint fd_connect_unix (const gchar *path);
gint fd_open_unix (const gchar *path);
#include "setup.h"
#include "utils.h"
#include "gtkutils.h"
+#include "socket.h"
#include "log.h"
#include "prefs_toolbar.h"
#include "plugin.h"
gtkaspellcheckers = gtkaspell_checkers_new();
#endif
+ sock_set_io_timeout(prefs_common.io_timeout_secs);
prefs_common_save_config();
prefs_actions_read_config();
#include "gtkutils.h"
#include "alertpanel.h"
#include "folder.h"
+#include "socket.h"
#include "filesel.h"
#include "folderview.h"
#include "stock_pixmap.h"
GtkWidget *printcmd_entry;
GtkWidget *exteditor_combo;
GtkWidget *exteditor_entry;
+
GtkWidget *checkbtn_addaddrbyclick;
GtkWidget *checkbtn_confonexit;
GtkWidget *checkbtn_cleanonexit;
#endif
#endif
+ GtkWidget *spinbtn_iotimeout;
+ GtkObject *spinbtn_iotimeout_adj;
} other;
static struct MessageColorButtons {
{"summary_quicksearch_type", "0", &prefs_common.summary_quicksearch_type, P_INT,
NULL, NULL, NULL},
+ {"io_timeout_secs", "60", &prefs_common.io_timeout_secs,
+ P_INT, &other.spinbtn_iotimeout,
+ prefs_set_data_from_spinbtn, prefs_set_spinbtn},
{"hide_score", "-9999", &prefs_common.kill_score, P_INT,
NULL, NULL, NULL},
{"important_score", "1", &prefs_common.important_score, P_INT,
GtkWidget *checkbtn_cleanonexit;
GtkWidget *checkbtn_askonclean;
GtkWidget *checkbtn_warnqueued;
+
+ GtkWidget *label_iotimeout;
+ GtkWidget *spinbtn_iotimeout;
+ GtkObject *spinbtn_iotimeout_adj;
+
#if 0
#ifdef USE_OPENSSL
GtkWidget *frame_ssl;
PACK_CHECK_BUTTON (vbox_exit, checkbtn_warnqueued,
_("Warn if there are queued messages"));
+ hbox1 = gtk_hbox_new (FALSE, 8);
+ gtk_widget_show (hbox1);
+ gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
+
+ label_iotimeout = gtk_label_new (_("Socket I/O timeout:"));
+ gtk_widget_show (label_iotimeout);
+ gtk_box_pack_start (GTK_BOX (hbox1), label_iotimeout, FALSE, FALSE, 0);
+
+ spinbtn_iotimeout_adj = gtk_adjustment_new (60, 0, 1000, 1, 10, 10);
+ spinbtn_iotimeout = gtk_spin_button_new
+ (GTK_ADJUSTMENT (spinbtn_iotimeout_adj), 1, 0);
+ gtk_widget_show (spinbtn_iotimeout);
+ gtk_box_pack_start (GTK_BOX (hbox1), spinbtn_iotimeout,
+ FALSE, FALSE, 0);
+ gtk_widget_set_usize (spinbtn_iotimeout, 64, -1);
+ gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_iotimeout), TRUE);
+
+ label_iotimeout = gtk_label_new (_("second(s)"));
+ gtk_widget_show (label_iotimeout);
+ gtk_box_pack_start (GTK_BOX (hbox1), label_iotimeout, FALSE, FALSE, 0);
+
other.uri_combo = uri_combo;
other.uri_entry = uri_entry;
other.printcmd_entry = printcmd_entry;
other.checkbtn_cleanonexit = checkbtn_cleanonexit;
other.checkbtn_askonclean = checkbtn_askonclean;
other.checkbtn_warnqueued = checkbtn_warnqueued;
+
+ other.spinbtn_iotimeout = spinbtn_iotimeout;
+ other.spinbtn_iotimeout_adj = spinbtn_iotimeout_adj;
#if 0
#ifdef USE_OPENSSL
update_pixmap_theme = FALSE;
prefs_set_data_from_dialog(param);
+ sock_set_io_timeout(prefs_common.io_timeout_secs);
if (update_pixmap_theme)
{
gboolean clean_on_exit;
gboolean ask_on_clean;
gboolean warn_queued_on_exit;
+
+ gint io_timeout_secs;
+
#if 0
#ifdef USE_OPENSSL
gboolean ssl_ask_unknown_valid;