summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2006-08-03 19:50:52 +0000
committerSebastien Helleu <flashcode@flashtux.org>2006-08-03 19:50:52 +0000
commita5cd14add5991c630203fdada2b4f95c50a9cce5 (patch)
treea34517d6a14a381adcb2ffbe89e1fe4a1143372d /src/common
parent34ee7e407695f858c94b0c3c379c4d30759431f6 (diff)
downloadweechat-a5cd14add5991c630203fdada2b4f95c50a9cce5.zip
Improved DCC speed (up to x5 on LAN) by forking for DCC files and a new option "dcc_fast_send" (does not wait for ACK) (task #5758)
Diffstat (limited to 'src/common')
-rw-r--r--src/common/session.c12
-rw-r--r--src/common/session.h5
-rw-r--r--src/common/weeconfig.c7
-rw-r--r--src/common/weeconfig.h1
4 files changed, 23 insertions, 2 deletions
diff --git a/src/common/session.c b/src/common/session.c
index 2867c8c48..df26a119f 100644
--- a/src/common/session.c
+++ b/src/common/session.c
@@ -320,6 +320,9 @@ session_save_dcc (FILE *file)
rc = rc && (session_write_buf (file, SESSION_DCC_LAST_ACTIVITY, &(ptr_dcc->last_activity), sizeof (time_t)));
rc = rc && (session_write_buf (file, SESSION_DCC_BYTES_PER_SEC, &(ptr_dcc->bytes_per_sec), sizeof (unsigned long)));
rc = rc && (session_write_buf (file, SESSION_DCC_ETA, &(ptr_dcc->eta), sizeof (unsigned long)));
+ rc = rc && (session_write_int (file, SESSION_DCC_CHILD_PID, ptr_dcc->child_pid));
+ rc = rc && (session_write_int (file, SESSION_DCC_CHILD_READ, ptr_dcc->child_read));
+ rc = rc && (session_write_int (file, SESSION_DCC_CHILD_WRITE, ptr_dcc->child_write));
rc = rc && (session_write_id (file, SESSION_DCC_END));
if (!rc)
@@ -1289,6 +1292,15 @@ session_load_dcc (FILE *file)
case SESSION_DCC_ETA:
rc = rc && (session_read_buf (file, &(dcc->eta), sizeof (unsigned long)));
break;
+ case SESSION_DCC_CHILD_PID:
+ rc = rc && (session_read_int (file, &(dcc->child_pid)));
+ break;
+ case SESSION_DCC_CHILD_READ:
+ rc = rc && (session_read_int (file, &(dcc->child_read)));
+ break;
+ case SESSION_DCC_CHILD_WRITE:
+ rc = rc && (session_read_int (file, &(dcc->child_write)));
+ break;
default:
weechat_log_printf (_("session: warning: ignoring value from "
"DCC (object id: %d)\n"));
diff --git a/src/common/session.h b/src/common/session.h
index 3d35c461a..358b2b1ce 100644
--- a/src/common/session.h
+++ b/src/common/session.h
@@ -144,7 +144,10 @@ enum t_session_dcc
SESSION_DCC_LAST_CHECK_POS,
SESSION_DCC_LAST_ACTIVITY,
SESSION_DCC_BYTES_PER_SEC,
- SESSION_DCC_ETA
+ SESSION_DCC_ETA,
+ SESSION_DCC_CHILD_PID,
+ SESSION_DCC_CHILD_READ,
+ SESSION_DCC_CHILD_WRITE
};
enum t_session_history
diff --git a/src/common/weeconfig.c b/src/common/weeconfig.c
index cb8449539..08f4db61c 100644
--- a/src/common/weeconfig.c
+++ b/src/common/weeconfig.c
@@ -802,6 +802,7 @@ int cfg_dcc_auto_accept_files;
int cfg_dcc_auto_accept_chats;
int cfg_dcc_timeout;
int cfg_dcc_blocksize;
+int cfg_dcc_fast_send;
char *cfg_dcc_port_range;
char *cfg_dcc_own_ip;
char *cfg_dcc_download_path;
@@ -821,12 +822,16 @@ t_config_option weechat_options_dcc[] =
NULL, NULL, &cfg_dcc_auto_accept_chats, NULL, &config_change_noop },
{ "dcc_timeout", N_("timeout for dcc request"),
N_("timeout for dcc request (in seconds)"),
- OPTION_TYPE_INT, 1, INT_MAX, 300,
+ OPTION_TYPE_INT, 5, INT_MAX, 300,
NULL, NULL, &cfg_dcc_timeout, NULL, &config_change_noop },
{ "dcc_blocksize", N_("block size for dcc packets"),
N_("block size for dcc packets in bytes (default: 65536)"),
OPTION_TYPE_INT, DCC_MIN_BLOCKSIZE, DCC_MAX_BLOCKSIZE, 65536,
NULL, NULL, &cfg_dcc_blocksize, NULL, &config_change_noop },
+ { "dcc_fast_send", N_("does not wait for ACK when sending file"),
+ N_("does not wait for ACK when sending file"),
+ OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
+ NULL, NULL, &cfg_dcc_fast_send, NULL, &config_change_noop },
{ "dcc_port_range", N_("allowed ports for outgoing dcc"),
N_("restricts outgoing dcc to use only ports in the given range "
"(useful for NAT) (syntax: a single port, ie. 5000 or a port "
diff --git a/src/common/weeconfig.h b/src/common/weeconfig.h
index 998993035..f8ecf7742 100644
--- a/src/common/weeconfig.h
+++ b/src/common/weeconfig.h
@@ -221,6 +221,7 @@ extern int cfg_dcc_auto_accept_files;
extern int cfg_dcc_auto_accept_chats;
extern int cfg_dcc_timeout;
extern int cfg_dcc_blocksize;
+extern int cfg_dcc_fast_send;
extern char *cfg_dcc_port_range;
extern char *cfg_dcc_own_ip;
extern char *cfg_dcc_download_path;