ezyang@1739: #ifndef REQUEST_H ezyang@1739: #define REQUEST_H ezyang@1739: ezyang@1739: #include adam@2091: #include ezyang@1739: ezyang@1739: #include "types.h" ezyang@1739: ezyang@1739: typedef struct uw_rc *uw_request_context; ezyang@1739: grrwlf@1997: void uw_request_init(uw_app *app, uw_loggers* ls); ezyang@1739: void uw_sign(const char *in, char *out); ezyang@1739: ezyang@1739: uw_request_context uw_new_request_context(void); ezyang@1739: void uw_free_request_context(uw_request_context); ezyang@1739: grrwlf@1997: request_result uw_request(uw_request_context rc, uw_context ctx, ezyang@1739: char *method, char *path, char *query_string, ezyang@1739: char *body, size_t body_len, ezyang@1739: void (*on_success)(uw_context), void (*on_failure)(uw_context), ezyang@1739: void *logger_data, uw_logger log_error, uw_logger log_debug, ezyang@1739: int sock, ezyang@1739: int (*send)(int sockfd, const void *buf, ssize_t len), ezyang@1739: int (*close)(int fd)); ezyang@1739: grrwlf@1997: uw_context uw_request_new_context(int id, uw_app *app, uw_loggers *ls); ezyang@1739: ezyang@1739: typedef struct { ezyang@1739: uw_app *app; grrwlf@1997: uw_loggers *loggers; grrwlf@1997: } pruner_data; ezyang@1739: ezyang@1739: void *client_pruner(void *data); ezyang@1739: ezyang@1739: int pthread_create_big(pthread_t *outThread, void *foo, void *threadFunc, void *arg); ezyang@1739: ezyang@1739: #endif