[Dancer-changes] CVS: dancer/src command.c,1.7,1.8 netstuff.c,1.4,1.5
Brought to you by:
bagder
|
From: Alex H. <ho...@us...> - 2002-08-12 23:39:03
|
Update of /cvsroot/dancer/dancer/src
In directory usw-pr-cvs1:/tmp/cvs-serv15990
Modified Files:
command.c netstuff.c
Log Message:
Nuke ifdef's by badger related to fileserving by Dancer. If you
want to serve files to your users, use HTTP.
Index: command.c
===================================================================
RCS file: /cvsroot/dancer/dancer/src/command.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- command.c 12 Aug 2002 23:19:46 -0000 1.7
+++ command.c 12 Aug 2002 23:39:01 -0000 1.8
@@ -240,13 +240,6 @@
"<password> [registered nick]",
msg_help_ident, CMD_NONE | CMD_IDENT},
-#ifdef BAGDER
- {"FILEGET", CmdFileGet,
- LEVEL_ANYBODY, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE,
- "<filename>",
- NULL, CMD_NONE},
-#endif
-
/* --- Recognized users --- */
{"PASS", CmdPass,
@@ -5493,19 +5486,6 @@
void CmdConfA(char *from, char *line)
{
snapshot;
-}
-#endif
-
-#ifdef BAGDER
-void CmdFileGet(char *from, char *line)
-{
- char getwhat[SEMIBUFFER];
-
- snapshot;
- if (1 == StrScan(line, "%"SEMIBUFFERTXT"s", getwhat))
- Outgoing(from, OUT_SEND, getwhat);
- else
- CmdSyntax(errfrom, "FILEGET");
}
#endif
Index: netstuff.c
===================================================================
RCS file: /cvsroot/dancer/dancer/src/netstuff.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- netstuff.c 12 Aug 2002 23:19:46 -0000 1.4
+++ netstuff.c 12 Aug 2002 23:39:01 -0000 1.5
@@ -471,98 +471,6 @@
else
ReplyCtcp(from, "ERRMSG Unable to establish connection");
}
-#ifdef BAGDER
- else if (OUT_SEND == linksort) {
- char *ptr;
- bool uselocal = TRUE;
- int file;
-
- while ('/' == *opts)
- opts++;
-
- StrFormatMax(buffer, sizeof(buffer), "%s/%s", DCC_FILEPATH, opts);
- StrFormatMax(buffer2, sizeof(buffer2), "%s/%s", DCC_FILECACHE, opts);
- /* StrCopy(buffer2, buffer); */
- ptr = buffer2 + StrLength(DCC_FILECACHE) + 1;
- while (*ptr) {
- if ('/' == *ptr)
- *ptr = '_';
- ptr++;
- }
-
- /* Things done here:
- 1) Check if the file is in the cache, and use that if it is
- 2) - fetch the file from the primary site and write it in the
- cache dir, start DCCing as soon as the file grows
- (timout the wait in X seconds, 20<X<60 seconds)
- and continue until the fetch signals DONE (even if some
- reads may not give new data due to slow ftp fetch)
- - when the ftp is done (the Exec() job is complete), the
- client should get noted
- - file existance and size should be checked, 0 bytes means
- failed ftp => abort DCC (retry next ftp site when multiple
- ones are supported)
- */
-
- /* First out, check for the file in the cache */
- file = open(buffer2, O_RDONLY);
- if (-1 == file) {
- /* Not in the cache, we need to get it from the ftp site */
- int s; /* to read the file from */
-
- /* Get the file from the FTP server, we lock this synchronously at
- least for a start, all the way until we start downloading the
- file, which will be done as a receiving socket as on additional
- socket client */
- if (!ftpget(site, buffer, &s, &size)) {
- /* we got a file size and a socket back, use them both */
- itemclient *k = AddClient(from, NULL, NULL, s);
- if (k) {
- file = open(temporary, O_RDONLY);
- }
- }
- }
-
- if (0 <= file) {
- /* Add this download to the cache */
- CacheAdd(buffer2);
- }
-
- if (file > 0) {
- char *filebuffer = malloc(CLF_FILEBUFFER);
-
- if (buffer &&
- (c = OpenListener(from, current->host, current->user))) {
- char *filepart;
-
- c->file = file;
- c->linksort = linksort;
- c->lasttime = time(NULL);
- c->filebuffer = filebuffer;
-
- if (uselocal)
- /* if this is a local file, it is considered complete already */
- c->fileflags |= CLF_FILECOMPLETE;
-
- filepart = StrIndexLast(buffer, '/');
- if (filepart)
- filepart++;
- else
- filepart = buffer;
-
- /* That silly AmIRC client requires a file length parameter! */
- SendCtcpf(from, "DCC SEND %s %lu %u -1", filepart,
- myip4addrnum, htons(c->addr.sin_port));
- fprintf(stderr, "DCC SEND %s %lu %u -1\n", filepart,
- myip4addrnum, htons(c->addr.sin_port));
- }
- else
- ReplyCtcp(from, "ERRMSG Unable to establish connection");
- }
- else
- ReplyCtcp(from, "ERRMSG Unable to get the specified file");
- }
-#endif
}
/* --- Alive ------------------------------------------------------ */
|