kore

An easy to use, scalable and secure web application framework for writing web APIs in C.
Commits | Files | Refs | README | LICENSE | git clone https://git.kore.io/kore.git

commit 84428f7133110ffde9a7479c5160e9f5bd5220ed
parent 60ed3e0fd268409b2f25106e9ed16634a1e43814
Author: Joris Vink <joris@coders.se>
Date:   Thu,  2 May 2013 14:55:57 +0200

move buf stuff into its own header, so we can use it in spdy.h

Diffstat:
includes/buf.h | 33+++++++++++++++++++++++++++++++++
includes/kore.h | 13-------------
includes/spdy.h | 3+++
src/buf.c | 1+
src/config.c | 1+
src/http.c | 1+
src/kore.c | 1+
src/module.c | 1+
src/net.c | 1+
src/spdy.c | 1+
src/utils.c | 1+
11 files changed, 44 insertions(+), 13 deletions(-)

diff --git a/includes/buf.h b/includes/buf.h @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2013 Joris Vink <joris@coders.se> + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef __H_BUF_H +#define __H_BUF_H + +#define KORE_BUF_INITIAL 128 +#define KORE_BUF_INCREMENT KORE_BUF_INITIAL + +struct kore_buf { + u_int8_t *data; + u_int32_t length; + u_int32_t offset; +}; + +struct kore_buf *kore_buf_create(u_int32_t); +void kore_buf_append(struct kore_buf *, u_int8_t *, u_int32_t); +u_int8_t *kore_buf_release(struct kore_buf *, u_int32_t *); + +#endif /* !__H_BUF_H */ diff --git a/includes/kore.h b/includes/kore.h @@ -97,15 +97,6 @@ struct kore_module_handle { TAILQ_ENTRY(kore_module_handle) list; }; -#define KORE_BUF_INITIAL 128 -#define KORE_BUF_INCREMENT KORE_BUF_INITIAL - -struct kore_buf { - u_int8_t *data; - u_int32_t length; - u_int32_t offset; -}; - extern int server_port; extern char *server_ip; @@ -144,10 +135,6 @@ int net_recv_expand(struct connection *c, struct netbuf *, size_t, void net_send_queue(struct connection *, u_int8_t *, size_t, int, struct netbuf **, int (*cb)(struct netbuf *)); -struct kore_buf *kore_buf_create(u_int32_t); -void kore_buf_append(struct kore_buf *, u_int8_t *, u_int32_t); -u_int8_t *kore_buf_release(struct kore_buf *, u_int32_t *); - struct spdy_header_block *spdy_header_block_create(int); struct spdy_stream *spdy_stream_lookup(struct connection *, u_int32_t); int spdy_stream_get_header(struct spdy_header_block *, diff --git a/includes/spdy.h b/includes/spdy.h @@ -50,6 +50,9 @@ struct spdy_stream { u_int8_t flags; u_int8_t prio; + u_int32_t bytes_expected; + u_int32_t bytes_received; + struct spdy_header_block *hblock; TAILQ_ENTRY(spdy_stream) list; }; diff --git a/src/buf.c b/src/buf.c @@ -33,6 +33,7 @@ #include <string.h> #include <zlib.h> +#include "buf.h" #include "spdy.h" #include "kore.h" diff --git a/src/config.c b/src/config.c @@ -34,6 +34,7 @@ #include <string.h> #include <zlib.h> +#include "buf.h" #include "spdy.h" #include "kore.h" diff --git a/src/http.c b/src/http.c @@ -34,6 +34,7 @@ #include <time.h> #include <zlib.h> +#include "buf.h" #include "spdy.h" #include "kore.h" #include "http.h" diff --git a/src/kore.c b/src/kore.c @@ -35,6 +35,7 @@ #include <time.h> #include <zlib.h> +#include "buf.h" #include "spdy.h" #include "kore.h" #include "http.h" diff --git a/src/module.c b/src/module.c @@ -36,6 +36,7 @@ #include <string.h> #include <zlib.h> +#include "buf.h" #include "spdy.h" #include "kore.h" diff --git a/src/net.c b/src/net.c @@ -34,6 +34,7 @@ #include <string.h> #include <zlib.h> +#include "buf.h" #include "spdy.h" #include "kore.h" diff --git a/src/spdy.c b/src/spdy.c @@ -33,6 +33,7 @@ #include <string.h> #include <zlib.h> +#include "buf.h" #include "spdy.h" #include "kore.h" #include "http.h" diff --git a/src/utils.c b/src/utils.c @@ -33,6 +33,7 @@ #include <string.h> #include <zlib.h> +#include "buf.h" #include "spdy.h" #include "kore.h"