Browse Source

Added function http_redo, which does a new request for the same url as an

old request and cancels the old request.
master
Richard Nyberg 18 years ago
parent
commit
0c71b0ceb1
2 changed files with 12 additions and 0 deletions
  1. +11
    -0
      btpd/http.c
  2. +1
    -0
      btpd/http.h

+ 11
- 0
btpd/http.c View File

@@ -88,6 +88,17 @@ http_get(struct http **ret,
return 0;
}

int
http_redo(struct http **http)
{
int err;
struct http *ret;
err = http_get(&ret, (*http)->cb, "%s", (*http)->url);
http_cancel(*http);
*http = ret;
return err;
}

void
http_cancel(struct http *http)
{


+ 1
- 0
btpd/http.h View File

@@ -20,6 +20,7 @@ int http_get(struct http **ret,
void (*cb)(struct http *, struct http_res *, void *),
void *arg,
const char *fmt, ...);
int http_redo(struct http **http);
void http_cancel(struct http *http);

int http_succeeded(struct http_res *res);


Loading…
Cancel
Save