summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2008-05-20 17:29:44 +0200
committerSebastien Helleu <flashcode@flashtux.org>2008-05-20 17:29:44 +0200
commitede921cc4d74df47b08405c468be2ec7b6f34069 (patch)
tree807e3edebea79bc8ca087d2e829a23c1de45263e /src/plugins
parent0a225e5cce5440642618eebea0761c3ebaee3b18 (diff)
downloadweechat-ede921cc4d74df47b08405c468be2ec7b6f34069.zip
Remove old dcc code, unused now
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/irc/CMakeLists.txt1
-rw-r--r--src/plugins/irc/Makefile.am2
-rw-r--r--src/plugins/irc/irc-channel.c1
-rw-r--r--src/plugins/irc/irc-channel.h2
-rw-r--r--src/plugins/irc/irc-config.c1
-rw-r--r--src/plugins/irc/irc-dcc.c88
-rw-r--r--src/plugins/irc/irc-dcc.h134
-rw-r--r--src/plugins/irc/irc-input.c1
-rw-r--r--src/plugins/irc/irc.c2
9 files changed, 1 insertions, 231 deletions
diff --git a/src/plugins/irc/CMakeLists.txt b/src/plugins/irc/CMakeLists.txt
index c4da9b459..bb5bc4e53 100644
--- a/src/plugins/irc/CMakeLists.txt
+++ b/src/plugins/irc/CMakeLists.txt
@@ -22,7 +22,6 @@ irc-color.c irc-color.h
irc-command.c irc-command.h
irc-completion.c irc-completion.h
irc-config.c irc-config.h
-irc-dcc.c irc-dcc.h
irc-debug.c irc-debug.h
irc-display.c irc-display.h
irc-input.c irc-input.h
diff --git a/src/plugins/irc/Makefile.am b/src/plugins/irc/Makefile.am
index e4e25fe30..39583cce3 100644
--- a/src/plugins/irc/Makefile.am
+++ b/src/plugins/irc/Makefile.am
@@ -34,8 +34,6 @@ irc_la_SOURCES = irc.c \
irc-completion.h \
irc-config.c \
irc-config.h \
- irc-dcc.c \
- irc-dcc.h \
irc-debug.c \
irc-debug.h \
irc-display.c \
diff --git a/src/plugins/irc/irc-channel.c b/src/plugins/irc/irc-channel.c
index 48c63bcbc..ecca71e8d 100644
--- a/src/plugins/irc/irc-channel.c
+++ b/src/plugins/irc/irc-channel.c
@@ -28,7 +28,6 @@
#include "irc-channel.h"
#include "irc-buffer.h"
#include "irc-config.h"
-#include "irc-dcc.h"
#include "irc-nick.h"
#include "irc-server.h"
#include "irc-input.h"
diff --git a/src/plugins/irc/irc-channel.h b/src/plugins/irc/irc-channel.h
index ca335639e..7aa4ca493 100644
--- a/src/plugins/irc/irc-channel.h
+++ b/src/plugins/irc/irc-channel.h
@@ -39,7 +39,7 @@ struct t_irc_channel
char *modes; /* channel modes */
int limit; /* user limit (0 is limit not set) */
char *key; /* channel key (NULL if no key set) */
- int nicks_count; /* # nicks on channel (0 if dcc/pv) */
+ int nicks_count; /* # nicks on channel (0 if pv) */
int checking_away; /* = 1 if checking away with WHO cmd */
char *away_message; /* to display away only once in pv */
int cycle; /* currently cycling (/part + /join) */
diff --git a/src/plugins/irc/irc-config.c b/src/plugins/irc/irc-config.c
index 603f0a0c9..104d648a3 100644
--- a/src/plugins/irc/irc-config.c
+++ b/src/plugins/irc/irc-config.c
@@ -29,7 +29,6 @@
#include "../weechat-plugin.h"
#include "irc.h"
#include "irc-config.h"
-#include "irc-dcc.h"
#include "irc-server.h"
diff --git a/src/plugins/irc/irc-dcc.c b/src/plugins/irc/irc-dcc.c
deleted file mode 100644
index 0cd4aab7b..000000000
--- a/src/plugins/irc/irc-dcc.c
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright (c) 2003-2008 by FlashCode <flashcode@flashtux.org>
- * See README for License detail, AUTHORS for developers list.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/* irc-dcc.c: Direct Client-to-Client (DCC) communication (files & chat) */
-
-
-#include <stdlib.h>
-#include <unistd.h>
-#include <signal.h>
-#include <string.h>
-#include <stdarg.h>
-#include <fcntl.h>
-#include <time.h>
-#include <errno.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-
-#include "../weechat-plugin.h"
-#include "irc.h"
-#include "irc-dcc.h"
-#include "irc-config.h"
-
-
-struct t_irc_dcc *irc_dcc_list = NULL; /* DCC files & chat list */
-struct t_irc_dcc *irc_last_dcc = NULL; /* last DCC in list */
-
-
-
-/*
- * irc_dcc_accept_resume: accepts a resume and inform the receiver
- */
-/*
-void
-irc_dcc_accept_resume (struct t_irc_server *server, char *filename, int port,
- unsigned long pos_start)
-{
- struct t_irc_dcc *ptr_dcc;
-
- ptr_dcc = irc_dcc_search (server, IRC_DCC_FILE_SEND, IRC_DCC_CONNECTING,
- port);
- if (ptr_dcc)
- {
- ptr_dcc->pos = pos_start;
- ptr_dcc->ack = pos_start;
- ptr_dcc->start_resume = pos_start;
- ptr_dcc->last_check_pos = pos_start;
- irc_server_sendf (ptr_dcc->server,
- (strchr (ptr_dcc->filename, ' ')) ?
- "PRIVMSG %s :\01DCC ACCEPT \"%s\" %d %u\01\n" :
- "PRIVMSG %s :\01DCC ACCEPT %s %d %u\01",
- ptr_dcc->nick, ptr_dcc->filename,
- ptr_dcc->port, ptr_dcc->start_resume);
-
- gui_chat_printf_info (ptr_dcc->server->buffer,
- _("DCC: file %s%s%s resumed at position %u\n"),
- GUI_COLOR(GUI_COLOR_CHAT_CHANNEL),
- ptr_dcc->filename,
- GUI_COLOR(GUI_COLOR_CHAT),
- ptr_dcc->start_resume);
- irc_dcc_redraw (WEECHAT_HOTLIST_MESSAGE);
- }
- else
- gui_chat_printf (server->buffer,
- _("%s can't resume file \"%s\" (port: %d, start "
- "position: %u): DCC not found or ended\n"),
- WEECHAT_ERROR, filename, port, pos_start);
-}
-*/
diff --git a/src/plugins/irc/irc-dcc.h b/src/plugins/irc/irc-dcc.h
deleted file mode 100644
index 19a0a304e..000000000
--- a/src/plugins/irc/irc-dcc.h
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * Copyright (c) 2003-2008 by FlashCode <flashcode@flashtux.org>
- * See README for License detail, AUTHORS for developers list.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-
-#ifndef __WEECHAT_IRC_DCC_H
-#define __WEECHAT_IRC_DCC_H 1
-
-/* DCC types */
-
-#define IRC_DCC_CHAT_RECV 0 /* receiving DCC chat */
-#define IRC_DCC_CHAT_SEND 1 /* sending DCC chat */
-#define IRC_DCC_FILE_RECV 2 /* incoming DCC file */
-#define IRC_DCC_FILE_SEND 3 /* sending DCC file */
-
-/* DCC status */
-
-#define IRC_DCC_WAITING 0 /* waiting for host answer */
-#define IRC_DCC_CONNECTING 1 /* connecting to host */
-#define IRC_DCC_ACTIVE 2 /* sending/receiving data */
-#define IRC_DCC_DONE 3 /* transfer done */
-#define IRC_DCC_FAILED 4 /* DCC failed */
-#define IRC_DCC_ABORTED 5 /* DCC aborted by user */
-
-/* DCC blocksize (for file) */
-
-#define IRC_DCC_MIN_BLOCKSIZE 1024 /* min DCC block size when sending file*/
-#define IRC_DCC_MAX_BLOCKSIZE 102400 /* max DCC block size when sending file*/
-
-/* DCC errors (for file) */
-
-#define IRC_DCC_NO_ERROR 0 /* no error to report, all ok! */
-#define IRC_DCC_ERROR_READ_LOCAL 1 /* unable to read local file */
-#define IRC_DCC_ERROR_SEND_BLOCK 2 /* unable to send block to receiver */
-#define IRC_DCC_ERROR_READ_ACK 3 /* unable to read ACK from receiver */
-#define IRC_DCC_ERROR_CONNECT_SENDER 4 /* unable to connect to sender */
-#define IRC_DCC_ERROR_RECV_BLOCK 5 /* unable to recv block from sender */
-#define IRC_DCC_ERROR_WRITE_LOCAL 6 /* unable to write to local file */
-
-/* DCC macros for type */
-
-#define IRC_DCC_IS_CHAT(type) ((type == IRC_DCC_CHAT_RECV) || \
- (type == IRC_DCC_CHAT_SEND))
-#define IRC_DCC_IS_FILE(type) ((type == IRC_DCC_FILE_RECV) || \
- (type == IRC_DCC_FILE_SEND))
-#define IRC_DCC_IS_RECV(type) ((type == IRC_DCC_CHAT_RECV) || \
- (type == IRC_DCC_FILE_RECV))
-#define IRC_DCC_IS_SEND(type) ((type == IRC_DCC_CHAT_SEND) || \
- (type == IRC_DCC_FILE_SEND))
-
-/* DCC macro for status */
-
-#define IRC_DCC_ENDED(status) ((status == IRC_DCC_DONE) || \
- (status == IRC_DCC_FAILED) || \
- (status == IRC_DCC_ABORTED))
-
-struct t_irc_dcc
-{
- struct t_irc_server *server; /* irc server */
- struct t_irc_channel *channel; /* irc channel (for DCC chat only) */
- int type; /* DCC type (file/chat, send/receive) */
- int status; /* DCC status (waiting, sending, ..) */
- time_t start_time; /* the time when DCC started */
- time_t start_transfer; /* the time when DCC transfer started */
- unsigned long addr; /* IP address */
- int port; /* port */
- char *nick; /* remote nick */
- int sock; /* socket for connection */
- pid_t child_pid; /* pid of child process (sending/recving)*/
- int child_read; /* to read into child pipe */
- int child_write; /* to write into child pipe */
- char *unterminated_message; /* beginning of a message in input buf */
- int fast_send; /* fase send for files: does not wait ACK*/
- int file; /* local file (for reading or writing) */
- char *filename; /* filename (given by sender) */
- char *local_filename; /* local filename (with path) */
- int filename_suffix; /* suffix (.1 for ex) if renaming file */
- int blocksize; /* block size for sending file */
- unsigned long size; /* file size */
- unsigned long pos; /* number of bytes received/sent */
- unsigned long ack; /* number of bytes received OK */
- unsigned long start_resume; /* start of resume (in bytes) */
- time_t last_check_time; /* last time we looked at bytes sent/recv*/
- unsigned long last_check_pos; /* bytes sent/recv at last check */
- time_t last_activity; /* time of last byte received/sent */
- unsigned long bytes_per_sec; /* bytes per second */
- unsigned long eta; /* estimated time of arrival */
- struct t_irc_dcc *prev_dcc; /* link to previous dcc file/chat */
- struct t_irc_dcc *next_dcc; /* link to next dcc file/chat */
-};
-
-extern struct t_irc_dcc *irc_dcc_list;
-extern struct t_irc_dcc *irc_last_dcc;
-extern char *irc_dcc_status_string[6];
-
-extern void irc_dcc_redraw (int highlight);
-extern void irc_dcc_free (struct t_irc_dcc *dcc);
-extern void irc_dcc_close (struct t_irc_dcc *dcc, int status);
-extern void irc_dcc_chat_remove_channel (struct t_irc_channel *channel);
-extern void irc_dcc_accept (struct t_irc_dcc *dcc);
-extern void irc_dcc_accept_resume (struct t_irc_server *server, char *filename,
- int port, unsigned long pos_start);
-extern void irc_dcc_start_resume (struct t_irc_server *server, char *filename,
- int port, unsigned long pos_start);
-extern struct t_irc_dcc *irc_dcc_alloc ();
-extern struct t_irc_dcc *irc_dcc_add (struct t_irc_server *server,
- int type, unsigned long addr,
- int port, char *nick, int sock,
- char *filename, char *local_filename,
- unsigned long size);
-extern void irc_dcc_send_request (struct t_irc_server *server, int type,
- char *nick, char *filename);
-extern void irc_dcc_chat_sendf (struct t_irc_dcc *dcc, char *format, ...);
-extern void irc_dcc_file_send_fork (struct t_irc_dcc *dcc);
-extern void irc_dcc_file_recv_fork (struct t_irc_dcc *dcc);
-extern void irc_dcc_handle ();
-extern void irc_dcc_end ();
-extern void irc_dcc_print_log ();
-
-#endif /* irc-dcc.h */
diff --git a/src/plugins/irc/irc-input.c b/src/plugins/irc/irc-input.c
index 03e7d9147..47c22f3f7 100644
--- a/src/plugins/irc/irc-input.c
+++ b/src/plugins/irc/irc-input.c
@@ -27,7 +27,6 @@
#include "irc-server.h"
#include "irc-channel.h"
#include "irc-nick.h"
-#include "irc-dcc.h"
#include "irc-color.h"
#include "irc-config.h"
diff --git a/src/plugins/irc/irc.c b/src/plugins/irc/irc.c
index ee9f24481..f4947f8bf 100644
--- a/src/plugins/irc/irc.c
+++ b/src/plugins/irc/irc.c
@@ -31,7 +31,6 @@
#include "irc-server.h"
#include "irc-channel.h"
#include "irc-nick.h"
-#include "irc-dcc.h"
WEECHAT_PLUGIN_NAME("irc");
@@ -154,7 +153,6 @@ weechat_plugin_end (struct t_weechat_plugin *plugin)
irc_config_write ();
irc_server_disconnect_all ();
- //irc_dcc_end ();
irc_server_free_all ();
return WEECHAT_RC_OK;