diff options
author | Adam Chlipala <adamc@hcoop.net> | 2009-06-23 14:05:12 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2009-06-23 14:05:12 -0400 |
commit | 91faf79d92661a24d5a79f340c54be460b2af431 (patch) | |
tree | e623aac5c0b1237fc0e7d16fa0749b114d18aa6e /include | |
parent | 5279aee30a3e80436340771adffb4bc9cc7c4718 (diff) |
Factor out common request functionality, in preparation for supporting different protocols
Diffstat (limited to 'include')
-rw-r--r-- | include/request.h | 22 | ||||
-rw-r--r-- | include/types.h | 2 |
2 files changed, 24 insertions, 0 deletions
diff --git a/include/request.h b/include/request.h new file mode 100644 index 00000000..1111f47f --- /dev/null +++ b/include/request.h @@ -0,0 +1,22 @@ +#ifndef REQUEST_H +#define REQUEST_H + +#include <sys/types.h> + +#include "types.h" + +typedef struct uw_rc *uw_request_context; + +void uw_request_init(void); +void uw_sign(const char *in, char *out); + +uw_request_context uw_new_request_context(void); +void uw_free_request_context(uw_request_context); + +request_result uw_request(uw_request_context, uw_context, char *request, size_t request_len, int sock); + +uw_context uw_request_new_context(void); + +void *client_pruner(void *data); + +#endif diff --git a/include/types.h b/include/types.h index ca9ef152..4a28452b 100644 --- a/include/types.h +++ b/include/types.h @@ -40,6 +40,8 @@ typedef struct uw_Basis_file { typedef enum { SUCCESS, FATAL, BOUNDED_RETRY, UNLIMITED_RETRY, RETURN_BLOB } failure_kind; +typedef enum { SERVED, KEEP_OPEN, FAILED } request_result; + typedef struct input *uw_input; #define INTS_MAX 50 |