MOD_HTTP_SESSION


HTTP Setup Functions

Functions of this groups should be called before GWEN_HttpSession_Init because the information conveyed via these functions is needed upon initialisation.

GWENHYWFAR_API void GWEN_HttpSession_AddFlags (GWEN_HTTP_SESSION *sess, uint32_t fl)
GWENHYWFAR_API uint32_t GWEN_HttpSession_GetFlags (const GWEN_HTTP_SESSION *sess)
GWENHYWFAR_API const char * GWEN_HttpSession_GetHttpContentType (const GWEN_HTTP_SESSION *sess)
GWENHYWFAR_API const char * GWEN_HttpSession_GetHttpUserAgent (const GWEN_HTTP_SESSION *sess)
GWENHYWFAR_API int GWEN_HttpSession_GetHttpVMajor (const GWEN_HTTP_SESSION *sess)
GWENHYWFAR_API int GWEN_HttpSession_GetHttpVMinor (const GWEN_HTTP_SESSION *sess)
GWENHYWFAR_API void GWEN_HttpSession_SetFlags (GWEN_HTTP_SESSION *sess, uint32_t fl)
GWENHYWFAR_API void GWEN_HttpSession_SetHttpContentType (GWEN_HTTP_SESSION *sess, const char *s)
GWENHYWFAR_API void GWEN_HttpSession_SetHttpUserAgent (GWEN_HTTP_SESSION *sess, const char *s)
GWENHYWFAR_API void GWEN_HttpSession_SetHttpVMajor (GWEN_HTTP_SESSION *sess, int i)
GWENHYWFAR_API void GWEN_HttpSession_SetHttpVMinor (GWEN_HTTP_SESSION *sess, int i)
GWENHYWFAR_API void GWEN_HttpSession_SubFlags (GWEN_HTTP_SESSION *sess, uint32_t fl)

Contructor/Destructor

GWENHYWFAR_API void GWEN_HttpSession_Attach (GWEN_HTTP_SESSION *sess)
GWENHYWFAR_API void GWEN_HttpSession_free (GWEN_HTTP_SESSION *sess)
GWENHYWFAR_API GWEN_HTTP_SESSIONGWEN_HttpSession_new (const char *url, uint32_t guiid)

Initialisation and Deinitialisation

GWENHYWFAR_API int GWEN_HttpSession_Fini (GWEN_HTTP_SESSION *sess)
GWENHYWFAR_API GWEN_IO_LAYERGWEN_HttpSession_GetIoLayer (const GWEN_HTTP_SESSION *sess)
GWENHYWFAR_API int GWEN_HttpSession_Init (GWEN_HTTP_SESSION *sess)

Informational Functions

GWENHYWFAR_API uint32_t GWEN_HttpSession_GetGuiId (const GWEN_HTTP_SESSION *sess)

Sending and Receiving

GWENHYWFAR_API int GWEN_HttpSession_RecvPacket (GWEN_HTTP_SESSION *sess, GWEN_BUFFER *buf, int timeout)
GWENHYWFAR_API int GWEN_HttpSession_SendPacket (GWEN_HTTP_SESSION *sess, const char *httpCommand, const uint8_t *buf, uint32_t blen, int timeout)

Detailed Description

This module provides support for exchanging a HTTP(s) request.

Function Documentation

GWENHYWFAR_API void GWEN_HttpSession_AddFlags ( GWEN_HTTP_SESSION sess,
uint32_t  fl 
)

Definition at line 117 of file httpsession.c.

Referenced by GWEN_HttpSession_SendPacket().

GWENHYWFAR_API void GWEN_HttpSession_Attach ( GWEN_HTTP_SESSION sess  ) 

Definition at line 55 of file httpsession.c.

GWENHYWFAR_API int GWEN_HttpSession_Fini ( GWEN_HTTP_SESSION sess  ) 

Definition at line 440 of file httpsession.c.

References GWEN_Io_Layer_free().

GWENHYWFAR_API void GWEN_HttpSession_free ( GWEN_HTTP_SESSION sess  ) 

Definition at line 63 of file httpsession.c.

References GWEN_FREE_OBJECT, GWEN_INHERIT_FINI, and GWEN_Io_Layer_free().

GWENHYWFAR_API uint32_t GWEN_HttpSession_GetFlags ( const GWEN_HTTP_SESSION sess  ) 

Definition at line 99 of file httpsession.c.

GWENHYWFAR_API uint32_t GWEN_HttpSession_GetGuiId ( const GWEN_HTTP_SESSION sess  ) 

Definition at line 90 of file httpsession.c.

GWENHYWFAR_API const char* GWEN_HttpSession_GetHttpContentType ( const GWEN_HTTP_SESSION sess  ) 

Definition at line 157 of file httpsession.c.

GWENHYWFAR_API const char* GWEN_HttpSession_GetHttpUserAgent ( const GWEN_HTTP_SESSION sess  ) 

Definition at line 135 of file httpsession.c.

GWENHYWFAR_API int GWEN_HttpSession_GetHttpVMajor ( const GWEN_HTTP_SESSION sess  ) 

Definition at line 179 of file httpsession.c.

GWENHYWFAR_API int GWEN_HttpSession_GetHttpVMinor ( const GWEN_HTTP_SESSION sess  ) 

