NULL: Implement ERROR handling

NULL mechanism sends ERROR command rather than READY command when ZAP
handler rejects the ZAP request (status code != "200"). The body of
ERROR command contains the status code as returned by ZAP handler.
This commit is contained in:
Martin Hurton
2014-05-07 16:43:06 +02:00
parent 61d41156bc
commit 934560b559
3 changed files with 75 additions and 21 deletions

View File

@@ -48,14 +48,23 @@ namespace zmq
session_base_t * const session;
char status_code [3];
const std::string peer_address;
bool ready_command_sent;
bool error_command_sent;
bool ready_command_received;
bool error_command_received;
bool zap_connected;
bool zap_request_sent;
bool zap_reply_received;
int process_ready_command (
const unsigned char *cmd_data, size_t data_size);
int process_error_command (
const unsigned char *cmd_data, size_t data_size);
void send_zap_request ();
int receive_and_process_zap_reply ();
};