Fix typo: HTTP_MSG -> HTTP_METHOD
Signed-off-by: Jianhui Zhao <jianhuizhao329@gmail.com>main
parent
3b1d425d07
commit
782f6ae796
10
src/client.c
10
src/client.c
|
@ -37,9 +37,9 @@ static const char *const http_versions[] = {
|
|||
};
|
||||
|
||||
static const char *const http_methods[] = {
|
||||
[UH_HTTP_MSG_GET] = "GET",
|
||||
[UH_HTTP_MSG_POST] = "POST",
|
||||
[UH_HTTP_MSG_HEAD] = "HEAD"
|
||||
[UH_HTTP_METHOD_GET] = "GET",
|
||||
[UH_HTTP_METHOD_POST] = "POST",
|
||||
[UH_HTTP_METHOD_HEAD] = "HEAD"
|
||||
};
|
||||
|
||||
static inline void client_send(struct uh_client *cl, const void *data, int len)
|
||||
|
@ -207,11 +207,11 @@ static void uh_handle_request(struct uh_client *cl)
|
|||
struct dispatch *d = &cl->dispatch;
|
||||
|
||||
switch (cl->request.method) {
|
||||
case UH_HTTP_MSG_GET:
|
||||
case UH_HTTP_METHOD_GET:
|
||||
if (cl->srv->request_cb(cl) == UH_REQUEST_DONE)
|
||||
return;
|
||||
break;
|
||||
case UH_HTTP_MSG_POST:
|
||||
case UH_HTTP_METHOD_POST:
|
||||
d->post_data = post_post_data;
|
||||
d->post_done = post_post_done;
|
||||
d->free = post_data_free;
|
||||
|
|
|
@ -41,9 +41,9 @@ enum request_status {
|
|||
};
|
||||
|
||||
enum http_method {
|
||||
UH_HTTP_MSG_GET,
|
||||
UH_HTTP_MSG_POST,
|
||||
UH_HTTP_MSG_HEAD
|
||||
UH_HTTP_METHOD_GET,
|
||||
UH_HTTP_METHOD_POST,
|
||||
UH_HTTP_METHOD_HEAD
|
||||
};
|
||||
|
||||
enum http_version {
|
||||
|
|
|
@ -360,7 +360,7 @@ static void uh_file_data(struct uh_client *cl, struct path_info *pi, int fd)
|
|||
cl->printf(cl, "Content-Type: %s\r\n\r\n", uh_file_mime_lookup(pi->name));
|
||||
|
||||
/* send header */
|
||||
if (cl->request.method == UH_HTTP_MSG_HEAD) {
|
||||
if (cl->request.method == UH_HTTP_METHOD_HEAD) {
|
||||
cl->request_done(cl);
|
||||
close(fd);
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue