XDK API  3.6.0
Documentation
Macros | Typedefs | Functions | Variables
httpcli.c File Reference
#include <http/client/httpcli.h>
#include <http/client/common.h>
+ Include dependency graph for httpcli.c:

Macros

#define CHUNKED_FLAG   (0x04)
 
#define CONTENT_BUFLEN   128
 
#define HTTP_PREFIX   "http://"
 
#define HTTP_VER   "HTTP/1.1"
 
#define HTTPS_PREFIX   "https://"
 
#define INPROGRESS_FLAG   (0x08)
 
#define MAX_FIELD_NAME_LEN   24
 
#define READ_FLAG   (0x01)
 
#define REDIRECT_FLAG   (0x02)
 
#define SEND_BUFLEN   128
 
#define STATUS_BUFLEN   16
 
#define URI_BUFLEN   128
 

Typedefs

typedef void(* ThreadFxnPtr )(HTTPCli_Handle cli)
 

Functions

static void asyncThread (HTTPCli_Handle cli)
 
ssize_t bufferedRecv (HTTPCli_Handle cli, Ssock_Handle ssock, void *buf, size_t len, int flags)
 
static int checkContentField (HTTPCli_Handle cli, char *fname, char *fvalue, bool moreFlag)
 
static void contentHandler (HTTPCli_Handle cli, int status)
 
static int getChunkedData (HTTPCli_Handle cli, char *body, int len, bool *moreFlag)
 
static bool getCliState (HTTPCli_Handle cli, int flag)
 
static int getStatus (HTTPCli_Handle cli)
 
int HTTPCli_connect (HTTPCli_Struct *cli, const struct sockaddr *addr, int flags, const HTTPCli_Params *params)
 
void HTTPCli_construct (HTTPCli_Handle cli)
 
HTTPCli_Handle HTTPCli_create ()
 
void HTTPCli_delete (HTTPCli_Handle cli)
 
void HTTPCli_destruct (HTTPCli_Struct *cli)
 
void HTTPCli_disconnect (HTTPCli_Struct *cli)
 
int HTTPCli_getResponseField (HTTPCli_Handle cli, char *body, int len, bool *moreFlag)
 
int HTTPCli_getResponseStatus (HTTPCli_Handle cli)
 
int HTTPCli_initSockAddr (struct sockaddr *addr, const char *uri, int flags)
 
int HTTPCli_readRawResponseBody (HTTPCli_Handle cli, char *body, int len)
 
int HTTPCli_readResponseBody (HTTPCli_Handle cli, char *body, int len, bool *moreFlag)
 
int HTTPCli_sendField (HTTPCli_Handle cli, const char *name, const char *value, bool lastFlag)
 
int HTTPCli_sendRequest (HTTPCli_Handle cli, const char *method, const char *requestURI, bool moreFlag)
 
int HTTPCli_sendRequestBody (HTTPCli_Handle cli, const char *body, int len)
 
void HTTPCli_setProxy (const struct sockaddr *addr)
 
HTTPCli_Field * HTTPCli_setRequestFields (HTTPCli_Handle cli, const HTTPCli_Field *fields)
 
char ** HTTPCli_setResponseFields (HTTPCli_Handle cli, const char *fields[])
 
void HTTPCli_setSecureParams (HTTPCli_SecureParams *sparams)
 
static bool isValidSocket (int skt)
 
static int lookUpResponseFields (HTTPCli_Handle cli, char *field)
 
static int readLine (HTTPCli_Handle cli, char *line, int len, bool *moreFlag)
 
static int redirect (HTTPCli_Handle cli, int status)
 
static void setCliState (HTTPCli_Handle cli, int flag, bool value)
 
static int skipLine (HTTPCli_Handle cli)
 
static int sprsend (HTTPCli_Handle cli, const char *fmt,...)
 
static int startSecureMode (HTTPCli_Handle cli)
 
static int stringCompare (const char *str1, const char *str2)
 
static int stringCompareByLen (const char *str1, const char *str2, int len)
 
static int threadCreate (ThreadFxnPtr fxn, void *cli)
 
static void threadExit ()
 
static unsigned char toLowerCase (unsigned char c)
 

Variables

static struct sockaddr proxyAddr = {0}
 
static HTTPCli_SecureParams tlsParams = {0}
 

Macro Definition Documentation

#define CHUNKED_FLAG   (0x04)
#define CONTENT_BUFLEN   128
#define HTTP_PREFIX   "http://"
#define HTTP_VER   "HTTP/1.1"
#define HTTPS_PREFIX   "https://"
#define INPROGRESS_FLAG   (0x08)
#define MAX_FIELD_NAME_LEN   24
#define READ_FLAG   (0x01)
#define REDIRECT_FLAG   (0x02)
#define SEND_BUFLEN   128
#define STATUS_BUFLEN   16
#define URI_BUFLEN   128

