annotate include/urweb/request.h @ 2289:78820fa8f5a7

Fix bugs for lock calculation and SQL parsing and add support for tasks.
author Ziv Scully <ziv@mit.edu>
date Sun, 15 Nov 2015 14:18:35 -0500
parents 35c1341b0179
children
rev   line source
ezyang@1739 1 #ifndef REQUEST_H
ezyang@1739 2 #define REQUEST_H
ezyang@1739 3
ezyang@1739 4 #include <sys/types.h>
adam@2091 5 #include <pthread.h>
ezyang@1739 6
ezyang@1739 7 #include "types.h"
ezyang@1739 8
ezyang@1739 9 typedef struct uw_rc *uw_request_context;
ezyang@1739 10
grrwlf@1997 11 void uw_request_init(uw_app *app, uw_loggers* ls);
ezyang@1739 12 void uw_sign(const char *in, char *out);
ezyang@1739 13
ezyang@1739 14 uw_request_context uw_new_request_context(void);
ezyang@1739 15 void uw_free_request_context(uw_request_context);
ezyang@1739 16
grrwlf@1997 17 request_result uw_request(uw_request_context rc, uw_context ctx,
ezyang@1739 18 char *method, char *path, char *query_string,
ezyang@1739 19 char *body, size_t body_len,
ezyang@1739 20 void (*on_success)(uw_context), void (*on_failure)(uw_context),
ezyang@1739 21 void *logger_data, uw_logger log_error, uw_logger log_debug,
ezyang@1739 22 int sock,
ezyang@1739 23 int (*send)(int sockfd, const void *buf, ssize_t len),
ezyang@1739 24 int (*close)(int fd));
ezyang@1739 25
grrwlf@1997 26 uw_context uw_request_new_context(int id, uw_app *app, uw_loggers *ls);
ezyang@1739 27
ezyang@1739 28 typedef struct {
ezyang@1739 29 uw_app *app;
grrwlf@1997 30 uw_loggers *loggers;
grrwlf@1997 31 } pruner_data;
ezyang@1739 32
ezyang@1739 33 void *client_pruner(void *data);
ezyang@1739 34
ezyang@1739 35 int pthread_create_big(pthread_t *outThread, void *foo, void *threadFunc, void *arg);
ezyang@1739 36
ezyang@1739 37 #endif