You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nghttp2-go/_nghttp2.h

52 lines
1.9 KiB
C

6 years ago
#ifndef _NGHTTP2_H
#define _NGHTTP2_H
#include <nghttp2/nghttp2.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#define ARRLEN(x) (sizeof(x) / sizeof(x[0]))
6 years ago
extern ssize_t OnClientDataRecvCallback(void *, void *data, size_t);
extern ssize_t OnClientDataSendCallback(void *, void *data, size_t);
extern ssize_t OnDataSourceReadCallback(void *, void *, size_t);
extern int OnClientDataChunkRecv(void *, int, void *, size_t);
extern int OnClientBeginHeaderCallback(void *, int);
extern int OnClientHeaderCallback(void *, int, void *, int, void *, int);
extern int OnClientHeadersDoneCallback(void *, int);
extern int OnClientStreamClose(void *, int);
6 years ago
6 years ago
extern ssize_t OnServerDataRecvCallback(void *, void *data, size_t);
extern ssize_t OnServerDataSendCallback(void *, void *data, size_t);
extern int OnServerDataChunkRecv(void *, int, void *, size_t);
extern int OnServerBeginHeaderCallback(void *, int);
extern int OnServerHeaderCallback(void *, int, void *, int, void *, int);
extern int OnServerStreamEndCallback(void *, int);
extern int OnServerHeadersDoneCallback(void *, int);
extern int OnServerStreamClose(void *, int);
int send_server_connection_header(nghttp2_session *session);
6 years ago
struct nv_array
{
nghttp2_nv *nv;
size_t len;
};
void delete_nv_array(struct nv_array *a);
nghttp2_data_provider *new_data_provider(size_t data);
6 years ago
int nv_array_set(struct nv_array *a, int index,
char *name, char *value,
size_t namelen, size_t valuelen, int flag);
struct nv_array *new_nv_array(size_t n);
int32_t submit_request(nghttp2_session *session, nghttp2_nv *hdrs, size_t hdrlen,
nghttp2_data_provider *dp);
6 years ago
int send_client_connection_header(nghttp2_session *session);
nghttp2_session *init_nghttp2_client_session(size_t data);
nghttp2_session *init_nghttp2_server_session(size_t data);
6 years ago
#endif