Update of /cvsroot/popfile/engine/Proxy
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21513/Proxy
Modified Files:
NNTP.pm
Log Message:
*** Change all forms to use the POST method to make the URL displayed
in the browser cleaner
skins/default/configuration-page.thtml
skins/default/corpus-page.thtml
skins/default/magnet-page.thtml
skins/default/pop3-chain-panel.thtml
skins/default/pop3-configuration-panel.thtml
skins/default/pop3-security-panel.thtml
skins/default/security-page.thtml
skins/default/socks-widget.thtml
skins/default/view-quickmagnets-widget.thtml:
Add method="POST" to all forms.
*** Get TestModule working
tests/TestModule.tst
POPFile/Module.pm:
Fix logger tests and clean up wrapping and whitespace.
*** Get Single Message View working
skins/default/view-page.thtml
UI/HTML.pm:
Remove Previous/Next navigator, make magnet detail work, add To, Cc and Date
fields to header.
*** Merge patch that makes History in database work with Japanese
Classifier/MailParse.pm:
Get the current interface language value if none is passed in.
*** Added "Decision Chart" to Single Message View
skins/default/view-scores-widget.thtml
Classifier/Bayes.pm:
The new Decision Chart shows the contribution each word makes to the top
two buckets sorted in the order biggest positive contribution to biggest
negative contribution. The intent is that it shows how POPFile makes the
Bayes decision between the top two bucket. You can see which words
contribute to the decision between the top two buckets and by how much.
Hover on any bar to see the actual word.
Still some work to do make this look nice (e.g. scale, try to show the
words themselves on the chart if possible).
Index: NNTP.pm
===================================================================
RCS file: /cvsroot/popfile/engine/Proxy/NNTP.pm,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** NNTP.pm 24 Jun 2004 11:50:57 -0000 1.31
--- NNTP.pm 24 Jun 2004 19:12:02 -0000 1.32
***************
*** 36,39 ****
--- 36,40 ----
# A handy variable containing the value of an EOL for networks
+
my $eol = "\015\012";
***************
*** 74,77 ****
--- 75,79 ----
# Disabled by default
+
$self->config_( 'enabled', 0);
***************
*** 93,97 ****
# The welcome string from the proxy is configurable
! $self->config_( 'welcome_string', "NNTP POPFile ($self->{version_}) server ready" );
return $self->SUPER::initialize();;
--- 95,101 ----
# The welcome string from the proxy is configurable
!
! $self->config_( 'welcome_string',
! "NNTP POPFile ($self->{version_}) server ready" );
return $self->SUPER::initialize();;
***************
*** 138,143 ****
$self );
! return $self->SUPER::start();;
! }
# ---------------------------------------------------------------------------------------------
--- 142,146 ----
$self );
! return $self->SUPER::start();; }
# ---------------------------------------------------------------------------------------------
***************
*** 156,172 ****
# Number of messages downloaded in this session
my $count = 0;
# The handle to the real news server gets stored here
my $news;
! # The state of the connection (username needed, password needed, authenticated/connected)
my $connection_state = 'username needed';
! # Tell the client that we are ready for commands and identify our version number
! $self->tee_( $client, "201 " . $self->config_( 'welcome_string' ) . "$eol" );
- # Retrieve commands from the client and process them until the client disconnects or
- # we get a specific QUIT command
while ( <$client> ) {
my $command;
--- 159,183 ----
# Number of messages downloaded in this session
+
my $count = 0;
# The handle to the real news server gets stored here
+
my $news;
! # The state of the connection (username needed, password needed,
! # authenticated/connected)
!
my $connection_state = 'username needed';
! # Tell the client that we are ready for commands and identify our
! # version number
!
! $self->tee_( $client, "201 " . $self->config_( 'welcome_string' ) .
! "$eol" );
!
! # Retrieve commands from the client and process them until the
! # client disconnects or we get a specific QUIT command
while ( <$client> ) {
my $command;
***************
*** 175,188 ****
# Clean up the command so that it has a nice clean $eol at the end
$command =~ s/(\015|\012)//g;
$self->log_( 2, "Command: --$command--" );
! # The news client wants to stop using the server, so send that message through to the
! # real news server, echo the response back up to the client and exit the while. We will
! # close the connection immediately
if ( $command =~ /^ *QUIT/i ) {
if ( $news ) {
! last if ( $self->echo_response_( $news, $client, $command ) == 2 );
close $news;
} else {
--- 186,203 ----
# Clean up the command so that it has a nice clean $eol at the end
+
$command =~ s/(\015|\012)//g;
$self->log_( 2, "Command: --$command--" );
! # The news client wants to stop using the server, so send that
! # message through to the real news server, echo the response
! # back up to the client and exit the while. We will close the
! # connection immediately
!
if ( $command =~ /^ *QUIT/i ) {
if ( $news ) {
! last if ( $self->echo_response_( $news, $client, $command ) ==
! 2 );
close $news;
} else {
***************
*** 194,216 ****
if ($connection_state eq 'username needed') {
! # NOTE: This syntax is ambiguous if the NNTP username is a short (under 5 digit) string (eg, 32123).
! # If this is the case, run "perl popfile.pl -nntp_separator /" and change your kludged username
! # appropriately (syntax would then be server[:port][/username])
! my $user_command = '^ *AUTHINFO USER ([^:]+)(:([\d]{1,5}))?(\\' . $self->config_( 'separator' ) . '(.+))?';
if ( $command =~ /$user_command/i ) {
! my $server = $1;
# hey, the port has to be in range at least
! my $port = $3 if ( defined($3) && ($3 > 0) && ($3 < 65536) );
my $username = $5;
if ( $server ne '' ) {
! if ( $news = $self->verify_connected_( $news, $client, $server, $port || 119 ) ) {
if (defined $username) {
! # Pass through the AUTHINFO command with the actual user name for this server,
! # if one is defined, and send the reply straight to the client
! $self->get_response_($news, $client, 'AUTHINFO USER ' . $username );
$connection_state = "password needed";
} else {
--- 209,241 ----
if ($connection_state eq 'username needed') {
! # NOTE: This syntax is ambiguous if the NNTP username is a
! # short (under 5 digit) string (eg, 32123). If this is
! # the case, run "perl popfile.pl -nntp_separator /" and
! # change your kludged username appropriately (syntax would
! # then be server[:port][/username])
!
! my $user_command = '^ *AUTHINFO USER ([^:]+)(:([\d]{1,5}))?(\\' .
! $self->config_( 'separator' ) . '(.+))?';
if ( $command =~ /$user_command/i ) {
! my $server = $1;
!
# hey, the port has to be in range at least
!
! my $port = $3 if ( defined($3) && ($3 > 0) && ($3 < 65536) );
my $username = $5;
if ( $server ne '' ) {
! if ( $news = $self->verify_connected_( $news, $client,
! $server, $port || 119 ) ) {
if (defined $username) {
! # Pass through the AUTHINFO command with
! # the actual user name for this server, if
! # one is defined, and send the reply
! # straight to the client
! $self->get_response_( $news, $client,
! 'AUTHINFO USER ' . $username );
$connection_state = "password needed";
} else {
***************
*** 225,229 ****
}
} else {
! $self->tee_( $client, "482 Authentication rejected server name not specified in AUTHINFO USER command$eol" );
last;
}
--- 250,255 ----
}
} else {
! $self->tee_( $client,
! "482 Authentication rejected server name not specified in AUTHINFO USER command$eol" );
last;
}
***************
*** 240,244 ****
} elsif ( $connection_state eq "password needed" ) {
if ($command =~ /^ *AUTHINFO PASS (.*)/i) {
! my ( $response, $ok ) = $self->get_response_($news, $client, $command);
if ($response =~ /^281 .*/) {
--- 266,271 ----
} elsif ( $connection_state eq "password needed" ) {
if ($command =~ /^ *AUTHINFO PASS (.*)/i) {
! my ( $response, $ok ) = $self->get_response_( $news, $client,
! $command);
if ($response =~ /^281 .*/) {
***************
*** 269,280 ****
# COMMANDS USED DIRECTLY WITH THE REMOTE NNTP SERVER GO HERE
! # The client wants to retrieve an article. We oblige, and insert classification headers.
if ( $command =~ /^ *ARTICLE (.*)/i ) {
! my ( $response, $ok ) = $self->get_response_( $news, $client, $command);
if ( $response =~ /^220 (.*) (.*)$/i) {
$count += 1;
! my ( $class, $history_file ) = $self->{classifier__}->classify_and_modify( $session, $news, $client, 0, '' );
}
--- 296,311 ----
# COMMANDS USED DIRECTLY WITH THE REMOTE NNTP SERVER GO HERE
! # The client wants to retrieve an article. We oblige, and
! # insert classification headers.
if ( $command =~ /^ *ARTICLE (.*)/i ) {
! my ( $response, $ok ) = $self->get_response_( $news, $client,
! $command);
if ( $response =~ /^220 (.*) (.*)$/i) {
$count += 1;
! my ( $class, $history_file ) =
! $self->{classifier__}->classify_and_modify( $session,
! $news, $client, 0, '' );
}
***************
*** 284,293 ****
# Commands expecting a code + text response
! if ( $command =~ /^ *(LIST|HEAD|BODY|NEWGROUPS|NEWNEWS|LISTGROUP|XGTITLE|XINDEX|XHDR|XOVER|XPAT|XROVER|XTHREAD)/i ) {
! my ( $response, $ok ) = $self->get_response_( $news, $client, $command);
! # 2xx (200) series response indicates multi-line text follows to .crlf
! $self->echo_to_dot_( $news, $client, 0 ) if ( $response =~ /^2\d\d/ );
next;
}
--- 315,329 ----
# Commands expecting a code + text response
! if ( $command =~
! /^ *(LIST|HEAD|BODY|NEWGROUPS|NEWNEWS|LISTGROUP|XGTITLE|XINDEX|XHDR|XOVER|XPAT|XROVER|XTHREAD)/i ) {
! my ( $response, $ok ) = $self->get_response_( $news,
! $client, $command);
! # 2xx (200) series response indicates multi-line text
! # follows to .crlf
! if ( $response =~ /^2\d\d/ ) {
! $self->echo_to_dot_( $news, $client, 0 );
! }
next;
}
***************
*** 296,301 ****
if ( $ command =~ /^ *(HELP)/i ) {
! my ( $response, $ok ) = $self->get_response_( $news, $client, $command);
! $self->echo_to_dot_( $news, $client, 0 ) if ( $response =~ /^1\d\d/ );
next;
}
--- 332,340 ----
if ( $ command =~ /^ *(HELP)/i ) {
! my ( $response, $ok ) = $self->get_response_( $news, $client,
! $command);
! if ( $response =~ /^1\d\d/ ) {
! $self->echo_to_dot_( $news, $client, 0 );
! }
next;
}
***************
*** 303,307 ****
# Commands expecting a single-line response
! if ( $command =~ /^ *(GROUP|STAT|IHAVE|LAST|NEXT|SLAVE|MODE|XPATH)/i ) {
$self->get_response_( $news, $client, $command );
next;
--- 342,347 ----
# Commands expecting a single-line response
! if ( $command =~
! /^ *(GROUP|STAT|IHAVE|LAST|NEXT|SLAVE|MODE|XPATH)/i ) {
$self->get_response_( $news, $client, $command );
next;
***************
*** 311,317 ****
if ( $command =~ /^ *(IHAVE|POST|XRELPIC)/i ) {
! my ( $response, $ok ) = $self->get_response_( $news, $client, $command);
! # 3xx (300) series response indicates multi-line text should be sent, up to .crlf
if ($response =~ /^3\d\d/ ) {
--- 351,359 ----
if ( $command =~ /^ *(IHAVE|POST|XRELPIC)/i ) {
! my ( $response, $ok ) = $self->get_response_( $news, $client,
! $command);
! # 3xx (300) series response indicates multi-line text
! # should be sent, up to .crlf
if ($response =~ /^3\d\d/ ) {
***************
*** 321,325 ****
$self->echo_to_dot_( $client, $news, 0 );
! # Echo to dot doesn't provoke a server response somehow, we add another CRLF
$self->get_response_( $news, $client, "$eol" );
--- 363,368 ----
$self->echo_to_dot_( $client, $news, 0 );
! # Echo to dot doesn't provoke a server response
! # somehow, we add another CRLF
$self->get_response_( $news, $client, "$eol" );
***************
*** 333,342 ****
if ( $ command =~ /^ *$/ ) {
if ( $news && $news->connected ) {
! $self->get_response_($news, $client, $command, 1);
next;
}
}
! # Don't know what this is so let's just pass it through and hope for the best
if ( $news && $news->connected) {
--- 376,386 ----
if ( $ command =~ /^ *$/ ) {
if ( $news && $news->connected ) {
! $self->get_response_( $news, $client, $command, 1 );
next;
}
}
! # Don't know what this is so let's just pass it through and
! # hope for the best
if ( $news && $news->connected) {
|