From 04498e56aeef5a3e1b89b07745ebc226bd059707 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 13 Jul 2016 00:22:34 +0200 Subject: Work on handling requests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/filter.c | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) (limited to 'src/filter.c') diff --git a/src/filter.c b/src/filter.c index 54bb9ad..4287c2e 100644 --- a/src/filter.c +++ b/src/filter.c @@ -31,7 +31,6 @@ */ void filter_destroy(struct filter* this) { - free(this->crtc); free(this->class); free(this->ramps); } @@ -55,9 +54,8 @@ size_t filter_marshal(const struct filter* this, void* buf, size_t ramps_size) if (bs != NULL) { - if (this->crtc != NULL) nonnulls |= 1; - if (this->class != NULL) nonnulls |= 2; - if (this->ramps != NULL) nonnulls |= 4; + if (this->class != NULL) nonnulls |= 1; + if (this->ramps != NULL) nonnulls |= 2; *(bs + off) = nonnulls; } off += 1; @@ -70,14 +68,6 @@ size_t filter_marshal(const struct filter* this, void* buf, size_t ramps_size) *(enum lifespan*)(bs + off) = this->lifespan; off += sizeof(enum lifespan); - if (this->crtc != NULL) - { - n = strlen(this->crtc) + 1; - if (bs != NULL) - memcpy(bs + off, this->crtc, n); - off += n; - } - if (this->class != NULL) { n = strlen(this->class) + 1; @@ -114,7 +104,6 @@ size_t filter_unmarshal(struct filter* this, const void* buf, size_t ramps_size) nonnulls = *(bs + off); off += 1; - this->crtc = NULL; this->class = NULL; this->ramps = NULL; @@ -125,14 +114,6 @@ size_t filter_unmarshal(struct filter* this, const void* buf, size_t ramps_size) off += sizeof(enum lifespan); if (nonnulls & 1) - { - n = strlen(bs + off) + 1; - if (!(this->crtc = memdup(bs + off, n))) - goto fail; - off += n; - } - - if (nonnulls & 2) { n = strlen(bs + off) + 1; if (!(this->class = memdup(bs + off, n))) @@ -140,7 +121,7 @@ size_t filter_unmarshal(struct filter* this, const void* buf, size_t ramps_size) off += n; } - if (nonnulls & 4) + if (nonnulls & 2) { if (!(this->ramps = memdup(bs + off, ramps_size))) goto fail; @@ -150,7 +131,6 @@ size_t filter_unmarshal(struct filter* this, const void* buf, size_t ramps_size) return off; fail: - free(this->crtc); free(this->class); free(this->ramps); return 0; -- cgit v1.2.3-70-g09d2