Typedef Documentation

typedef void(* ThreadFxnPtr)(HTTPCli_Handle cli)

Function Documentation

static void asyncThread ( HTTPCli_Handle  cli)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ssize_t bufferedRecv ( HTTPCli_Handle  cli,
Ssock_Handle  ssock,
void *  buf,
size_t  len,
int  flags 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int checkContentField ( HTTPCli_Handle  cli,
char *  fname,
char *  fvalue,
bool  moreFlag 
)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void contentHandler ( HTTPCli_Handle  cli,
int  status 
)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int getChunkedData ( HTTPCli_Handle  cli,
char *  body,
int  len,
bool *  moreFlag 
)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static bool getCliState ( HTTPCli_Handle  cli,
int  flag 
)
static

+ Here is the caller graph for this function:

static int getStatus ( HTTPCli_Handle  cli)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int HTTPCli_connect ( HTTPCli_Struct *  cli,
const struct sockaddr *  addr,
int  flags,
const HTTPCli_Params *  params 
)

+ Here is the call graph for this function:

void HTTPCli_construct ( HTTPCli_Handle  cli)

+ Here is the caller graph for this function:

HTTPCli_Handle HTTPCli_create ( )

+ Here is the call graph for this function:

void HTTPCli_delete ( HTTPCli_Handle  cli)

+ Here is the call graph for this function:

void HTTPCli_destruct ( HTTPCli_Struct *  cli)

+ Here is the caller graph for this function:

void HTTPCli_disconnect ( HTTPCli_Struct *  cli)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int HTTPCli_getResponseField ( HTTPCli_Handle  cli,
char *  body,
int  len,
bool *  moreFlag 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int HTTPCli_getResponseStatus ( HTTPCli_Handle  cli)

+ Here is the call graph for this function:

int HTTPCli_initSockAddr ( struct sockaddr *  addr,
const char *  uri,
int  flags 
)

+ Here is the call graph for this function:

int HTTPCli_readRawResponseBody ( HTTPCli_Handle  cli,
char *  body,
int  len 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int HTTPCli_readResponseBody ( HTTPCli_Handle  cli,
char *  body,
int  len,
bool *  moreFlag 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int HTTPCli_sendField ( HTTPCli_Handle  cli,
const char *  name,
const char *  value,
bool  lastFlag 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int HTTPCli_sendRequest ( HTTPCli_Handle  cli,
const char *  method,
const char *  requestURI,
bool  moreFlag 
)

+ Here is the call graph for this function:

int HTTPCli_sendRequestBody ( HTTPCli_Handle  cli,
const char *  body,
int  len 
)

+ Here is the call graph for this function:

void HTTPCli_setProxy ( const struct sockaddr *  addr)
HTTPCli_Field* HTTPCli_setRequestFields ( HTTPCli_Handle  cli,
const HTTPCli_Field *  fields 
)
char** HTTPCli_setResponseFields ( HTTPCli_Handle  cli,
const char *  fields[] 
)

+ Here is the caller graph for this function:

void HTTPCli_setSecureParams ( HTTPCli_SecureParams *  sparams)
static bool isValidSocket ( int  skt)
static

+ Here is the caller graph for this function:

static int lookUpResponseFields ( HTTPCli_Handle  cli,
char *  field 
)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int readLine ( HTTPCli_Handle  cli,
char *  line,
int  len,
bool *  moreFlag 
)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int redirect ( HTTPCli_Handle  cli,
int  status 
)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void setCliState ( HTTPCli_Handle  cli,
int  flag,
bool  value 
)
static

+ Here is the caller graph for this function:

static int skipLine ( HTTPCli_Handle  cli)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int sprsend ( HTTPCli_Handle  cli,
const char *  fmt,
  ... 
)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int startSecureMode ( HTTPCli_Handle  cli)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int stringCompare ( const char *  str1,
const char *  str2 
)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int stringCompareByLen ( const char *  str1,
const char *  str2,
int  len 
)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int threadCreate ( ThreadFxnPtr  fxn,
void *  cli 
)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void threadExit ( )
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static unsigned char toLowerCase ( unsigned char  c)
static

+ Here is the caller graph for this function:

Variable Documentation

struct sockaddr proxyAddr = {0}
static
HTTPCli_SecureParams tlsParams = {0}
static

All rights reserved. The use is subject to the XDK SDK EULA by Bosch Connected Devices and Solutions GmbH.
This documentation file has been automatically generated on Thu Mar 14 2019 19:12:47 by doxygen 1.8.8