diff options
author | Adam Chlipala <adamc@hcoop.net> | 2009-06-27 17:50:31 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2009-06-27 17:50:31 -0400 |
commit | b9fcbe3dc86323a4a64b419c589a1cc5eeb38749 (patch) | |
tree | fb74e59d4dc2a663499f25e692fac8f08e6cb266 /src/c/request.c | |
parent | e549f22abb97951897b9eaebee879addd66f2517 (diff) |
.msgs processing in FastCGI
Diffstat (limited to 'src/c/request.c')
-rw-r--r-- | src/c/request.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/c/request.c b/src/c/request.c index 0dbf6290..bbc39d34 100644 --- a/src/c/request.c +++ b/src/c/request.c @@ -151,12 +151,16 @@ void uw_free_request_context(uw_request_context r) { free(r); } +extern char *uw_url_prefix; + request_result uw_request(uw_request_context rc, uw_context ctx, char *method, char *path, char *query_string, char *body, size_t body_len, void (*on_success)(uw_context), void (*on_failure)(uw_context), void *logger_data, uw_logger log_error, uw_logger log_debug, - int sock) { + int sock, + int (*send)(int sockfd, const void *buf, size_t len), + int (*close)(int fd)) { int retries_left = MAX_RETRIES; char *s; failure_kind fk; @@ -201,7 +205,8 @@ request_result uw_request(uw_request_context rc, uw_context ctx, return FAILED; } - if (!strcmp(path, "/.msgs")) { + if (!strncmp(path, uw_url_prefix, strlen(uw_url_prefix)) + && !strcmp(path + strlen(uw_url_prefix), ".msgs")) { char *id = uw_Basis_requestHeader(ctx, "UrWeb-Client"); char *pass = uw_Basis_requestHeader(ctx, "UrWeb-Pass"); @@ -212,7 +217,7 @@ request_result uw_request(uw_request_context rc, uw_context ctx, if (id && pass) { unsigned idn = atoi(id); - uw_client_connect(idn, atoi(pass), sock); + uw_client_connect(idn, atoi(pass), sock, send, close); log_error(logger_data, "Processed request for messages by client %u\n\n", idn); return KEEP_OPEN; } |