diff options
author | Mattias Andrée <maandree@kth.se> | 2016-07-13 00:22:34 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2016-07-13 00:22:34 +0200 |
commit | 04498e56aeef5a3e1b89b07745ebc226bd059707 (patch) | |
tree | f4b0927cd64dcd6c6f4a64e574d9078bfe3fc6b9 /src/filter.c | |
parent | Implement main loop and handling of inbound connections + remove server_message (though like this was an mds server and not a stand-alone server) (diff) | |
download | coopgammad-04498e56aeef5a3e1b89b07745ebc226bd059707.tar.gz coopgammad-04498e56aeef5a3e1b89b07745ebc226bd059707.tar.bz2 coopgammad-04498e56aeef5a3e1b89b07745ebc226bd059707.tar.xz |
Work on handling requests
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'src/filter.c')
-rw-r--r-- | src/filter.c | 26 |
1 files changed, 3 insertions, 23 deletions
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; @@ -127,20 +116,12 @@ size_t filter_unmarshal(struct filter* this, const void* buf, size_t ramps_size) 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))) goto fail; 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; |