gwenhywfar 5.10.1
Functions
gui_syncio.c File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

GWEN_SYNCIOGWEN_Gui_ExtendSyncIo (const char *url, const char *defaultProto, int defaultPort, GWEN_SYNCIO *baseSio)
 
int GWENHYWFAR_CB GWEN_Gui_Internal_GetSyncIo (GWEN_UNUSED GWEN_GUI *gui, const char *url, const char *defaultProto, int defaultPort, GWEN_SYNCIO **pSio)
 

Function Documentation

◆ GWEN_Gui_ExtendSyncIo()

GWEN_SYNCIO * GWEN_Gui_ExtendSyncIo ( const char *  url,
const char *  defaultProto,
int  defaultPort,
GWEN_SYNCIO baseSio 
)

Stack sync io layers above the given base layer.

This is a convenience function to extend a base layer (e.g. created by GWEN_SyncIo_Socket_new) to support HTTP or HTTPS over the given base layer.

You can use this function to allow for e.g. HTTPS over a socket created by functions GWEN_Socket_Accept and GWEN_SyncIo_Socket_TakeOver.

The caller is responsible for freeing the object returned (if any).

Returns
syncio object supporting the given protocol (e.g. HTTP, HTTPS), NULL on error
Parameters
urlurl to which the caller wants to connect to. You should call GWEN_Url_fromString() to get the information required to determine the protocol and destination.
defaultProtodefault protocol name if not specified by the url (e.g. "http", "https")
defaultPortdefault port if not specified by the url
baseSiobase layer to extend (e.g. created by GWEN_SyncIo_Socket_new)

Definition at line 29 of file gui_syncio.c.

References DBG_ERROR, DBG_INFO, GWEN_Buffer_free(), GWEN_Buffer_GetStart(), GWEN_Buffer_new(), GWEN_DB_FLAGS_OVERWRITE_VARS, GWEN_DB_SetCharValue(), GWEN_Gui_GetGui(), GWEN_LOGDOMAIN, GWEN_SyncIo_Buffered_new(), GWEN_SyncIo_free(), GWEN_SyncIo_Http_GetDbCommandOut(), GWEN_SyncIo_Http_GetDbHeaderOut(), GWEN_SyncIo_Http_new(), GWEN_SyncIo_Tls_new(), GWEN_SyncIo_Tls_SetRemoteHostName(), GWEN_Url_free(), GWEN_Url_fromString(), GWEN_Url_GetPort(), GWEN_Url_GetProtocol(), GWEN_Url_GetServer(), GWEN_Url_toCommandString(), and NULL.

Referenced by GWEN_Gui_Internal_GetSyncIo(), and GWEN_HttpSession_fromSocketPassive().

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

◆ GWEN_Gui_Internal_GetSyncIo()

int GWENHYWFAR_CB GWEN_Gui_Internal_GetSyncIo ( GWEN_UNUSED GWEN_GUI gui,
const char *  url,
const char *  defaultProto,
int  defaultPort,
GWEN_SYNCIO **  pSio 
)