gwenhywfar 5.12.0
syncio_http.c File Reference
#include "syncio_http_p.h"
#include "i18n_l.h"
#include <gwenhywfar/misc.h>
#include <gwenhywfar/debug.h>
#include <gwenhywfar/gui.h>
#include <gwenhywfar/text.h>
#include <assert.h>
#include <errno.h>
#include <string.h>
#include <ctype.h>
Include dependency graph for syncio_http.c:

Go to the source code of this file.

Macros

#define DISABLE_DEBUGLOG

Functions

int GWENHYWFAR_CB GWEN_SyncIo_Http_Connect (GWEN_SYNCIO *sio)
int GWENHYWFAR_CB GWEN_SyncIo_Http_Disconnect (GWEN_SYNCIO *sio)
void GWENHYWFAR_CB GWEN_SyncIo_Http_FreeData (GWEN_UNUSED void *bp, void *p)
GWEN_DB_NODEGWEN_SyncIo_Http_GetDbCommandIn (const GWEN_SYNCIO *sio)
GWEN_DB_NODEGWEN_SyncIo_Http_GetDbCommandOut (const GWEN_SYNCIO *sio)
GWEN_DB_NODEGWEN_SyncIo_Http_GetDbHeaderIn (const GWEN_SYNCIO *sio)
GWEN_DB_NODEGWEN_SyncIo_Http_GetDbHeaderOut (const GWEN_SYNCIO *sio)
GWEN_DB_NODEGWEN_SyncIo_Http_GetDbStatusIn (const GWEN_SYNCIO *sio)
GWEN_DB_NODEGWEN_SyncIo_Http_GetDbStatusOut (const GWEN_SYNCIO *sio)
GWEN_SYNCIOGWEN_SyncIo_Http_new (GWEN_SYNCIO *baseIo)
int GWEN_SyncIo_Http_ParseCommand (GWEN_SYNCIO *sio, const char *buffer)
int GWEN_SyncIo_Http_ParseHeader (GWEN_SYNCIO *sio, char *buf)
int GWEN_SyncIo_Http_ParseStatus (GWEN_SYNCIO *sio, char *buffer)
int GWENHYWFAR_CB GWEN_SyncIo_Http_Read (GWEN_SYNCIO *sio, uint8_t *buffer, uint32_t size)
int GWEN_SyncIo_Http_ReadBody (GWEN_SYNCIO *sio, uint8_t *buffer, uint32_t size)
int GWEN_SyncIo_Http_ReadChunk (GWEN_SYNCIO *sio, uint8_t *buffer, uint32_t size)
int GWEN_SyncIo_Http_ReadChunkSize (GWEN_SYNCIO *sio)
int GWEN_SyncIo_Http_ReadCommand (GWEN_SYNCIO *sio)
int GWEN_SyncIo_Http_ReadHeader (GWEN_SYNCIO *sio)
int GWEN_SyncIo_Http_ReadLine (GWEN_SYNCIO *sio, GWEN_BUFFER *tbuf)
int GWEN_SyncIo_Http_ReadStatus (GWEN_SYNCIO *sio)
int GWEN_SyncIo_Http_RecvBody (GWEN_SYNCIO *sio, GWEN_BUFFER *buf)
int GWEN_SyncIo_Http_RecvBodyToSio (GWEN_SYNCIO *sio, GWEN_SYNCIO *sout)
void GWEN_SyncIo_Http_SetReadIdle (GWEN_SYNCIO *sio)
void GWEN_SyncIo_Http_SetWriteIdle (GWEN_SYNCIO *sio)
int GWENHYWFAR_CB GWEN_SyncIo_Http_Write (GWEN_SYNCIO *sio, const uint8_t *buffer, uint32_t size)
int GWEN_SyncIo_Http_WriteChunkSize (GWEN_SYNCIO *sio, uint32_t size)
int GWEN_SyncIo_Http_WriteCommand (GWEN_SYNCIO *sio)
int GWEN_SyncIo_Http_WriteHeader (GWEN_SYNCIO *sio)
int GWEN_SyncIo_Http_WriteStatus (GWEN_SYNCIO *sio)

Macro Definition Documentation

◆ DISABLE_DEBUGLOG

#define DISABLE_DEBUGLOG

Definition at line 29 of file syncio_http.c.

Function Documentation

◆ GWEN_SyncIo_Http_Connect()

int GWENHYWFAR_CB GWEN_SyncIo_Http_Connect ( GWEN_SYNCIO * sio)

Definition at line 99 of file syncio_http.c.

References DBG_INFO, GWEN_INHERIT_GETDATA, GWEN_LOGDOMAIN, GWEN_SyncIo_Connect(), GWEN_SyncIo_GetBaseIo(), GWEN_SyncIo_GetStatus(), GWEN_SyncIo_Http_SetReadIdle(), GWEN_SyncIo_SetStatus(), GWEN_SyncIo_Status_Connected, and GWENHYWFAR_CB.

