I think there's life in AOX still and it's still worth working on.  I
know working on a project when you don't get a lot of feedback and there
are other things in life can make it hard to know if the effort is
worthwhile - I think the positive responses are evidence that Arnt and
other's work is appreciated.

I took a look through the debug logs from my recently updated server and
I see there are also errors being generated for a legitimate UNSELECT
command.  AOX is complaining a mailbox is not specified when this
command does not use a mailbox.

I've made a patch (attached) which fixes this by moving the UNSELECT
parsing in command.cpp [to where I believe it should really be] and does
an optional tidy up in the unselect.cpp (this second part is more a
personal preference to make it consistent with other commands code style).

Jim

diff -wur aox/imap/command.cpp ../aox/imap/command.cpp
--- aox/imap/command.cpp        2016-06-13 18:31:44.121781524 -0400
+++ ../aox/imap/command.cpp     2016-06-13 18:26:16.253466301 -0400
@@ -286,8 +286,6 @@
             c = new Copy( uid );
         else if ( n == "thread" )
             c = new Thread( uid );
-        else if ( n == "unselect" )
-            c = new Unselect;
         else if ( n == "sort" )
             c = new Sort( uid );
         else if ( n == "move" )
@@ -300,6 +298,8 @@
     if ( !c ) {
         if ( n == "noop" )
             c = new Noop;
+        else if ( n == "unselect" )
+            c = new Unselect;
         else if ( n == "capability" )
             c = new Capability;
         else if ( n == "logout" )
diff -wur aox/imap/handlers/unselect.cpp ../aox/imap/handlers/unselect.cpp
--- aox/imap/handlers/unselect.cpp      2016-06-13 18:31:44.129781922 -0400
+++ ../aox/imap/handlers/unselect.cpp   2016-06-13 18:23:19.172648621 -0400
@@ -15,7 +15,10 @@
 
 void Unselect::execute()
 {
-    if ( state() == Executing )
+    if ( state() != Executing )
+        return;
+
         imap()->setSession( 0 );
+
     finish();
 }

Reply via email to