diff options
author | Russ Allbery <rra@stanford.edu> | 2011-10-05 17:14:12 -0700 |
---|---|---|
committer | Russ Allbery <rra@stanford.edu> | 2011-10-05 17:14:12 -0700 |
commit | 9cb16d964f5465207dfdbf2a72d856e42b0b1e2b (patch) | |
tree | 7a516424ee7684426f144085401d292ffa4059d3 /util | |
parent | 4b55e7a2ae759b994d08185b7253c91860e90f4e (diff) |
Refactor server token handling
Refactor how server token handling is done to be a bit clearer and
not treat everything else as weird exception cases for command
handling. Introduces a new error code (protocol spec changes coming
separately) for receiving unexpected tokens in the middle of a
continuation command, and hammers out the continuation handling so
that it's a bit more robust. (This still needs tests.)
Diffstat (limited to 'util')
-rw-r--r-- | util/protocol.h | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/util/protocol.h b/util/protocol.h index 5799273..41b6dd9 100644 --- a/util/protocol.h +++ b/util/protocol.h @@ -37,14 +37,15 @@ enum message_types { /* Error codes. */ enum error_codes { - ERROR_INTERNAL = 1, /* Internal server failure. */ - ERROR_BAD_TOKEN = 2, /* Invalid format in token. */ - ERROR_UNKNOWN_MESSAGE = 3, /* Unknown message type. */ - ERROR_BAD_COMMAND = 4, /* Invalid command format in token. */ - ERROR_UNKNOWN_COMMAND = 5, /* Unknown command. */ - ERROR_ACCESS = 6, /* Access denied. */ - ERROR_TOOMANY_ARGS = 7, /* Argument count exceeds server limit. */ - ERROR_TOOMUCH_DATA = 8 /* Argument size exceeds server limit. */ + ERROR_INTERNAL = 1, /* Internal server failure. */ + ERROR_BAD_TOKEN = 2, /* Invalid format in token. */ + ERROR_UNKNOWN_MESSAGE = 3, /* Unknown message type. */ + ERROR_BAD_COMMAND = 4, /* Invalid command format in token. */ + ERROR_UNKNOWN_COMMAND = 5, /* Unknown command. */ + ERROR_ACCESS = 6, /* Access denied. */ + ERROR_TOOMANY_ARGS = 7, /* Argument count exceeds server limit. */ + ERROR_TOOMUCH_DATA = 8, /* Argument size exceeds server limit. */ + ERROR_UNEXPECTED_MESSAGE = 9 /* Message type not valid now. */ }; #endif /* UTIL_PROTOCOL_H */ |