Definition at line 197 of file httpsession.c.

GWENHYWFAR_API GWEN_IO_LAYER* GWEN_HttpSession_GetIoLayer ( const GWEN_HTTP_SESSION sess  ) 

This function returns the IO layer created by GWEN_HttpSession_Init. Therefore it is only valid between GWEN_HttpSession_Init and GWEN_HttpSession_Fini. The chain of this io layer is: HTTP->Buffered->(TLS)->Socket. The tls io layer is only inserted for HTTPS connections.

Definition at line 81 of file httpsession.c.

GWENHYWFAR_API int GWEN_HttpSession_Init ( GWEN_HTTP_SESSION sess  ) 

GWENHYWFAR_API GWEN_HTTP_SESSION* GWEN_HttpSession_new ( const char *  url,
uint32_t  guiid 
)

Definition at line 38 of file httpsession.c.

References GWEN_INHERIT_INIT, GWEN_NEW_OBJECT, and GWEN_Url_fromString().

GWENHYWFAR_API int GWEN_HttpSession_RecvPacket ( GWEN_HTTP_SESSION sess,
GWEN_BUFFER buf,
int  timeout 
)

This function receives a response packet from the server and closes the connection. It expects the connection to be established by GWEN_HttpSession_SendPacket().

Definition at line 697 of file httpsession.c.

References DBG_INFO, GWEN_Buffer_Crop(), GWEN_Buffer_GetPos(), GWEN_Gui_ProgressLog(), GWEN_HttpSession__RecvPacket(), GWEN_Io_Layer_DisconnectRecursively(), GWEN_IO_REQUEST_FLAGS_FORCE, GWEN_LOGDOMAIN, GWEN_LoggerLevel_Info, I18N, and NULL.

GWENHYWFAR_API int GWEN_HttpSession_SendPacket ( GWEN_HTTP_SESSION sess,
const char *  httpCommand,
const uint8_t *  buf,
uint32_t  blen,
int  timeout 
)

This function connects to the server and then sends the given message. The buffer given as argument to this function must only contain the raw data (i.e. the HTTP body, no header).

Parameters:
sess http session object
httpCommand HTTP command to send (e.g. "GET", "POST")
buf pointer to the http body data to send
blen size of the http body data to send (might be 0)
timeout timeout in milliseconds

Definition at line 451 of file httpsession.c.

References DBG_INFO, DBG_NOTICE, GWEN_DB_FLAGS_OVERWRITE_VARS, GWEN_DB_SetCharValue(), GWEN_DB_SetIntValue(), GWEN_ERROR_SSL, GWEN_Gui_ProgressLog(), GWEN_HTTP_SESSION_FLAGS_FORCE_SSL3, GWEN_HttpSession_AddFlags(), GWEN_HttpSession_SubFlags(), GWEN_Io_Layer_AddFlags(), GWEN_Io_Layer_ConnectRecursively(), GWEN_Io_Layer_DisconnectRecursively(), GWEN_Io_Layer_FindBaseLayerByType(), GWEN_Io_Layer_SubFlags(), GWEN_IO_LAYER_TLS_FLAGS_FORCE_SSL_V3, GWEN_IO_LAYER_TLS_TYPE, GWEN_Io_Layer_WriteBytes(), GWEN_Io_LayerHttp_GetDbCommandOut(), GWEN_Io_LayerHttp_GetDbHeaderOut(), GWEN_IO_REQUEST_FLAGS_FLUSH, GWEN_IO_REQUEST_FLAGS_FORCE, GWEN_IO_REQUEST_FLAGS_PACKETBEGIN, GWEN_IO_REQUEST_FLAGS_PACKETEND, GWEN_LOGDOMAIN, GWEN_LoggerLevel_Error, GWEN_LoggerLevel_Info, GWEN_LoggerLevel_Notice, I18N, and NULL.

GWENHYWFAR_API void GWEN_HttpSession_SetFlags ( GWEN_HTTP_SESSION sess,
uint32_t  fl 
)

Definition at line 108 of file httpsession.c.

GWENHYWFAR_API void GWEN_HttpSession_SetHttpContentType ( GWEN_HTTP_SESSION sess,
const char *  s 
)

Definition at line 166 of file httpsession.c.

References NULL.

GWENHYWFAR_API void GWEN_HttpSession_SetHttpUserAgent ( GWEN_HTTP_SESSION sess,
const char *  s 
)

Definition at line 144 of file httpsession.c.

References NULL.

GWENHYWFAR_API void GWEN_HttpSession_SetHttpVMajor ( GWEN_HTTP_SESSION sess,
int  i 
)

Definition at line 188 of file httpsession.c.

GWENHYWFAR_API void GWEN_HttpSession_SetHttpVMinor ( GWEN_HTTP_SESSION sess,
int  i 
)

Definition at line 206 of file httpsession.c.

GWENHYWFAR_API void GWEN_HttpSession_SubFlags ( GWEN_HTTP_SESSION sess,
uint32_t  fl 
)

Definition at line 126 of file httpsession.c.

Referenced by GWEN_HttpSession_SendPacket().


Generated on Wed Sep 3 15:22:02 2008 for gwenhywfar by  doxygen 1.5.6