nvemftp-commit Mailing List for nvemFTP
Status: Beta
Brought to you by:
ndiin
You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(224) |
Aug
(78) |
Sep
(79) |
Oct
(28) |
Nov
(9) |
Dec
(1) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
|
Feb
(6) |
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <ben...@id...> - 2004-05-22 12:42:29
|
Dear Open Source developer I am doing a research project on "Fun and Software Development" in which I kindly invite you to participate. You will find the online survey under http://fasd.ethz.ch/qsf/. The questionnaire consists of 53 questions and you will need about 15 minutes to complete it. With the FASD project (Fun and Software Development) we want to define the motivational significance of fun when software developers decide to engage in Open Source projects. What is special about our research project is that a similar survey is planned with software developers in commercial firms. This procedure allows the immediate comparison between the involved individuals and the conditions of production of these two development models. Thus we hope to obtain substantial new insights to the phenomenon of Open Source Development. With many thanks for your participation, Benno Luthiger PS: The results of the survey will be published under http://www.isu.unizh.ch/fuehrung/blprojects/FASD/. We have set up the mailing list fa...@we... for this study. Please see http://fasd.ethz.ch/qsf/mailinglist_en.html for registration to this mailing list. _______________________________________________________________________ Benno Luthiger Swiss Federal Institute of Technology Zurich 8092 Zurich Mail: benno.luthiger(at)id.ethz.ch _______________________________________________________________________ |
|
From: <nd...@us...> - 2004-02-19 02:35:26
|
Update of /cvsroot/nvemftp/nvemftp/contrib/tests/textdump In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8488/contrib/tests/textdump Modified Files: trials Log Message: Add raw URI with path Index: trials =================================================================== RCS file: /cvsroot/nvemftp/nvemftp/contrib/tests/textdump/trials,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- trials 23 Nov 2003 05:06:44 -0000 1.5 +++ trials 19 Feb 2004 02:25:21 -0000 1.6 @@ -1,3 +1,5 @@ +ftp://ftp.kernel.org/pub/linux/kernel/v2.6/ +host 127.0.0.1 port 21 login john pass doe [[host:] 127.0.0.1] [[port:] 21] [[user:] joe] [[pass:] schmoe] [host:127.0.0.1] [port:21] [user:joe] [pass:schmoe] [h:127.0.0.1] [p:21] [u:joe] [p:schmoe] |
|
From: <nd...@us...> - 2004-02-19 02:33:20
|
Update of /cvsroot/nvemftp/nvemftp/lib/nnet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8041 Modified Files: nhostinfo.cpp Log Message: TextDump parsing updates: - Allow straight URIs to work without user/pass/port. - Allow pathnames/filenames in straight URIs Index: nhostinfo.cpp =================================================================== RCS file: /cvsroot/nvemftp/nvemftp/lib/nnet/nhostinfo.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- nhostinfo.cpp 14 Dec 2003 23:10:09 -0000 1.16 +++ nhostinfo.cpp 19 Feb 2004 02:23:15 -0000 1.17 @@ -211,6 +211,7 @@ { NHostInfo *ret = NULL; QString host, user, pass, protocol; + QString dirpath, filename; int port = -1; QStringList mhost, muser, mpass; @@ -226,18 +227,29 @@ protocol = url.protocol(); host = url.host(); mhost += host; - port = url.port(); - mport += port; - user = url.user(); - muser += user; - pass = url.password(); - mpass += pass; + + if (url.hasPort()) { + port = url.port(); + mport += port; + } + + if (url.hasUser()) { + user = url.user(); + muser += user; + } + + if (url.hasPassword()) { + pass = url.password(); + mpass += pass; + } + + if (url.hasPath()) { + dirpath = url.dirPath(); + filename = url.fileName(); + } + std::cout << "Orig: '" << orig << "'\n" - << "URI: " << url.toString() << "\n" - << "User: " << url.user() << "\n" - << "Pass: " << url.password() << "\n" - << "Port: " << url.port() << "\n" - << "Host: " << url.host() << std::endl; + << "URI: " << url.toString() << std::endl; } else { // Strip out the timestamping if it exists. textDump = textDump.remove(QRegExp("^[\\s]{0,}\\[[\\d]{1,2}:[\\d]{1,2}([aApP][Mm])?\\]")); @@ -391,17 +403,38 @@ } } - // Give a default port. - if (port == -1) { - if (protocol == "http") { - port = 80; - } else { - port = 21; - } - mport += port; - std::cout << "Port not found, assuming " << port << std::endl; + // Done. + } + + // Determine the protocol. + if (protocol.isEmpty()) { + if (textDump.contains("ftp", false)) { + protocol = "ftp"; + } else if (textDump.contains("http", false) || + textDump.contains("www.", false)) { + protocol = "http"; + } else { + // Fairly safe default.. + if (port == 80) + protocol = "http"; + else + protocol = "ftp"; + } + } + + // Give a default port. + if (port == -1) { + if (protocol == "http") { + port = 80; + } else { + port = 21; } + mport += port; + std::cout << "Port not found, assuming " << port << std::endl; + } + // http shouldn't have a user/pass by default. + if (protocol != "http") { // Give a default username. if (user.isEmpty()) { user = "anonymous"; @@ -411,12 +444,10 @@ // Give a default password. if (pass.isEmpty()) { - pass = "an...@an..."; + pass = "ano...@ex..."; mpass += pass; std::cout << "No password found. Assuming '" << pass << "'\n"; } - - // Done. } // Check for the possibility of multiple matches. @@ -466,12 +497,16 @@ } } - if (!host.isEmpty() && !user.isEmpty() && !pass.isEmpty() && (port != -1)) { + if (!host.isEmpty() && (port != -1)) { ret = new NHostInfo(); ret->setProtocol(protocol); ret->setHost(host); ret->setPort(port); - if ((protocol != "http") || (user != "anonymous")) { + if (!dirpath.isEmpty()) + ret->setPath(dirpath); + if (!filename.isEmpty()) + ret->setFileName(filename); + if (!user.isEmpty() || (user != "anonymous")) { ret->setUser(user); ret->setPassword(pass); } |
|
From: <nd...@us...> - 2004-02-19 02:31:59
|
Update of /cvsroot/nvemftp/nvemftp/contrib/tests/qtextdump In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7925 Modified Files: qtextdump.cpp Log Message: Add key bindings. Clear the buffer on verified success. Index: qtextdump.cpp =================================================================== RCS file: /cvsroot/nvemftp/nvemftp/contrib/tests/qtextdump/qtextdump.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- qtextdump.cpp 23 Nov 2003 07:10:39 -0000 1.2 +++ qtextdump.cpp 19 Feb 2004 02:21:54 -0000 1.3 @@ -32,8 +32,11 @@ { NHostInfo *test = NHostInfo::parseTextDump(in->text()); if (test) { + bool ok; QInputDialog::getText("URI Parsed", "Parsed URI:", QLineEdit::Normal, - test->toString()); + test->toString(), &ok); + if (ok) + in->clear(); } else { QMessageBox::information(this, "URI Failed To Parse", "The URI failed to parse with the given text dump.", "Ok"); } @@ -44,11 +47,9 @@ { if (e->key() == Key_U && (e->state() & ControlButton)) { this->clear(); - } else if (e->key() == Key_P && (e->state() & ControlButton)) { + } else if ((e->key() == Key_P || e->key() == Key_D) && (e->state() & ControlButton)) { emit parseIt(); - } else if (e->key() == Key_Q && (e->state() & ControlButton)) { - qApp->quit(); - } else if (e->key() == Key_Escape) { + } else if ((e->key() == Key_Escape) || (e->key() == Key_Q && (e->state() & ControlButton))) { qApp->quit(); } else { QTextEdit::keyPressEvent(e); |
|
From: <nd...@us...> - 2004-02-18 16:59:43
|
Update of /cvsroot/nvemftp/nvemftp/plugins/nftp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14046/plugins/nftp Modified Files: nftpdefoptions.h Log Message: Change anonymous address to nv...@ex... as per Peter H.S. <pet...@ya...>'s suggestions. Index: nftpdefoptions.h =================================================================== RCS file: /cvsroot/nvemftp/nvemftp/plugins/nftp/nftpdefoptions.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- nftpdefoptions.h 22 Sep 2003 20:51:49 -0000 1.2 +++ nftpdefoptions.h 18 Feb 2004 16:49:56 -0000 1.3 @@ -18,7 +18,7 @@ #define PROTOCOL_PREFIX "ftp" #define DEF_NFtp_PassiveXfer 0 -#define DEF_NFtp_AnonymousPassword "nv...@12..." +#define DEF_NFtp_AnonymousPassword "nv...@ex..." #define DEF_NFtp_ResumeGetRollback 32768 #define DEF_NFtp_Adv_RefillUploadBuffer (256*1024) #define DEF_NFtp_Adv_UploadBuffer (1024*1024) |
|
From: <nd...@us...> - 2004-02-04 22:37:56
|
Update of /cvsroot/nvemftp/nvemftp/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11263/include Modified Files: nqueue.h Log Message: Comment alignment. Index: nqueue.h =================================================================== RCS file: /cvsroot/nvemftp/nvemftp/include/nqueue.h,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- nqueue.h 1 Oct 2003 19:54:16 -0000 1.41 +++ nqueue.h 4 Feb 2004 22:35:30 -0000 1.42 @@ -140,7 +140,7 @@ private: int _id; ///< Id of the host connection. - NHostInfo _hostInfo; ///< Host Information. + NHostInfo _hostInfo; ///< Host Information. bool _inuse; ///< Is the queue item in progress? bool _done; ///< Is the queue item done? bool _failed; ///< Did something in the host fail? |
|
From: <nd...@us...> - 2004-02-03 04:41:39
|
Update of /cvsroot/nvemftp/nvemftp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4889 Modified Files: TODO Log Message: Updates of the TODO list by things pointed out by Peter H.S. <pet...@ya...>. Index: TODO =================================================================== RCS file: /cvsroot/nvemftp/nvemftp/TODO,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- TODO 27 Oct 2003 19:27:58 -0000 1.12 +++ TODO 3 Feb 2004 04:39:31 -0000 1.13 @@ -9,6 +9,14 @@ - Bug fixes. - Better error handling in NQueue/NNet interaction. +General: + - File overwrites/results should query the user about what to do. + ...depending on what the users settings specify to do. + - Partial downloads to be named as something different? + - Make it optional. (Required for single file multitreading?) + - Anonymous email address: change it to something invalid such + as nv...@ex... + NNet: - Move re-usable code from NFtp to NNet. - "Extended" operations, protocol specific. @@ -18,6 +26,7 @@ NFtp: - Timeouts for data connection openings and closing (from last data received). + - Make directory - Handle remote recursive deletions. - See about making sure abort returns an always usable connection. - Not always possible without reconnection due to some FTP daemons. @@ -33,6 +42,9 @@ - Do not *always* want to change them, if its an available network on the current machine, though. Perhaps if connection ip does not match the IP given in a PASV/PORT. + - RAW commands: Try to figure out what's going on so we can handle it nicely? + (ie make LIST and such do something expected?) + - Implement CDUP. Slightly different response than 'CD ..' NQueue: - Keep all statistics accurate for one queue execution session. @@ -64,11 +76,13 @@ - Visible feedback of current remote host(s). FtpView: + - Refresh lists more often. Currently the filesystems get out of sync quickly. - Symlinks: Special icon, show what it is referencing. - Handle Devices? - Different menus for local vs remote. - Lock user interaction when performing transfers. - Requires communication with NQueue/NNet. + - Grey out things that don't make sense. (RAW command for localhost) Future Classes/Tasks: - Module/Script system to execute upon file/directory/queue completion. @@ -79,10 +93,13 @@ - Bookmark/HostInfo system. - Allow for host-specific settings dependent on the protocol associated. - Passive/Active, max connections, min speed, max speed, timeouts, etc. + - Password storage - Commandline lookup for bookmarks, one-time modifications via other switches. - Text dump parsing. - Dump text with excess whitespace, IRC nicknames/timestamps, etc and parse it. - Basic parsability for labeled portions of the url (pass,login,port,etc). + - Searching/selection of files based on a RE/Glob filter + - Synchronization/comparison of directories. ----------------------- Completed |
|
From: <nd...@us...> - 2003-12-14 23:10:12
|
Update of /cvsroot/nvemftp/nvemftp/lib/nnet In directory sc8-pr-cvs1:/tmp/cvs-serv13927/lib/nnet Modified Files: nhostinfo.cpp Log Message: Re-arrange #includes Index: nhostinfo.cpp =================================================================== RCS file: /cvsroot/nvemftp/nvemftp/lib/nnet/nhostinfo.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- nhostinfo.cpp 23 Nov 2003 05:28:34 -0000 1.15 +++ nhostinfo.cpp 14 Dec 2003 23:10:09 -0000 1.16 @@ -6,14 +6,14 @@ * See COPYING for license information */ -#include <qmap.h> -#include <qdeepcopy.h> -#include "nhostinfo.h" - #ifdef QT_DEBUG # define HOSTINFO_PARSE # include <iostream> #endif + +#include <qmap.h> +#include <qdeepcopy.h> +#include "nhostinfo.h" #ifdef HOSTINFO_PARSE # include <qstringlist.h> |
|
From: <nd...@us...> - 2003-11-23 07:10:42
|
Update of /cvsroot/nvemftp/nvemftp/contrib/tests/qtextdump
In directory sc8-pr-cvs1:/tmp/cvs-serv14330/contrib/tests/qtextdump
Modified Files:
qtextdump.cpp
Log Message:
Ctrl+q to quit as well
Index: qtextdump.cpp
===================================================================
RCS file: /cvsroot/nvemftp/nvemftp/contrib/tests/qtextdump/qtextdump.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- qtextdump.cpp 23 Nov 2003 06:30:21 -0000 1.1
+++ qtextdump.cpp 23 Nov 2003 07:10:39 -0000 1.2
@@ -46,6 +46,8 @@
this->clear();
} else if (e->key() == Key_P && (e->state() & ControlButton)) {
emit parseIt();
+ } else if (e->key() == Key_Q && (e->state() & ControlButton)) {
+ qApp->quit();
} else if (e->key() == Key_Escape) {
qApp->quit();
} else {
|
|
From: <nd...@us...> - 2003-11-23 06:30:24
|
Update of /cvsroot/nvemftp/nvemftp/contrib/tests/qtextdump
In directory sc8-pr-cvs1:/tmp/cvs-serv10402
Added Files:
.cvsignore qtextdump.cpp qtextdump.h qtextdump.pro
Log Message:
Very minor GUI verion of textdump.
--- NEW FILE: .cvsignore ---
qtextdump
*.o
moc_*
Makefile
--- NEW FILE: qtextdump.cpp ---
#define HOSTINFO_PARSE
#include "nhostinfo.h"
#include "qtextdump.h"
#include <qapplication.h>
#include <qpushbutton.h>
#include <qmessagebox.h>
#include <qinputdialog.h>
#include <qlayout.h>
qTextDump::qTextDump()
{
in = new qTextDumpEdit( this );
QPushButton *parse = new QPushButton( "&Parse It!", this );
QPushButton *cancel = new QPushButton( "&Cancel", this );
cancel->setFocusPolicy( NoFocus );
connect( in, SIGNAL(parseIt()), this, SLOT(parseIt()) );
connect( parse, SIGNAL(clicked()), this, SLOT(parseIt()) );
connect( cancel, SIGNAL(clicked()), qApp, SLOT(quit()) );
QGridLayout *l = new QGridLayout( this, 2, 2, 5 );
l->addMultiCellWidget(in, 0, 0, 0, 1);
l->addWidget(parse, 1, 0);
l->addWidget(cancel, 1, 1);
in->setFocus();
}
void qTextDump::parseIt()
{
NHostInfo *test = NHostInfo::parseTextDump(in->text());
if (test) {
QInputDialog::getText("URI Parsed", "Parsed URI:", QLineEdit::Normal,
test->toString());
} else {
QMessageBox::information(this, "URI Failed To Parse", "The URI failed to parse with the given text dump.", "Ok");
}
delete test;
}
void qTextDumpEdit::keyPressEvent(QKeyEvent *e)
{
if (e->key() == Key_U && (e->state() & ControlButton)) {
this->clear();
} else if (e->key() == Key_P && (e->state() & ControlButton)) {
emit parseIt();
} else if (e->key() == Key_Escape) {
qApp->quit();
} else {
QTextEdit::keyPressEvent(e);
}
}
int main(int argc, char **argv)
{
QApplication a(argc, argv);
qTextDump q;
q.resize(400,200);
a.setMainWidget(&q);
q.setCaption("Text Dump URI Parser");
q.show();
return a.exec();
}
--- NEW FILE: qtextdump.h ---
#ifndef QTEXTDUMP_H
#define QTEXTDUMP_H
#include <qwidget.h>
#include <qtextedit.h>
class qTextDumpEdit : public QTextEdit
{
Q_OBJECT
public:
qTextDumpEdit(QWidget *parent = 0, const char *name = 0)
: QTextEdit(parent, name) {};
signals:
void parseIt();
protected:
virtual void keyPressEvent(QKeyEvent *e);
};
class qTextDump: public QWidget {
Q_OBJECT
public:
qTextDump();
private slots:
void parseIt();
private:
qTextDumpEdit *in;
};
#endif
--- NEW FILE: qtextdump.pro ---
TEMPLATE = app
# Input
HEADERS += qtextdump.h
SOURCES += qtextdump.cpp
INCLUDEPATH += ../../../include
LIBS += -rdynamic
LIBS += -L../../../lib/nnet -lnnet
LANGUAGE = C++
CONFIG += qt warn_on debug thread
MOC_DIR = .
QMAKE_CXXFLAGS_DEBUG += -fPIC
QMAKE_CXXFLAGS_RELEASE += -fPIC
TARGET = qtextdump
|
|
From: <nd...@us...> - 2003-11-23 06:29:44
|
Update of /cvsroot/nvemftp/nvemftp/contrib/tests/qtextdump In directory sc8-pr-cvs1:/tmp/cvs-serv10297/qtextdump Log Message: Directory /cvsroot/nvemftp/nvemftp/contrib/tests/qtextdump added to the repository |
|
From: <nd...@us...> - 2003-11-23 05:28:37
|
Update of /cvsroot/nvemftp/nvemftp/lib/nnet
In directory sc8-pr-cvs1:/tmp/cvs-serv3666/lib/nnet
Modified Files:
nhostinfo.cpp
Log Message:
Use a temporary variable before doing a .replace()
Index: nhostinfo.cpp
===================================================================
RCS file: /cvsroot/nvemftp/nvemftp/lib/nnet/nhostinfo.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- nhostinfo.cpp 23 Nov 2003 05:09:21 -0000 1.14
+++ nhostinfo.cpp 23 Nov 2003 05:28:34 -0000 1.15
@@ -225,13 +225,13 @@
QUrl url(orig);
protocol = url.protocol();
host = url.host();
-mhost += host;
+ mhost += host;
port = url.port();
-mport += port;
+ mport += port;
user = url.user();
-muser += user;
+ muser += user;
pass = url.password();
-mpass += pass;
+ mpass += pass;
std::cout << "Orig: '" << orig << "'\n"
<< "URI: " << url.toString() << "\n"
<< "User: " << url.user() << "\n"
@@ -342,7 +342,8 @@
// Scan for port values in host:port notation.
for (uint i = 0; i < mhost.count(); i++) {
- rg.setPattern(mhost[i].replace(".", "\\.") + ":(\\d+)[^0-9A-Za-z]");
+ QString thost = mhost[i];
+ rg.setPattern(thost.replace(".", "\\.") + ":(\\d+)[^0-9A-Za-z]");
pos = 0;
while ((pos = rg.search(textDump, pos)) != -1) {
int posport = rg.cap(1).toInt();
|
|
From: <nd...@us...> - 2003-11-23 05:09:24
|
Update of /cvsroot/nvemftp/nvemftp/lib/nnet
In directory sc8-pr-cvs1:/tmp/cvs-serv941/lib/nnet
Modified Files:
nhostinfo.cpp
Log Message:
Significant rewrite of parseTextDump().
-- Now passes all 17 trials.
-- Ignores user/pass combos for users such as 'look', 'guest', and 'upload' unless there is no better alternative.
-- It is now destructive to the string, so make it pass-by-value.
Index: nhostinfo.cpp
===================================================================
RCS file: /cvsroot/nvemftp/nvemftp/lib/nnet/nhostinfo.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- nhostinfo.cpp 23 Nov 2003 00:03:14 -0000 1.13
+++ nhostinfo.cpp 23 Nov 2003 05:09:21 -0000 1.14
@@ -207,13 +207,15 @@
#ifdef HOSTINFO_PARSE
-NHostInfo *NHostInfo::parseTextDump(const QString &dump)
+NHostInfo *NHostInfo::parseTextDump(QString textDump)
{
- QString textDump = dump;
NHostInfo *ret = NULL;
QString host, user, pass, protocol;
int port = -1;
+ QStringList mhost, muser, mpass;
+ QValueList<int> mport;
+
QRegExp urg("\\b[A-Za-z]{1,}://[^\\s]*");
int pos;
if ((pos = urg.search(textDump)) != -1) {
@@ -223,9 +225,13 @@
QUrl url(orig);
protocol = url.protocol();
host = url.host();
+mhost += host;
port = url.port();
+mport += port;
user = url.user();
+muser += user;
pass = url.password();
+mpass += pass;
std::cout << "Orig: '" << orig << "'\n"
<< "URI: " << url.toString() << "\n"
<< "User: " << url.user() << "\n"
@@ -234,153 +240,141 @@
<< "Host: " << url.host() << std::endl;
} else {
// Strip out the timestamping if it exists.
- urg.setPattern("^[\\s]{0,}\\[[\\d]{1,2}:[\\d]{1,2}([aApP][Mm])?\\]");
- if ( (pos = urg.search(textDump)) != -1 ) {
- std::cout << "Timestamp found with pos = " << pos << " and length = " << urg.matchedLength() << std::endl;
- textDump = textDump.remove(pos,urg.matchedLength());
- }
+ textDump = textDump.remove(QRegExp("^[\\s]{0,}\\[[\\d]{1,2}:[\\d]{1,2}([aApP][Mm])?\\]"));
- QStringList strings = QStringList::split(QRegExp("[][}{ \t:=]"), textDump);
-
- for (uint i = 0; i < strings.count(); i++) {
- // If theres more parameters remaining..
- if (strings.count() > (i+1)) {
- if ( host.isEmpty() &&
- strings[i].contains(
- QRegExp("^[^A-Za-z0-9]*([Ii][Pp]|[Hh]([Oo][Ss][Tt])?)[^A-Za-z0-9]*$")
- )
- && strings[i+1].contains('.')
- ) {
- if (strings[i+1].mid(strings[i+1].findRev(".")+1).contains(QRegExp("[0-9]"))) {
- // Must be an IP if it trails with numbers.
- QHostAddress addr;
- if (addr.setAddress(strings[i+1])) {
- std::cout << "Valid Host IP found! '" << strings[i+1] << "'" << std::endl;
- host = strings[i+1];
- } else {
- std::cout << "Invalid Address - Skipped.\n";
- }
- } else {
- if (strings[i+1].contains(QRegExp("^([A-Za-z0-9-]{1,64}\\.)+[A-Za-z]{1,}$"))) {
- host = strings[i+1];
- std::cout << "Host entry found: " << host << std::endl;
- } else {
- std::cout << "Invalid Address '" << strings[i+1] << "' - Skipped.\n";
- }
- }
- } else if ( (port == -1) && strings[i].contains(
- QRegExp("^[^A-Za-z0-9]*[Pp][Oo][Rr][Tt][^A-Za-z0-9]*$")
- )) {
- int test = strings[i+1].toInt();
- if ((test > 0) && (test < 65536)) {
- port = test;
- std::cout << "Port entry found! Port: " << test << std::endl;
- }
- } else if (
- user.isEmpty() &&
- strings[i].contains(
- QRegExp("^[^A-Za-z0-9]*([Uu]([Ss][Ee][Rr]([Nn][Aa][Mm][Ee])?)?|[Ll]([Oo][Gg]([Ii][Nn])?)?)[^A-Za-z0-9]*$")
- )
- ) {
- user = strings[i+1];
- std::cout << "Username entry found! User: " << user << std::endl;
- } else if (
- pass.isEmpty() &&
- strings[i].contains(
- QRegExp("^[^A-Za-z0-9]*[Pp][Aa][Ss][Ss]([Ww][Oo][Rr][Dd])?[^A-Za-z0-9]*$")
- )) {
- pass = strings[i+1];
- std::cout << "Password entry found! Pass: " << pass << std::endl;
- } else if (
- (pass.isEmpty() || (port == -1)) &&
- strings[i].contains(
- QRegExp("^[^A-Za-z0-9]*[Pp][^A-Za-z0-9]*$")
- )) {
- int test = strings[i+1].toInt();
- if ((port == -1) && (test > 0) && (test < 65536)) {
- port = test;
- std::cout << "Port entry found! Port: " << test << std::endl;
- } else if (pass.isEmpty()) {
- // Assume it is a password.
- pass = strings[i+1];
- std::cout << "Password entry found! Pass: " << pass << std::endl;
- }
- }
+ int pos;
+ QRegExp rg;
+ QHostAddress ad;
+
+ // Scan for explicit port declarations.
+ rg.setPattern("[^A-Za-z0-9][Pp]([Oo][Rr][Tt])?[^A-Za-z0-9]*(\\d+)[^A-Za-z0-9]");
+ pos = 0;
+ while ((pos = rg.search(textDump, pos)) != -1) {
+ int posport = rg.cap(2).toInt();
+ if (posport > 0 && posport < 65535) {
+ port = posport;
+ mport += port;
+ std::cout << "Found port = " << port << std::endl;
+
+ textDump = textDump.replace(pos, rg.matchedLength(), " ");
+ pos = 0;
} else {
+ pos += rg.matchedLength();
}
}
-
- if (host.isEmpty()) {
- // Scan for words with periods in them.
- QRegExp rg;
- QStringList possible;
-
- rg.setPattern("[1-9][0-9]{0,2}\\.[0-9]{0,3}\\.[0-9]{0,3}\\.[0-9]{0,3}");
- possible = strings.grep(rg);
- if (possible.count()) {
- for (uint i = 0; i < possible.count(); i++) {
- QHostAddress ad;
- if (ad.setAddress(possible[i])) {
- host = possible[i];
- std::cout << "Valid IPv4 found: " << host << std::endl;
- break;
- }
- }
- }
- if (host.isEmpty()) {
- rg.setPattern("[0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4}");
- int pos;
- if ( (pos = rg.search(textDump)) != -1 ) {
- host = textDump.mid(pos,rg.matchedLength());
- std::cout << "Valid IPv6 found: " << host << std::endl;
- } else {
- rg.setPattern("^([A-Za-z0-9-]{1,64}\\.)+[A-Za-z]{1,}$");
- possible = strings.grep(rg);
- if (possible.count()) {
- host = possible[0];
- std::cout << "First host match: " << host << std::endl;
- } else {
- // All trees exhausted.
- std::cout << "Unable to determine hostname." << std::endl;
- }
- }
+
+ // Check for [login/pass]
+ rg.setPattern("\\b([A-Za-z0-9@_-]+)/([A-Za-z0-9@_-]+)\\b");
+ pos = 0;
+ while ((pos = rg.search(textDump, pos)) != -1) {
+ if (
+ !rg.cap(1).contains(
+ QRegExp("^([Ll]([Oo][Gg][Ii][Nn])?|[Uu]([Ss][Ee][Rr]([Nn][Aa][Mm][Ee])?)?)$")
+ )
+ && !rg.cap(2).contains(
+ QRegExp("^[Pp]([Aa][Ss][Ss]([Ww][Oo][Rr][Dd])?)?$")
+ )
+ ) {
+ user = rg.cap(1);
+ muser += user;
+ pass = rg.cap(2);
+ mpass += pass;
+ std::cout << "Found user = '" << user
+ << "' and pass = '" << pass << "'" << std::endl;
}
- } // End host.isEmpty()
+ textDump = textDump.replace(pos, rg.matchedLength(), " ");
+ pos = 0;
+ }
- if (user.isEmpty() && pass.isEmpty()) {
- QRegExp rg("\\b([A-Za-z0-9@_-]+)/([A-Za-z0-9@_-]+)\\b");
- int pos = 0;
- while ((pos = rg.search(textDump, pos)) != -1) {
- pos += rg.matchedLength();
- if (
- !rg.cap(1).contains(QRegExp("^([Ll]([Oo][Gg][Ii][Nn])?|[Uu]([Ss][Ee][Rr]([Nn][Aa][Mm][Ee])?)?)$"))
- && !rg.cap(2).contains(QRegExp("^[Pp]([Aa][Ss][Ss]([Ww][Oo][Rr][Dd])?)?$"))
- ) {
- user = rg.cap(1);
- pass = rg.cap(2);
- std::cout << "Found user = '" << user << "' and pass = '" << pass << "'" << std::endl;
- break;
- }
+ // Scan for usernames.
+ rg.setPattern("\\b([Uu]([Ss][Ee][Rr]([Nn][Aa][Mm][Ee])?)?|[Ll]([Oo][Gg]([Ii][Nn])?)?)[^A-Za-z0-9]+([A-Za-z0-9@_-]+)");
+ pos = 0;
+ while ((pos = rg.search(textDump, pos)) != -1) {
+ user = rg.cap(6);
+ muser += user;
+ std::cout << "Found user = " << user << std::endl;
+ textDump = textDump.replace(pos, rg.matchedLength(), " ");
+ pos = 0;
+ }
+
+ // Scan for passwords.
+ rg.setPattern("[^A-Za-z0-9][Pp]([Aa][Ss][Ss]([Ww][Oo][Rr][Dd])?)?[^A-Za-z0-9]+([A-Za-z0-9@_-]+)");
+ pos = 0;
+ while ((pos = rg.search(textDump, pos)) != -1) {
+ pass = rg.cap(3);
+ mpass += pass;
+ std::cout << "Found pass = " << pass << std::endl;
+ textDump = textDump.replace(pos, rg.matchedLength(), " ");
+ pos = 0;
+ }
+
+ // Scan for IPv4 addresses.
+ rg.setPattern("[1-9][0-9]{0,2}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}");
+ pos = 0;
+ while ((pos = rg.search(textDump, pos)) != -1) {
+ if (ad.setAddress(textDump.mid(pos, rg.matchedLength()))) {
+ host = textDump.mid(pos, rg.matchedLength());
+ mhost += host;
+ std::cout << "Valid IPv4 found: " << host << std::endl;
}
+ pos += rg.matchedLength();
}
- if (user.isEmpty()) {
- user = "anonymous";
- std::cout << "No username found. Assuming '" << user << "'\n";
- if (pass.isEmpty()) {
- pass = "an...@an...";
- std::cout << "No password found. Assuming '" << pass << "'\n";
+ // Scan for IPv6 addresses.
+ rg.setPattern("[0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4}");
+ pos = 0;
+ while ( (pos = rg.search(textDump, pos)) != -1 ) {
+ pos += rg.matchedLength();
+ host = textDump.mid(pos,rg.matchedLength());
+ mhost += host;
+ std::cout << "Valid IPv6 found: " << host << std::endl;
+ }
+
+ // Scan for hostnames.
+ rg.setPattern("[^A-Za-z0-9\\.](([A-Za-z0-9-]{1,64}\\.)+[A-Za-z]{1,})[^A-Za-z]");
+ pos = 0;
+ while ((pos = rg.search(textDump, pos)) != -1) {
+ pos += rg.matchedLength();
+ host = rg.cap(1); //textDump.mid(pos, rg.matchedLength());
+ mhost += host;
+ std::cout << "Possible Hostname: " << host << std::endl;
+ }
+
+ // Scan for port values in host:port notation.
+ for (uint i = 0; i < mhost.count(); i++) {
+ rg.setPattern(mhost[i].replace(".", "\\.") + ":(\\d+)[^0-9A-Za-z]");
+ pos = 0;
+ while ((pos = rg.search(textDump, pos)) != -1) {
+ int posport = rg.cap(1).toInt();
+ if (posport > 0 && posport < 65535) {
+ port = posport;
+ mport += port;
+ std::cout << "Found port = " << port << std::endl;
+
+ textDump = textDump.replace(pos, rg.matchedLength(), " ");
+ pos = 0;
+ } else {
+ pos += rg.matchedLength();
+ }
}
}
+ // Scan for implicit port declarations (Last Resort).
if (port == -1) {
- QRegExp rg("(\\s[^0-9A-Za-z]?|[A-Za-z0-9]{1,1}:|\\b[Pp][^A-Za-z0-9]?)(\\d+)[^0-9A-Za-z]?\\s");
- if (rg.search(textDump) != -1) {
- port = rg.cap(2).toInt();
- std::cout << "Found port = " << port << std::endl;
+ rg.setPattern("\\s[^A-Za-z0-9\\.]+(\\d+)[^0-9A-Za-z]+\\s");
+ pos = 0;
+ while ((pos = rg.search(textDump, pos)) != -1) {
+ pos += rg.matchedLength();
+ int posport = rg.cap(1).toInt();
+ if (posport > 0 && posport < 65535) {
+ port = posport;
+ mport += port;
+ std::cout << "Found implicit port = " << port << std::endl;
+ }
}
}
+ // Determine the protocol.
if (protocol.isEmpty()) {
if (textDump.contains("ftp", false)) {
protocol = "ftp";
@@ -396,17 +390,79 @@
}
}
+ // Give a default port.
if (port == -1) {
- // Best guess default..
if (protocol == "http") {
port = 80;
} else {
port = 21;
}
+ mport += port;
std::cout << "Port not found, assuming " << port << std::endl;
}
+ // Give a default username.
+ if (user.isEmpty()) {
+ user = "anonymous";
+ muser += user;
+ std::cout << "No username found. Assuming '" << user << "'\n";
+ }
+
+ // Give a default password.
+ if (pass.isEmpty()) {
+ pass = "an...@an...";
+ mpass += pass;
+ std::cout << "No password found. Assuming '" << pass << "'\n";
+ }
+
// Done.
+ }
+
+ // Check for the possibility of multiple matches.
+ if (mhost.count() > 1) {
+ std::cout << "Multiple Hosts!\n";
+ // TODO: Validate via DNS?
+
+ // For now, the first host wins.
+ host = mhost.front();
+ }
+
+ if (mport.count() > 1) {
+ std::cout << "Multiple Ports\n";
+
+ // Known ports win, first port otherwise.
+ if (mport.contains(21) != 0) {
+ port = 21;
+ } else if (mport.contains(80) != 0) {
+ port = 80;
+ } else {
+ port = mport.front();
+ }
+ }
+
+ if (muser.count() != mpass.count()) {
+ std::cout << "Username count doesn't match Password count!\n";
+ } else {
+ // Make the (bad) assumption that the indexes for usernames and passwords match.
+
+ // We want to essentially ignore usernames such as 'look', 'guest',
+ // and 'upload', unless there are no other alternatives.
+ QRegExp rg("(look|guest|upload)");
+ rg.setCaseSensitive(false);
+ QStringList ignores = muser.grep(rg);
+ if (ignores.count() == muser.count()) {
+ // No others, use the first.
+ user = muser[0];
+ pass = mpass[0];
+ } else {
+ // Find the last non-match.
+ for (uint i = 0; i < muser.count(); i++) {
+ if (!ignores.contains(muser[i])) {
+ user = muser[i];
+ pass = mpass[i];
+ }
+ }
+ }
}
if (!host.isEmpty() && !user.isEmpty() && !pass.isEmpty() && (port != -1)) {
|
|
From: <nd...@us...> - 2003-11-23 05:09:24
|
Update of /cvsroot/nvemftp/nvemftp/include
In directory sc8-pr-cvs1:/tmp/cvs-serv941/include
Modified Files:
nhostinfo.h
Log Message:
Significant rewrite of parseTextDump().
-- Now passes all 17 trials.
-- Ignores user/pass combos for users such as 'look', 'guest', and 'upload' unless there is no better alternative.
-- It is now destructive to the string, so make it pass-by-value.
Index: nhostinfo.h
===================================================================
RCS file: /cvsroot/nvemftp/nvemftp/include/nhostinfo.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- nhostinfo.h 13 Oct 2003 20:29:32 -0000 1.10
+++ nhostinfo.h 23 Nov 2003 05:09:21 -0000 1.11
@@ -94,7 +94,7 @@
* Basically a 'best-guess' based on the input.
* \returns New NHostInfo object, or NULL on error.
*/
- static NHostInfo* parseTextDump(const QString &textDump);
+ static NHostInfo* parseTextDump(QString textDump);
#endif
private:
|
|
From: <nd...@us...> - 2003-11-23 05:06:47
|
Update of /cvsroot/nvemftp/nvemftp/contrib/tests/textdump In directory sc8-pr-cvs1:/tmp/cvs-serv842 Modified Files: trials Log Message: Add another trial Index: trials =================================================================== RCS file: /cvsroot/nvemftp/nvemftp/contrib/tests/textdump/trials,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- trials 23 Nov 2003 00:03:14 -0000 1.4 +++ trials 23 Nov 2003 05:06:44 -0000 1.5 @@ -14,3 +14,4 @@ [03:23] <Raid-> [The OutHouse] [205.240.35.11] [21] [leech/Yc120FcL] 128.0.1.2:43 l:hi p:blah [123.2.3.1] [24] [blah/hi] +[06:53] <[418-Aw]> =(FTP Online)= [418] Ftp !!! Host «64.228.77.171» Port «21» Login «mp3» Pass «mp3» Note «Upload Please !!!!!» =(ak FTP-Ad)= |
|
From: <nd...@us...> - 2003-11-23 00:03:17
|
Update of /cvsroot/nvemftp/nvemftp/lib/nnet
In directory sc8-pr-cvs1:/tmp/cvs-serv25620/lib/nnet
Modified Files:
nhostinfo.cpp
Log Message:
Text Dump Parsing changes..
-- Now extracts ports much more frequently.
-- Detects http protocol more smartly.
-- Don't give http urls a user/pass if user == anonymous
-- Moved some logic around to allow detections to benefit eachother
-- Strip a timestamp if it's the first thing present
in \[[0-9]{1,2}:[0-9][0-9]{1,2}([AaPp][Mm])?\] format
-- Add more trials
Index: nhostinfo.cpp
===================================================================
RCS file: /cvsroot/nvemftp/nvemftp/lib/nnet/nhostinfo.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- nhostinfo.cpp 13 Oct 2003 20:29:33 -0000 1.12
+++ nhostinfo.cpp 23 Nov 2003 00:03:14 -0000 1.13
@@ -207,8 +207,9 @@
#ifdef HOSTINFO_PARSE
-NHostInfo *NHostInfo::parseTextDump(const QString &textDump)
+NHostInfo *NHostInfo::parseTextDump(const QString &dump)
{
+ QString textDump = dump;
NHostInfo *ret = NULL;
QString host, user, pass, protocol;
int port = -1;
@@ -232,6 +233,12 @@
<< "Port: " << url.port() << "\n"
<< "Host: " << url.host() << std::endl;
} else {
+ // Strip out the timestamping if it exists.
+ urg.setPattern("^[\\s]{0,}\\[[\\d]{1,2}:[\\d]{1,2}([aApP][Mm])?\\]");
+ if ( (pos = urg.search(textDump)) != -1 ) {
+ std::cout << "Timestamp found with pos = " << pos << " and length = " << urg.matchedLength() << std::endl;
+ textDump = textDump.remove(pos,urg.matchedLength());
+ }
QStringList strings = QStringList::split(QRegExp("[][}{ \t:=]"), textDump);
@@ -321,7 +328,7 @@
}
}
if (host.isEmpty()) {
- rg.setPattern("(.*)[0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4}");
+ rg.setPattern("[0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4}:[0-9A-Fa-f]{0,4}");
int pos;
if ( (pos = rg.search(textDump)) != -1 ) {
host = textDump.mid(pos,rg.matchedLength());
@@ -346,8 +353,8 @@
while ((pos = rg.search(textDump, pos)) != -1) {
pos += rg.matchedLength();
if (
- !rg.cap(1).contains(QRegExp("^([Ll]|[Uu])$"))
- && !rg.cap(2).contains(QRegExp("^[Pp]$"))
+ !rg.cap(1).contains(QRegExp("^([Ll]([Oo][Gg][Ii][Nn])?|[Uu]([Ss][Ee][Rr]([Nn][Aa][Mm][Ee])?)?)$"))
+ && !rg.cap(2).contains(QRegExp("^[Pp]([Aa][Ss][Ss]([Ww][Oo][Rr][Dd])?)?$"))
) {
user = rg.cap(1);
pass = rg.cap(2);
@@ -355,43 +362,48 @@
break;
}
}
+ }
- if (user.isEmpty() && pass.isEmpty()) {
- user = "anonymous";
+ if (user.isEmpty()) {
+ user = "anonymous";
+ std::cout << "No username found. Assuming '" << user << "'\n";
+ if (pass.isEmpty()) {
pass = "an...@an...";
+ std::cout << "No password found. Assuming '" << pass << "'\n";
+ }
+ }
+
+ if (port == -1) {
+ QRegExp rg("(\\s[^0-9A-Za-z]?|[A-Za-z0-9]{1,1}:|\\b[Pp][^A-Za-z0-9]?)(\\d+)[^0-9A-Za-z]?\\s");
+ if (rg.search(textDump) != -1) {
+ port = rg.cap(2).toInt();
+ std::cout << "Found port = " << port << std::endl;
}
}
if (protocol.isEmpty()) {
if (textDump.contains("ftp", false)) {
protocol = "ftp";
- } else if (textDump.contains("http", false)) {
+ } else if (textDump.contains("http", false) ||
+ textDump.contains("www.", false)) {
protocol = "http";
} else {
// Fairly safe default..
- protocol = "ftp";
+ if (port == 80)
+ protocol = "http";
+ else
+ protocol = "ftp";
}
}
if (port == -1) {
- QRegExp rg("\\b[Pp](\\d+)[.]?[\\s]+");
- if (rg.search(textDump) != -1) {
- port = rg.cap(1).toInt();
- std::cout << "Found port = " << port << std::endl;
+ // Best guess default..
+ if (protocol == "http") {
+ port = 80;
} else {
- rg.setPattern("[\\s:]+(\\d+)[.]?[\\s]+");
- if (rg.search(textDump) != -1) {
- port = rg.cap(1).toInt();
- std::cout << "Found port = " << port << std::endl;
- } else {
- // Best guess default..
- if (protocol == "http") {
- port = 80;
- } else {
- port = 21;
- }
- }
+ port = 21;
}
+ std::cout << "Port not found, assuming " << port << std::endl;
}
// Done.
@@ -402,8 +414,10 @@
ret->setProtocol(protocol);
ret->setHost(host);
ret->setPort(port);
- ret->setUser(user);
- ret->setPassword(pass);
+ if ((protocol != "http") || (user != "anonymous")) {
+ ret->setUser(user);
+ ret->setPassword(pass);
+ }
}
return ret;
|
|
From: <nd...@us...> - 2003-11-23 00:03:17
|
Update of /cvsroot/nvemftp/nvemftp/contrib/tests/textdump
In directory sc8-pr-cvs1:/tmp/cvs-serv25620/contrib/tests/textdump
Modified Files:
trials
Log Message:
Text Dump Parsing changes..
-- Now extracts ports much more frequently.
-- Detects http protocol more smartly.
-- Don't give http urls a user/pass if user == anonymous
-- Moved some logic around to allow detections to benefit eachother
-- Strip a timestamp if it's the first thing present
in \[[0-9]{1,2}:[0-9][0-9]{1,2}([AaPp][Mm])?\] format
-- Add more trials
Index: trials
===================================================================
RCS file: /cvsroot/nvemftp/nvemftp/contrib/tests/textdump/trials,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- trials 11 Oct 2003 17:57:58 -0000 1.3
+++ trials 23 Nov 2003 00:03:14 -0000 1.4
@@ -5,11 +5,12 @@
[-host-:127.0.0.1] [+port+:21] [=user=:joe] [_pass_:schmoe]
ftp://user:pass@127.0.0.1:21
tes*t.com Check.asu.?%test www.test.com coo.
-host tes*t.com host Check.asu.?%test
-host 256.266.255.255 port 70000 user joe pass anon
myhost:127.3.2.3 {pass:23.myhost.com} theport : 543. 2
Try this one: ftp://user:pass@127.0.0.1:21 It's fun!
[09:33] <`934-8777> XeXyZ's ftp of fat chick porn (and mp3's too) is up at 12.229.187.117 arapunks/fuckbetter on port 22. Site will ban you if not in channel or using a cservice host. Don't fuckin msg me about it.
[09:47] <Go|dg0n3> Go|d0ch3 Ftp's up...Enjoy!! 67.70.166.46 Login: Punk Password: Mp3 Port: 21 -=i'm not a bot don't "xdcc list" me you fucking fuck=-
[10:24] <Raid-> The OutHouse ip: 205.240.35.11 p21 l:leech p:475try3625 or (to look only: look/seethis) (upload/upload to er, upload)- Set retries to 120+! Requesting: Styx, Janis Joplin, Steppenwolf albums
[10:07] <stonehold> FTP Online stonehold.no-ip.com:21 l/p:mp3ftp/mp3ftp Max users:?2 users? Bandwidth:?DSL? MOTD:?Also use look/look.? ?I-n-v-i-s-i-o-n?
+[03:23] <Raid-> [The OutHouse] [205.240.35.11] [21] [leech/Yc120FcL]
+128.0.1.2:43 l:hi p:blah
+[123.2.3.1] [24] [blah/hi]
|
|
From: <nd...@us...> - 2003-10-27 19:34:28
|
Update of /cvsroot/nvemftp/nvemftp
In directory sc8-pr-cvs1:/tmp/cvs-serv31469
Modified Files:
ChangeLog TODO
Log Message:
TODO/ChangeLog Update
Index: ChangeLog
===================================================================
RCS file: /cvsroot/nvemftp/nvemftp/ChangeLog,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- ChangeLog 21 Sep 2003 07:08:26 -0000 1.20
+++ ChangeLog 27 Oct 2003 19:27:58 -0000 1.21
@@ -1,7 +1,9 @@
nvemFTP Release ChangeLog:
* nvemFTP 0.1.4
- -
+ - Host Profile (Bookmark) Manager
+ - Pre-scan plugins directory for NNet modules at load.
+ - User definable location, with a compile-time default.
* nvemFTP 0.1.3
- Fix possible compile problems by adding 'thread' to the CONFIG declaration.
Index: TODO
===================================================================
RCS file: /cvsroot/nvemftp/nvemftp/TODO,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- TODO 21 Sep 2003 07:08:26 -0000 1.11
+++ TODO 27 Oct 2003 19:27:58 -0000 1.12
@@ -53,8 +53,6 @@
- Stop aborts current transfers and stops queue execution.
NNetPluginManager:
- - Pre-loading of all protocol modules in a specified directory.
- Dynamically definable, with a compile-time default.
- See NNet's description of "Extended" Operations.
nvemFTP:
@@ -85,3 +83,11 @@
- Text dump parsing.
- Dump text with excess whitespace, IRC nicknames/timestamps, etc and parse it.
- Basic parsability for labeled portions of the url (pass,login,port,etc).
+
+-----------------------
+Completed
+-----------------------
+NNetPluginManager:
+ - Pre-loading of all protocol modules in a specified directory.
+ Dynamically definable, with a compile-time default.
+ -- Done 10/15/2003
|
|
From: <nd...@us...> - 2003-10-15 18:21:21
|
Update of /cvsroot/nvemftp/nvemftp/include
In directory sc8-pr-cvs1:/tmp/cvs-serv14148/include
Modified Files:
nnetplugin.h
Log Message:
Fix the module loading on demand
Index: nnetplugin.h
===================================================================
RCS file: /cvsroot/nvemftp/nvemftp/include/nnetplugin.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- nnetplugin.h 13 Oct 2003 20:29:33 -0000 1.11
+++ nnetplugin.h 15 Oct 2003 18:20:25 -0000 1.12
@@ -63,9 +63,6 @@
/// Scan a directory for plugins and attempt to load them.
static int scanPlugins(QString dir);
- /// Load the plugin with the basename <i>modulename</i>. Also checks the module's version information with the program's, and sets up a moduleInfo for the plugin.
- static int load_module(const QString &modulename);
-
/// Retrieves a NNet object from the plugin with the basename <i>modulename</i> giving it an id of <i>id</i>. The plugin will be loaded if it is not already.
static NNet* getObject(const QString &modulename, int id);
@@ -76,6 +73,9 @@
static QMap<QString, NNetPluginManager::moduleInfo> getList();
private:
+ /// Load the plugin with the basename <i>modulename</i>. Also checks the module's version information with the program's, and sets up a moduleInfo for the plugin.
+ static int load_module(const QString &modulename);
+
/// Dictionary of the NNetPlugin objects representing loaded plugins.
static QDict<NNetPlugin> n_dict;
|
|
From: <nd...@us...> - 2003-10-15 18:20:54
|
Update of /cvsroot/nvemftp/nvemftp/src
In directory sc8-pr-cvs1:/tmp/cvs-serv14148/src
Modified Files:
nnetplugin.cpp nqueue.cpp
Log Message:
Fix the module loading on demand
Index: nnetplugin.cpp
===================================================================
RCS file: /cvsroot/nvemftp/nvemftp/src/nnetplugin.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- nnetplugin.cpp 13 Oct 2003 20:29:34 -0000 1.14
+++ nnetplugin.cpp 15 Oct 2003 18:20:26 -0000 1.15
@@ -99,6 +99,7 @@
ret = -3;
else {
for (int i = (pluginDir.count() - 1); i >= 0; --i) {
+ // TODO: #ifdef this for windows
if (!pluginDir[i].contains(".so") && !pluginDir[i].contains(".dll"))
continue;
@@ -123,29 +124,29 @@
QString fullname = modulename;
char *prefix, *name, *desc;
int version;
+ NNetPlugin *plug = NULL;
- if (n_dict.find(modulename) == 0)
- {
- QString filter = ".so";
- if ( fullname.find(filter) == -1 ) {
- const int x = fullname.findRev( "/" );
- if ( x != -1 ) {
- QString path = fullname.left( x + 1 );
- QString file = fullname.right( fullname.length() - x - 1 );
- fullname = QString( "%1lib%2%3" ).arg( path ).arg( file ).arg( filter );
- } else {
- fullname = QString( "lib%1%2" ).arg( fullname ).arg( filter );
- }
+ // TODO: #ifdef this for windows
+ QString filter = ".so";
+ if ( fullname.find(filter) == -1 ) {
+ const int x = fullname.findRev( "/" );
+ if ( x != -1 ) {
+ QString path = fullname.left( x + 1 );
+ QString file = fullname.right( fullname.length() - x - 1 );
+ fullname = QString( "%1libn%2%3" ).arg( path ).arg( file ).arg( filter );
+ } else {
+ fullname = QString( "libn%1%2" ).arg( fullname ).arg( filter );
}
-
- n_dict.insert(modulename, new NNetPlugin(fullname));
- n_dict[modulename]->setAutoUnload(true);
}
- if (n_dict[modulename]->init_module(&prefix, &name, &desc, &version) == 0) {
+ plug = new NNetPlugin(fullname);
+ plug->setAutoUnload(true);
+
+ if (plug->init_module(&prefix, &name, &desc, &version) == 0) {
#ifdef QT_DEBUG
std::cerr << "NNetPluginManager::load_module(): Failed to load module: " << modulename << std::endl;
#endif
+ delete plug;
return -1;
}
@@ -153,16 +154,26 @@
#ifdef QT_DEBUG
std::cerr << "NNetPluginManager::load_module(): Failed to load module: " << modulename << "\nModule version: " << version << " Our version: " << CurrentVersion << std::endl;
#endif
+ delete plug;
return -2;
}
- n_map[modulename].prefix = prefix;
- n_map[modulename].name = name;
- n_map[modulename].desc = desc;
-
+ // Check if we already handle this protocol.
+ if (n_dict.find(prefix) == 0) {
+ n_dict.insert(prefix, plug);
+ n_map[modulename].prefix = prefix;
+ n_map[modulename].name = name;
+ n_map[modulename].desc = desc;
#ifdef QT_DEBUG
- std::cerr << "NNetPluginManager::load_module(): Loaded module " << modulename << ". [" << n_map[modulename].name << "]\n";
+ std::cerr << "NNetPluginManager::load_module(): Loaded module " << modulename << ". [" << n_map[modulename].name << "] Handles: " << prefix << "\n";
#endif
+ } else {
+ delete plug;
+#ifdef QT_DEBUG
+ std::cerr << "NNetPluginManager::load_module(): Failed to load module '" << modulename << "': Protocol Already Handled." << std::endl;
+#endif
+ return -3;
+ }
return 0;
}
Index: nqueue.cpp
===================================================================
RCS file: /cvsroot/nvemftp/nvemftp/src/nqueue.cpp,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -d -r1.57 -r1.58
--- nqueue.cpp 13 Oct 2003 20:29:34 -0000 1.57
+++ nqueue.cpp 15 Oct 2003 18:20:27 -0000 1.58
@@ -884,7 +884,7 @@
if (side == NQueue::Other)
return 0;
- ret = NNetPluginManager::getObject("n" + protocol, (side-2));
+ ret = NNetPluginManager::getObject(protocol, (side-2));
if (ret != 0) {
if (side == NQueue::Left) {
@@ -1471,7 +1471,7 @@
}
// Create a new NNet and allocate it
- int freeNNet = addObject("n" + hostItem->hostInfo().protocol());
+ int freeNNet = addObject(hostItem->hostInfo().protocol());
// TODO: When we pre-lookup available protocols, check validity here.
if (freeNNet == -1) {
|
|
From: <nd...@us...> - 2003-10-13 21:01:41
|
Update of /cvsroot/nvemftp/nvemftp/src
In directory sc8-pr-cvs1:/tmp/cvs-serv4364/src
Modified Files:
hostprofiles.cpp main.cpp nvemftp.cpp
Log Message:
Change HostProfileManager to use the same singleton construct as nvemSettings.
Index: hostprofiles.cpp
===================================================================
RCS file: /cvsroot/nvemftp/nvemftp/src/hostprofiles.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- hostprofiles.cpp 1 Oct 2003 19:54:17 -0000 1.1
+++ hostprofiles.cpp 13 Oct 2003 21:01:37 -0000 1.2
@@ -19,6 +19,13 @@
#include <iostream>
#endif
+HostProfileManager::HostProfileManagerPtr& HostProfileManager::getInstance()
+{
+ static HostProfileManagerPtr singleton(new HostProfileManager);
+
+ return singleton;
+}
+
HostProfileManager::HostProfileManager()
{
}
Index: main.cpp
===================================================================
RCS file: /cvsroot/nvemftp/nvemftp/src/main.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- main.cpp 13 Oct 2003 20:29:34 -0000 1.12
+++ main.cpp 13 Oct 2003 21:01:37 -0000 1.13
@@ -19,19 +19,16 @@
#include "nvemsettings.h"
#include "hostprofiles.h"
-HostProfileManager *nHostMan;
-
int main ( int argc, char **argv )
{
int ret;
nvemSettings::instance().loadSettings();
- nHostMan = new HostProfileManager;
- nHostMan->loadHostProfiles();
+ HostProfileManager::instance().loadHostProfiles();
#ifdef QT_DEBUG
- nHostMan->dumpProfiles();
+ HostProfileManager::instance().dumpProfiles();
#endif
QApplication a( argc, argv); // create new application - pass command line args
@@ -60,8 +57,8 @@
if (char(p.constref(0)) != '-') {
// Allow for profile names without -b specification.
- if (nHostMan->exists(p))
- startUrl = nHostMan->findProfile(p);
+ if (HostProfileManager::instance().exists(p))
+ startUrl = HostProfileManager::instance().findProfile(p);
else
std::cout << "Error: Profile '" << p << "' doesn't exist.\n";
@@ -114,8 +111,8 @@
break;
case 'b':
if ((j+1) < a.argc()) {
- if (nHostMan->exists(a.argv()[j+1])) {
- startUrl = nHostMan->findProfile(a.argv()[j+1]);
+ if (HostProfileManager::instance().exists(a.argv()[j+1])) {
+ startUrl = HostProfileManager::instance().findProfile(a.argv()[j+1]);
} else {
std::cout << "Error: Profile '" << a.argv()[j+1] << "' doesn't exist.\n";
}
@@ -175,8 +172,7 @@
nvemSettings::instance().setSetting("nvemftp", "WindowWidth", nvemftp.size().width());
nvemSettings::instance().setSetting("nvemftp", "WindowHeight", nvemftp.size().height());
- nHostMan->saveHostProfiles();
- delete nHostMan;
+ HostProfileManager::instance().saveHostProfiles();
nvemSettings::instance().saveSettings();
Index: nvemftp.cpp
===================================================================
RCS file: /cvsroot/nvemftp/nvemftp/src/nvemftp.cpp,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- nvemftp.cpp 13 Oct 2003 20:29:34 -0000 1.43
+++ nvemftp.cpp 13 Oct 2003 21:01:37 -0000 1.44
@@ -295,8 +295,8 @@
{
NHostInfo newhost;
if (quickProtocol->currentText() == "book") {
- if (nHostMan->exists(quickHost->currentText())) {
- newhost = nHostMan->findProfile(quickHost->currentText());
+ if (HostProfileManager::instance().exists(quickHost->currentText())) {
+ newhost = HostProfileManager::instance().findProfile(quickHost->currentText());
} else {
// Abort!
QMessageBox::warning(this, "Host Profile Not Found",
|
|
From: <nd...@us...> - 2003-10-13 21:01:40
|
Update of /cvsroot/nvemftp/nvemftp/contrib/tests/textdump In directory sc8-pr-cvs1:/tmp/cvs-serv4364/contrib/tests/textdump Modified Files: textdump.cpp Log Message: Change HostProfileManager to use the same singleton construct as nvemSettings. Index: textdump.cpp =================================================================== RCS file: /cvsroot/nvemftp/nvemftp/contrib/tests/textdump/textdump.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- textdump.cpp 13 Oct 2003 20:29:32 -0000 1.3 +++ textdump.cpp 13 Oct 2003 21:01:36 -0000 1.4 @@ -3,6 +3,7 @@ #include "nhostinfo.h" #include <qstring.h> +#include <qtextstream.h> #include <iostream> using namespace std; |
|
From: <nd...@us...> - 2003-10-13 21:01:40
|
Update of /cvsroot/nvemftp/nvemftp/include
In directory sc8-pr-cvs1:/tmp/cvs-serv4364/include
Modified Files:
hostprofiles.h
Log Message:
Change HostProfileManager to use the same singleton construct as nvemSettings.
Index: hostprofiles.h
===================================================================
RCS file: /cvsroot/nvemftp/nvemftp/include/hostprofiles.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- hostprofiles.h 1 Oct 2003 19:54:16 -0000 1.1
+++ hostprofiles.h 13 Oct 2003 21:01:36 -0000 1.2
@@ -11,6 +11,8 @@
#ifndef HOSTPROFILES_H
#define HOSTPROFILES_H
+#include <memory>
+
#include <qmap.h>
#include <qstringlist.h>
#include "nhostinfo.h"
@@ -25,10 +27,15 @@
class HostProfileManager
{
public:
- /// Initialize the host profile manager.
- HostProfileManager();
- /// Destructor.
- ~HostProfileManager();
+ /**
+ * Returns a reference to the host profile manager object.
+ */
+ static HostProfileManager& instance() { return *getInstance(); }
+
+ /**
+ * Returns a const reference to the host profile manager object.
+ */
+ static const HostProfileManager& const_instance() { return *getInstance(); }
/**
* Load host profiles from disk.
@@ -80,13 +87,27 @@
void dumpProfiles() const;
#endif
+protected:
+ /// Initialize the host profile manager.
+ HostProfileManager();
+ /// Destructor.
+ ~HostProfileManager();
+
private:
+ typedef std::auto_ptr<HostProfileManager> HostProfileManagerPtr;
+ /// Return the singleton instance.
+ static HostProfileManagerPtr& getInstance();
+ /// Gives auto_ptr<nvemSettings> access to our destructor.
+ friend class std::auto_ptr<HostProfileManager>;
+
+ /// Copy constructor to prevent creation of a default copy constructor.
+ HostProfileManager(const HostProfileManager&);
+ /// Prevent creation of default assignment operator.
+ HostProfileManager& operator=(const HostProfileManager&);
/// Maps the host profiles to their respective names.
QMap<QString, NHostInfo> hp_map;
};
-
-extern HostProfileManager *nHostMan;
#endif // HOSTPROFILES_H
|
|
From: <nd...@us...> - 2003-10-13 20:30:08
|
Update of /cvsroot/nvemftp/nvemftp
In directory sc8-pr-cvs1:/tmp/cvs-serv29027
Modified Files:
README config.pro
Log Message:
Change nvemSettings from using an extern pointer reference to using a singleton method with auto_ptr management.
Starting implementing bookmark support into the GUI.
Scan a directory for plugins at startup.
-- Not fully completed, need to reference things by protocol only, not full path.
Update test cases for the lack of needing to define nvemSettings.
Move moduleInfo and DirCache to be defined within their respective classes.
Index: README
===================================================================
RCS file: /cvsroot/nvemftp/nvemftp/README,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- README 2 Aug 2003 19:27:41 -0000 1.5
+++ README 13 Oct 2003 20:29:31 -0000 1.6
@@ -1,5 +1,5 @@
To compile, simply run:
- make
+ make INSTALL_ROOT=/path/to/install/
And to install:
make install INSTALL_ROOT=/path/to/install/
Index: config.pro
===================================================================
RCS file: /cvsroot/nvemftp/nvemftp/config.pro,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- config.pro 20 Sep 2003 05:14:54 -0000 1.19
+++ config.pro 13 Oct 2003 20:29:31 -0000 1.20
@@ -7,10 +7,14 @@
VERSION = $${MAJOR}.$${MINOR}.$${RELEASE}
-DEFINES += MAJOR=$${MAJOR} MINOR=$${MINOR} RELEASE=$${RELEASE}
+
+INSTALL_PREFIX = ./
+#INSTALL_PREFIX = $(HOME)
+
+PLUGINDIR=$${INSTALL_PREFIX}/lib/nvemftp/
+
+DEFINES += PLUGINDIR=\"$${PLUGINDIR}\" MAJOR=$${MAJOR} MINOR=$${MINOR} RELEASE=$${RELEASE}
QMAKE_CXXFLAGS_DEBUG = -g -DQT_DEBUG
QMAKE_CXXFLAGS_RELEASE = -O3 -fomit-frame-pointer -march=i686
-INSTALL_PREFIX = ./
-#INSTALL_PREFIX = $(HOME)
|
|
From: <nd...@us...> - 2003-10-13 20:30:07
|
Update of /cvsroot/nvemftp/nvemftp/contrib/tests/textdump
In directory sc8-pr-cvs1:/tmp/cvs-serv29027/contrib/tests/textdump
Modified Files:
textdump.cpp
Log Message:
Change nvemSettings from using an extern pointer reference to using a singleton method with auto_ptr management.
Starting implementing bookmark support into the GUI.
Scan a directory for plugins at startup.
-- Not fully completed, need to reference things by protocol only, not full path.
Update test cases for the lack of needing to define nvemSettings.
Move moduleInfo and DirCache to be defined within their respective classes.
Index: textdump.cpp
===================================================================
RCS file: /cvsroot/nvemftp/nvemftp/contrib/tests/textdump/textdump.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- textdump.cpp 11 Oct 2003 17:57:58 -0000 1.2
+++ textdump.cpp 13 Oct 2003 20:29:32 -0000 1.3
@@ -1,18 +1,14 @@
#define HOSTINFO_PARSE
#include "nhostinfo.h"
-#include "nvemsettings.h"
#include <qstring.h>
#include <iostream>
using namespace std;
-nvemSettings *nSettings;
-
int main(int argc, char **argv)
{
- nSettings = new nvemSettings;
QString dump;
QTextIStream stream(stdin);
int multiline = 0;
@@ -58,7 +54,6 @@
delete test;
}
- delete nSettings;
return 0;
}
|