-
Notifications
You must be signed in to change notification settings - Fork 3.1k
libfetch, fetch: Improve handling of HTTP request body, method, fields, and status code #1859
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
b54ab72
af6163d
9ac571a
747ae41
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,7 +31,7 @@ | |
| #ifndef _FETCH_H_INCLUDED | ||
| #define _FETCH_H_INCLUDED | ||
|
|
||
| #define _LIBFETCH_VER "libfetch/2.0" | ||
| #define _LIBFETCH_VER "libfetch/2.1" | ||
|
|
||
| #define URL_SCHEMELEN 16 | ||
| #define URL_USERLEN 256 | ||
|
|
@@ -61,6 +61,15 @@ struct url_ent { | |
| struct url_stat stat; | ||
| }; | ||
|
|
||
| #ifdef _SYS_QUEUE_H_ | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The I'm open to handling this differently. |
||
| struct http_field { | ||
| const char *name; | ||
| const char *value; | ||
| TAILQ_ENTRY(http_field) fields; | ||
| }; | ||
| TAILQ_HEAD(http_fields, http_field); | ||
| #endif | ||
|
|
||
| /* Recognized schemes */ | ||
| #define SCHEME_FTP "ftp" | ||
| #define SCHEME_HTTP "http" | ||
|
|
@@ -105,6 +114,13 @@ int fetchStatHTTP(struct url *, struct url_stat *, const char *); | |
| struct url_ent *fetchListHTTP(struct url *, const char *); | ||
| FILE *fetchReqHTTP(struct url *, const char *, const char *, | ||
| const char *, const char *); | ||
| #ifdef _SYS_QUEUE_H_ | ||
| FILE *fetchXReqHTTP(struct url *, struct url_stat *, const char *, | ||
| const char *, const struct http_fields *, | ||
| const struct http_fields *, struct http_fields *, | ||
| struct http_fields *, FILE *); | ||
| void fetchFreeResFields(struct http_fields *); | ||
| #endif | ||
|
|
||
| /* FTP-specific functions */ | ||
| FILE *fetchXGetFTP(struct url *, struct url_stat *, const char *); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is not used outside http.c so while changing the parameters I also made it static.