summaryrefslogtreecommitdiffstats
path: root/src/handshake.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2012-03-24 20:55:27 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2012-03-24 20:55:27 +0100
commit4ffc28ecd6d914f9c1e5aaf5d5921ee4827bb289 (patch)
treeddd64c27220b75f45a6efdc162bbbe040a9ca001 /src/handshake.c
parent78fe2cda0572433e40889bcd7d64dd22707bfdd0 (diff)
downloadfastd-4ffc28ecd6d914f9c1e5aaf5d5921ee4827bb289.tar
fastd-4ffc28ecd6d914f9c1e5aaf5d5921ee4827bb289.zip
Partial implementation of a config files parser
Diffstat (limited to 'src/handshake.c')
-rw-r--r--src/handshake.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/handshake.c b/src/handshake.c
index e30ab9f..19f15a9 100644
--- a/src/handshake.c
+++ b/src/handshake.c
@@ -74,8 +74,8 @@ void fastd_handshake_send(fastd_context *ctx, fastd_peer *peer) {
request->req_id = ++peer->last_req_id;
request->rsv = 0;
- uint8_t protocol = ctx->conf->protocol;
- handshake_add(ctx, &buffer, RECORD_PROTOCOL, 1, &protocol);
+ uint8_t mode = ctx->conf->mode;
+ handshake_add(ctx, &buffer, RECORD_MODE, 1, &mode);
handshake_add(ctx, &buffer, RECORD_METHOD_NAME, method_len, ctx->conf->method->name);
@@ -119,15 +119,15 @@ void fastd_handshake_handle(fastd_context *ctx, fastd_peer *peer, fastd_buffer b
uint8_t reply_code = REPLY_SUCCESS;
uint8_t error_detail = 0;
- if (!records[RECORD_PROTOCOL]) {
+ if (!records[RECORD_MODE]) {
reply_code = REPLY_MANDATORY_MISSING;
- error_detail = RECORD_PROTOCOL;
+ error_detail = RECORD_MODE;
goto send_reply;
}
- if (lengths[RECORD_PROTOCOL] != 1 || *(uint8_t*)records[RECORD_PROTOCOL] != ctx->conf->protocol) {
+ if (lengths[RECORD_MODE] != 1 || *(uint8_t*)records[RECORD_MODE] != ctx->conf->mode) {
reply_code = REPLY_UNACCEPTABLE_VALUE;
- error_detail = RECORD_PROTOCOL;
+ error_detail = RECORD_MODE;
goto send_reply;
}