Some bugs in the C2 polling enginge

I have found some bugs or at least inconsistencies in the C2 polling server:

1. After opening a valid session issuing an invalid command results in the server sending an apparently valid response (Status: OK) with undefined tags. The correct bahivour should be to send error and in it should say something like “unknown command”

Oh dear! The xml examples I included in my message have been interpreted instead by the BB software.

Whoops. Ok. I think the HTML parsing has been cleaned up and now users should be able to post <XML> and <HTML> tags okay.

  1. After opening a valid session, issuing an invalid command results in the server sending an apparently valid response (Status: OK) with undefined <recentc2fills> tags. The correct bahivour should be to send <status>error</status> and in <error> it should say something like "unknown command"



    command: sdffds

    parameters: &

    <collective2>

    <status>OK</status>

    <error>



    <code>0</code>

    </error>

    <data>

    <recentc2fills>

    </recentc2fills>



    </data>

    </collective2>





    <data><recentc2fills/></data>





    2. When sending the lastestsigs command with a userid that is not in the user roster, the server responds with an error "Invalid session id.". This is not the correct error message, as it suggests the session ID has become invalid, when in fact the session ID is still valid (I can still issue another valid command with the session ID and I will get a proper response). If for some reason my application were to send a wrong user ID and would react to the error message "Invalid session id." by requesting a new session ID and repeating the errorneous command, the error would never get rectified and it would end up in an endless loop. The correct error message should be "invalid c2userid"



    command: latestsigs

    parameters: c2userid=123456

    <collective2>

    <status>error</status>

    <error>Invalid session id.</error>

    <data>

    </data>

    </collective2>



    C2 Error: C2 Server returned: Error: Invalid session id. Error_Code: (null)





    3. When sending the lastestsigs command with no userid at all, the server responds with "NOSUBSCRIPTIONS", which is not very logical. It should probably respond with something like "invalid c2userid".



    command: latestsigs

    parameters: &



    <collective2>

    <status>error</status>

    <error><code>NOSUBSCRIPTIONS</code>

    <url>http://www.collective2.com/cgi-perl/robothedge.mpl?want=needsystems&amp;c=TRADEXEC&amp;v=8</url></error>

    <data>

    </data>

    </collective2>



    C2 Error: C2 Server returned: Error: (null) Error_Code: NOSUBSCRIPTIONS





    4. The return of error codes is not consistent. Sometimes the error message appears in the <error> tag and sometimes in the <code> child tag of the <error> tag.









    Hope these bug reports help.