move buf stuff back into kore.h, wont need it separately

This commit is contained in:
Joris Vink 2013-05-02 15:14:00 +02:00
parent a025f0fa8e
commit f61bbe8ff4
10 changed files with 13 additions and 41 deletions

View File

@ -1,33 +0,0 @@
/*
* 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 */

View File

@ -97,6 +97,15 @@ 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;
@ -135,6 +144,10 @@ 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 *,

View File

@ -33,7 +33,6 @@
#include <string.h>
#include <zlib.h>
#include "buf.h"
#include "spdy.h"
#include "kore.h"

View File

@ -34,7 +34,6 @@
#include <string.h>
#include <zlib.h>
#include "buf.h"
#include "spdy.h"
#include "kore.h"

View File

@ -34,7 +34,6 @@
#include <time.h>
#include <zlib.h>
#include "buf.h"
#include "spdy.h"
#include "kore.h"
#include "http.h"

View File

@ -35,7 +35,6 @@
#include <time.h>
#include <zlib.h>
#include "buf.h"
#include "spdy.h"
#include "kore.h"
#include "http.h"

View File

@ -36,7 +36,6 @@
#include <string.h>
#include <zlib.h>
#include "buf.h"
#include "spdy.h"
#include "kore.h"

View File

@ -34,7 +34,6 @@
#include <string.h>
#include <zlib.h>
#include "buf.h"
#include "spdy.h"
#include "kore.h"

View File

@ -33,7 +33,6 @@
#include <string.h>
#include <zlib.h>
#include "buf.h"
#include "spdy.h"
#include "kore.h"
#include "http.h"

View File

@ -33,7 +33,6 @@
#include <string.h>
#include <zlib.h>
#include "buf.h"
#include "spdy.h"
#include "kore.h"