Referenced by GWEN_SyncIo_Http_new().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_SyncIo_Http_Disconnect()

int GWENHYWFAR_CB GWEN_SyncIo_Http_Disconnect ( GWEN_SYNCIO * sio)

◆ GWEN_SyncIo_Http_FreeData()

void GWENHYWFAR_CB GWEN_SyncIo_Http_FreeData ( GWEN_UNUSED void * bp,
void * p )

Definition at line 80 of file syncio_http.c.

References GWEN_DB_Group_free(), GWEN_FREE_OBJECT, GWEN_UNUSED, and GWENHYWFAR_CB.

Referenced by GWEN_SyncIo_Http_new().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_SyncIo_Http_GetDbCommandIn()

GWEN_DB_NODE * GWEN_SyncIo_Http_GetDbCommandIn ( const GWEN_SYNCIO * sio)

Definition at line 1259 of file syncio_http.c.

References GWEN_INHERIT_GETDATA.

Referenced by GWEN_HttpSession_RecvCommand().

Here is the caller graph for this function:

◆ GWEN_SyncIo_Http_GetDbCommandOut()

GWEN_DB_NODE * GWEN_SyncIo_Http_GetDbCommandOut ( const GWEN_SYNCIO * sio)

Definition at line 1298 of file syncio_http.c.

References GWEN_INHERIT_GETDATA.

Referenced by GWEN_Gui_ExtendSyncIo(), and GWEN_HttpSession_SendPacket().

Here is the caller graph for this function:

◆ GWEN_SyncIo_Http_GetDbHeaderIn()

GWEN_DB_NODE * GWEN_SyncIo_Http_GetDbHeaderIn ( const GWEN_SYNCIO * sio)

Definition at line 1285 of file syncio_http.c.

References GWEN_INHERIT_GETDATA.

Referenced by _recvPacket(), _recvPacketToSio(), GWEN_HttpSession_RecvCommand(), GWEN_SyncIo_Http_RecvBody(), and GWEN_SyncIo_Http_RecvBodyToSio().

Here is the caller graph for this function:

◆ GWEN_SyncIo_Http_GetDbHeaderOut()

GWEN_DB_NODE * GWEN_SyncIo_Http_GetDbHeaderOut ( const GWEN_SYNCIO * sio)

Definition at line 1324 of file syncio_http.c.

References GWEN_INHERIT_GETDATA.

Referenced by GWEN_Gui_ExtendSyncIo(), GWEN_HttpSession_Init(), GWEN_HttpSession_SendPacket(), and GWEN_HttpSession_SendStatus().

Here is the caller graph for this function:

◆ GWEN_SyncIo_Http_GetDbStatusIn()

GWEN_DB_NODE * GWEN_SyncIo_Http_GetDbStatusIn ( const GWEN_SYNCIO * sio)

Definition at line 1272 of file syncio_http.c.

References GWEN_INHERIT_GETDATA.

◆ GWEN_SyncIo_Http_GetDbStatusOut()

GWEN_DB_NODE * GWEN_SyncIo_Http_GetDbStatusOut ( const GWEN_SYNCIO * sio)

Definition at line 1311 of file syncio_http.c.

References GWEN_INHERIT_GETDATA.

Referenced by GWEN_HttpSession_SendStatus().

Here is the caller graph for this function:

◆ GWEN_SyncIo_Http_new()

◆ GWEN_SyncIo_Http_ParseCommand()

int GWEN_SyncIo_Http_ParseCommand ( GWEN_SYNCIO * sio,
const char * buffer )

Definition at line 520 of file syncio_http.c.

References DBG_ERROR, GWEN_DB_FLAGS_OVERWRITE_VARS, GWEN_DB_SetCharValue(), GWEN_ERROR_INVALID, GWEN_INHERIT_GETDATA, and GWEN_LOGDOMAIN.

Referenced by GWEN_SyncIo_Http_ReadCommand().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_SyncIo_Http_ParseHeader()

int GWEN_SyncIo_Http_ParseHeader ( GWEN_SYNCIO * sio,
char * buf )

◆ GWEN_SyncIo_Http_ParseStatus()

int GWEN_SyncIo_Http_ParseStatus ( GWEN_SYNCIO * sio,
char * buffer )

Definition at line 472 of file syncio_http.c.

References DBG_ERROR, GWEN_DB_FLAGS_OVERWRITE_VARS, GWEN_DB_SetCharValue(), GWEN_DB_SetIntValue(), GWEN_ERROR_INVALID, GWEN_INHERIT_GETDATA, and GWEN_LOGDOMAIN.

Referenced by GWEN_SyncIo_Http_ReadStatus().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_SyncIo_Http_Read()

