protocol

protocol tests
Log | Files | Refs | Submodules | README | git clone https://git.ne02ptzero.me/git/protocol

commit 35f9f92924fcdfab4665eb44792f2bc1995921b3
parent c9e500943ae691914c00b6cd6dc0e298ab01e950
Author: Ne02ptzero <louis@ne02ptzero.me>
Date:   Tue, 28 Feb 2017 18:55:43 +0100

Add(write_payload_auth_ack)

Diffstat:
Msrc/write_package.c | 15++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/src/write_package.c b/src/write_package.c @@ -33,10 +33,23 @@ static void *write_payload_auth(void *pkg, size_t *count) { return ret; } +static void *write_payload_auth_ack(void *pkg, size_t *count) { + auth_ack_t *auth = pkg; + void *ret; + + ret = malloc(sizeof(auth_ack_t)); + assert(ret != NULL); + + write_member(auth->mpm_major_version, ret, *count); + write_member(auth->mpm_minor_version, ret, *count); + return ret; +} + typedef void *(*write_callback)(void *, size_t *); static const write_callback arr[] = { - &write_payload_auth + &write_payload_auth, + &write_payload_auth_ack }; void *write_payload(package_t *pkg, size_t *count) {