Author: dylan
Date: 2006-01-06 11:19:05 -0500 (Fri, 06 Jan 2006)
New Revision: 960

Modified:
   trunk/
   trunk/perl/server/TODO
   trunk/perl/server/lib/Haver/Server/Talker.pm
Log:
Fixed bug found by perlhaq


Property changes on: trunk
___________________________________________________________________
Name: svk:merge
   - 1f59643a-e6e5-0310-bc24-f7d4c744f460:/haver/havercurs-objc:43089
1f59643a-e6e5-0310-bc24-f7d4c744f460:/haver/local/trunk:11166
1f59643a-e6e5-0310-bc24-f7d4c744f460:/haver/local/trunk-merge-10131:11178
1f59643a-e6e5-0310-bc24-f7d4c744f460:/haver/winch/trunk:43192
27e50396-46e3-0310-8b22-ae223a1f35ce:/local:212
e9404bb1-7af0-0310-a7ff-e22194cd388b:/haver/local:1710
edfcd8bd-4ce7-0310-a97e-bb1efd40edf3:/local:238
   + 1f59643a-e6e5-0310-bc24-f7d4c744f460:/haver/havercurs-objc:43089
1f59643a-e6e5-0310-bc24-f7d4c744f460:/haver/local/trunk:11166
1f59643a-e6e5-0310-bc24-f7d4c744f460:/haver/local/trunk-merge-10131:11178
1f59643a-e6e5-0310-bc24-f7d4c744f460:/haver/winch/trunk:43192
27e50396-46e3-0310-8b22-ae223a1f35ce:/local:212
e9404bb1-7af0-0310-a7ff-e22194cd388b:/haver/local:2387
edfcd8bd-4ce7-0310-a97e-bb1efd40edf3:/local:238

Modified: trunk/perl/server/TODO
===================================================================
--- trunk/perl/server/TODO      2005-12-21 15:34:48 UTC (rev 959)
+++ trunk/perl/server/TODO      2006-01-06 16:19:05 UTC (rev 960)
@@ -1,6 +1,7 @@
 * Integrate the config file stuff. Everything that can be configured should be.
 * Add an unlisten state to the Listener.
 * Add rate limits, using a token bucket (bd_)
+* Server should not accept lines over 4k
 * Add Reaper object, that makes sure an object is returned to the store when 
it is no longer needed.
 * Implement ATTR.
 * Implement ACL.

Modified: trunk/perl/server/lib/Haver/Server/Talker.pm
===================================================================
--- trunk/perl/server/lib/Haver/Server/Talker.pm        2005-12-21 15:34:48 UTC 
(rev 959)
+++ trunk/perl/server/lib/Haver/Server/Talker.pm        2006-01-06 16:19:05 UTC 
(rev 960)
@@ -80,19 +80,22 @@
        
        return if $heap->{plonk};
        return if $heap->{shutdown};
-       
+
+
+       unless ($heap->{version}) {
+               Log('warning', "My, isn't this a stupid one.");
+               $heap->{error} = 1;
+               $heap->{client} = undef;
+               call('shutdown');
+               return;
+       }
+
        unless (@$args) {
                Log('warning', "Got an empty line.");
-               if ($heap->{version}) {
-                       call('shutdown', 'bork', 'Your line is empty');
-               } else {
-                       Log('warning', "My, isn't this a stupid one.");
-                       $heap->{error} = 1;
-                       $heap->{client} = undef;
-                       call('shutdown');
-               }
+               call('shutdown', 'bork', 'Your line is empty');
                return;
        }
+
        my $cmd = shift @$args;
        unless ($cmd =~ /^[A-Z][A-Z:_-]+$/) {
                Log('notice', "This is an example of a badly formed command: 
$cmd");


Reply via email to