◆ GWEN_SyncIo_Http_ReadBody()

int GWEN_SyncIo_Http_ReadBody ( GWEN_SYNCIO * sio,
uint8_t * buffer,
uint32_t size )

Definition at line 951 of file syncio_http.c.

References DBG_INFO, GWEN_INHERIT_GETDATA, GWEN_LOGDOMAIN, GWEN_SyncIo_AddFlags(), GWEN_SYNCIO_FLAGS_TRANSPARENT, GWEN_SyncIo_GetBaseIo(), GWEN_SyncIo_Http_SetReadIdle(), and GWEN_SyncIo_Read().

Referenced by GWEN_SyncIo_Http_Read().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_SyncIo_Http_ReadChunk()

int GWEN_SyncIo_Http_ReadChunk ( GWEN_SYNCIO * sio,
uint8_t * buffer,
uint32_t size )

Definition at line 896 of file syncio_http.c.

References DBG_DEBUG, DBG_INFO, GWEN_Buffer_free(), GWEN_Buffer_new(), GWEN_INHERIT_GETDATA, GWEN_LOGDOMAIN, GWEN_SyncIo_AddFlags(), GWEN_SYNCIO_FLAGS_TRANSPARENT, GWEN_SyncIo_GetBaseIo(), GWEN_SyncIo_Http_ReadLine(), and GWEN_SyncIo_Read().

Referenced by GWEN_SyncIo_Http_Read().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_SyncIo_Http_ReadChunkSize()

int GWEN_SyncIo_Http_ReadChunkSize ( GWEN_SYNCIO * sio)

Definition at line 846 of file syncio_http.c.

References DBG_ERROR, DBG_INFO, GWEN_Buffer_free(), GWEN_Buffer_GetStart(), GWEN_Buffer_new(), GWEN_Buffer_Reset(), GWEN_ERROR_BAD_DATA, GWEN_INHERIT_GETDATA, GWEN_LOGDOMAIN, GWEN_SyncIo_GetBaseIo(), and GWEN_SyncIo_Http_ReadLine().

Referenced by GWEN_SyncIo_Http_Read().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_SyncIo_Http_ReadCommand()

int GWEN_SyncIo_Http_ReadCommand ( GWEN_SYNCIO * sio)

Definition at line 629 of file syncio_http.c.

References DBG_INFO, GWEN_Buffer_free(), GWEN_Buffer_GetStart(), GWEN_Buffer_new(), GWEN_INHERIT_GETDATA, GWEN_LOGDOMAIN, GWEN_SyncIo_GetBaseIo(), GWEN_SyncIo_Http_ParseCommand(), and GWEN_SyncIo_Http_ReadLine().

Referenced by GWEN_SyncIo_Http_Read().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_SyncIo_Http_ReadHeader()

◆ GWEN_SyncIo_Http_ReadLine()

◆ GWEN_SyncIo_Http_ReadStatus()

◆ GWEN_SyncIo_Http_RecvBody()

◆ GWEN_SyncIo_Http_RecvBodyToSio()

◆ GWEN_SyncIo_Http_SetReadIdle()

void GWEN_SyncIo_Http_SetReadIdle ( GWEN_SYNCIO * sio)

Definition at line 161 of file syncio_http.c.

References GWEN_INHERIT_GETDATA.

Referenced by GWEN_SyncIo_Http_Connect(), GWEN_SyncIo_Http_ParseHeader(), GWEN_SyncIo_Http_Read(), and GWEN_SyncIo_Http_ReadBody().

Here is the caller graph for this function:

◆ GWEN_SyncIo_Http_SetWriteIdle()

void GWEN_SyncIo_Http_SetWriteIdle ( GWEN_SYNCIO * sio)

Definition at line 1244 of file syncio_http.c.

References GWEN_DB_ClearGroup(), GWEN_INHERIT_GETDATA, and NULL.

Referenced by GWEN_SyncIo_Http_Write(), and GWEN_SyncIo_Http_WriteHeader().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_SyncIo_Http_Write()

◆ GWEN_SyncIo_Http_WriteChunkSize()

int GWEN_SyncIo_Http_WriteChunkSize ( GWEN_SYNCIO * sio,
uint32_t size )

Definition at line 1213 of file syncio_http.c.

References DBG_INFO, GWEN_INHERIT_GETDATA, GWEN_LOGDOMAIN, GWEN_SyncIo_AddFlags(), GWEN_SYNCIO_FLAGS_TRANSPARENT, GWEN_SyncIo_GetBaseIo(), and GWEN_SyncIo_WriteForced().

Referenced by GWEN_SyncIo_Http_Write().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_SyncIo_Http_WriteCommand()

◆ GWEN_SyncIo_Http_WriteHeader()

◆ GWEN_SyncIo_Http_WriteStatus()