From d278cbb0b701cb3d33ec689b4102484f989c62d2 Mon Sep 17 00:00:00 2001 From: "tg(x)" <*@tg-x.net> Date: Fri, 22 Apr 2011 20:22:20 +0200 Subject: [PATCH] s/binary/length --- include/psyc/render.h | 6 +++--- src/render.c | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/psyc/render.h b/include/psyc/render.h index 3170924..0569d01 100644 --- a/include/psyc/render.h +++ b/include/psyc/render.h @@ -10,9 +10,9 @@ typedef enum { - PSYC_RENDER_CHECK_BINARY = 0, - PSYC_RENDER_BINARY = 1, - PSYC_RENDER_NOT_BINARY = 2, + PSYC_RENDER_CHECK_LENGTH = 0, + PSYC_RENDER_NEED_LENGTH = 1, + PSYC_RENDER_NO_LENGTH = 2, PSYC_RENDER_ROUTING = 3, } PSYC_RenderFlag; diff --git a/src/render.c b/src/render.c index 69a2771..358458c 100644 --- a/src/render.c +++ b/src/render.c @@ -51,17 +51,17 @@ PSYC_RenderRC PSYC_renderBody(PSYC_RenderState* state, const char* method, size_t mlength, const char* data, size_t dlength) { - if (state->flag == PSYC_RENDER_CHECK_BINARY) + if (state->flag == PSYC_RENDER_CHECK_LENGTH) { // find out if this packet needs a prepended length if (dlength == 1 && data[0] == C_GLYPH_PACKET_DELIMITER) - state->flag = PSYC_RENDER_BINARY; + state->flag = PSYC_RENDER_NEED_LENGTH; else if (dlength > 404) - state->flag = PSYC_RENDER_BINARY; + state->flag = PSYC_RENDER_NEED_LENGTH; else if (memmem(data, dlength, PSYC_PACKET_DELIMITER, sizeof(PSYC_PACKET_DELIMITER))) - state->flag = PSYC_RENDER_BINARY; + state->flag = PSYC_RENDER_NEED_LENGTH; else - state->flag = PSYC_RENDER_NOT_BINARY; + state->flag = PSYC_RENDER_NO_LENGTH; } // TBD