Macros | Functions
HTTP: Hyper Text Transfer Protocol

This module should behave RFC 3986, RFC 7230, RFC 7231 and RFC 7234 conformant. More...

Macros

#define MAIN_ERR_PREFIX   "HTTP: "
 Message prefix for HTTP module.
 
#define HTTP_PERM   (posix_mode_t) (POSIX_S_IRUSR | POSIX_S_IWUSR)
 Permissions for downloaded files that are created by this module.
 
#define HTTP_LINE_MAX   (size_t) 8192
 At least 8000 octets recommended by RFC 7230.
 

Functions

int http_download_file (const char *uri, const char *lpn)
 Download file from WWW via HTTP. More...
 

Detailed Description

This module should behave RFC 3986, RFC 7230, RFC 7231 and RFC 7234 conformant.

This module implements a minimalistic WWW client to download X.509 CRLs via HTTP/1.1 protocol (for certificate revocation checks of the TLS module).

Function Documentation

◆ http_download_file()

int http_download_file ( const char *  uri,
const char *  lpn 
)

Download file from WWW via HTTP.

Parameters
[in]uriURI of file on WWW server to download
[in]lpnLocal pathname where the file should be stored
Attention
The caller is responsible to verify that uri is a RFC 3986 conformant URI.
The caller is responsible that write permission to lpn is granted. If the file already exist, it is overwritten and truncated.
Returns
  • Zero on success (file is now stored at lpn )
  • -1 on unspecified error
  • -2 if URI scheme is not supported
  • -3 if authority of URI is not reachable
  • -4 if requested file not available via path of URI

Definition at line 880 of file http.c.

Referenced by ext_download_file().


Generated at 2024-04-27 using  doxygen