diff options
author | 2009-03-22 15:05:07 -0400 | |
---|---|---|
committer | 2009-03-22 15:05:07 -0400 | |
commit | 728965a2d50c6a1e3461309016ece1921492ff37 (patch) | |
tree | 5a3c064007e7481a452bc60d9dfaeabebb515a53 /src/c/driver.c | |
parent | aa8373e15c46685b6d6a951342205fd28dc52f1a (diff) |
First message send delivered, but not interpreted
Diffstat (limited to 'src/c/driver.c')
-rw-r--r-- | src/c/driver.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/c/driver.c b/src/c/driver.c index 12905ede..fe8d3aa5 100644 --- a/src/c/driver.c +++ b/src/c/driver.c @@ -138,7 +138,6 @@ static void *worker(void *data) { if (s = strstr(buf, "\r\n\r\n")) { failure_kind fk; char *cmd, *path, *headers, path_copy[uw_bufsize+1], *inputs; - int id, pass; s[2] = 0; @@ -169,9 +168,18 @@ static void *worker(void *data) { break; } - if (sscanf(path, "/.msgs/%d/%d", &id, &pass) == 2) { - uw_client_connect(id, pass, sock); - dont_close = 1; + uw_set_headers(ctx, headers); + + if (!strcmp(path, "/.msgs")) { + char *id = uw_Basis_requestHeader(ctx, "UrWeb-Client"); + char *pass = uw_Basis_requestHeader(ctx, "UrWeb-Pass"); + + if (id && pass) { + size_t idn = atoi(id); + uw_client_connect(idn, atoi(pass), sock); + dont_close = 1; + fprintf(stderr, "Processed request for messages by client %d\n\n", (int)idn); + } break; } @@ -197,8 +205,6 @@ static void *worker(void *data) { printf("Serving URI %s....\n", path); - uw_set_headers(ctx, headers); - while (1) { if (uw_db_begin(ctx)) { printf("Error running SQL BEGIN\n"); |