gwenhywfar  4.99.8beta
httpsession.h
Go to the documentation of this file.
1 /***************************************************************************
2  begin : Fri Feb 15 2008
3  copyright : (C) 2008-2017 by Martin Preuss
4  email : martin@libchipcard.de
5 
6  ***************************************************************************
7  * Please see toplevel file COPYING for license details *
8  ***************************************************************************/
9 
10 
11 #ifndef GWEN_HTTP_SESSION_H
12 #define GWEN_HTTP_SESSION_H
13 
14 
15 #include <gwenhywfar/inherit.h>
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
23 
24 #ifdef __cplusplus
25 }
26 #endif
27 
28 
29 #include <gwenhywfar/url.h>
30 #include <gwenhywfar/buffer.h>
31 #include <gwenhywfar/syncio.h>
32 
33 
34 #ifndef NO_DEPRECATED_SYMBOLS
35 
38 # define GWEN_HTTP_SESSION_FLAGS_FORCE_SSL3 0x00000001 /* deprecated, will be removed in a future release */
39 #endif // ifndef NO_DEPRECATED_SYMBOLS
40 #define GWEN_HTTP_SESSION_FLAGS_NO_CACHE 0x00000002
41 #ifndef NO_DEPRECATED_SYMBOLS
42 # define GWEN_HTTP_SESSION_FLAGS_TLS_ONLY_SAFE_CIPHERS 0x00000004 /* deprecated, will be removed in a future release */
43 # define GWEN_HTTP_SESSION_FLAGS_TLS_FORCE_UNSAFE_CIPHERS 0x00000008 /* deprecated, will be removed in a future release */
44 #endif // ifndef NO_DEPRECATED_SYMBOLS
45 
46 #define GWEN_HTTP_SESSION_FLAGS_TLS_IGN_PREMATURE_CLOSE 0x00000010
47 
48 #ifdef __cplusplus
49 extern "C" {
50 #endif
51 
52 
58 
63 
65 GWEN_HTTP_SESSION *GWEN_HttpSession_new(const char *url, const char *defaultProto, int defaultPort);
66 
69 
83 
85 uint32_t GWEN_HttpSession_GetFlags(const GWEN_HTTP_SESSION *sess);
86 
88 void GWEN_HttpSession_SetFlags(GWEN_HTTP_SESSION *sess, uint32_t fl);
89 
91 void GWEN_HttpSession_AddFlags(GWEN_HTTP_SESSION *sess, uint32_t fl);
92 
94 void GWEN_HttpSession_SubFlags(GWEN_HTTP_SESSION *sess, uint32_t fl);
95 
98 
100 void GWEN_HttpSession_SetHttpUserAgent(GWEN_HTTP_SESSION *sess, const char *s);
101 
104 
106 void GWEN_HttpSession_SetHttpContentType(GWEN_HTTP_SESSION *sess, const char *s);
107 
108 
111 
114 
117 
130 
133 
142 
154  const char *httpCommand,
155  const uint8_t *buf, uint32_t blen);
156 
164 
166 int GWEN_HttpSession_RecvPacketToFile(GWEN_HTTP_SESSION *sess, const char *fname);
167 
176 
188 
192 
197  /* defgroup */
198 
199 
200 
201 #ifdef __cplusplus
202 }
203 #endif
204 
205 
206 #endif
207 
int GWENHYWFAR_CB(* GWEN_HTTPSESSION_INITSYNCIO_FN)(GWEN_HTTP_SESSION *sess, GWEN_SYNCIO *sio)
Definition: httpsession.h:189
GWENHYWFAR_API const char * GWEN_HttpSession_GetHttpContentType(const GWEN_HTTP_SESSION *sess)
Definition: httpsession.c:153
GWENHYWFAR_API void GWEN_HttpSession_SetHttpContentType(GWEN_HTTP_SESSION *sess, const char *s)
Definition: httpsession.c:162
GWENHYWFAR_API int GWEN_HttpSession_SendPacket(GWEN_HTTP_SESSION *sess, const char *httpCommand, const uint8_t *buf, uint32_t blen)
Definition: httpsession.c:297
GWENHYWFAR_API int GWEN_HttpSession_GetHttpVMajor(const GWEN_HTTP_SESSION *sess)
Definition: httpsession.c:175
GWENHYWFAR_API void GWEN_HttpSession_SetHttpVMinor(GWEN_HTTP_SESSION *sess, int i)
Definition: httpsession.c:202
GWENHYWFAR_API int GWEN_HttpSession_ConnectionTest(GWEN_HTTP_SESSION *sess)
Definition: httpsession.c:629
GWENHYWFAR_API uint32_t GWEN_HttpSession_GetFlags(const GWEN_HTTP_SESSION *sess)
Definition: httpsession.c:95
struct GWEN_SYNCIO GWEN_SYNCIO
Definition: syncio.h:40
#define GWEN_INHERIT_FUNCTION_LIB_DEFS(t, decl)
Definition: inherit.h:125
GWENHYWFAR_API void GWEN_HttpSession_SubFlags(GWEN_HTTP_SESSION *sess, uint32_t fl)
Definition: httpsession.c:122
#define GWENHYWFAR_CB
Definition: gwenhywfarapi.h:89
GWENHYWFAR_API int GWEN_HttpSession_Init(GWEN_HTTP_SESSION *sess)
Definition: httpsession.c:214
GWENHYWFAR_API void GWEN_HttpSession_AddFlags(GWEN_HTTP_SESSION *sess, uint32_t fl)
Definition: httpsession.c:113
struct GWEN_BUFFER GWEN_BUFFER
A dynamically resizeable text buffer.
Definition: buffer.h:41
GWENHYWFAR_API void GWEN_HttpSession_Attach(GWEN_HTTP_SESSION *sess)
Definition: httpsession.c:57
#define GWENHYWFAR_API
Definition: gwenhywfarapi.h:67
struct GWEN_HTTP_SESSION GWEN_HTTP_SESSION
Definition: httpsession.h:21
GWENHYWFAR_API void GWEN_HttpSession_SetFlags(GWEN_HTTP_SESSION *sess, uint32_t fl)
Definition: httpsession.c:104
GWENHYWFAR_API void GWEN_HttpSession_SetHttpUserAgent(GWEN_HTTP_SESSION *sess, const char *s)
Definition: httpsession.c:140
GWENHYWFAR_API int GWEN_HttpSession_RecvPacketToFile(GWEN_HTTP_SESSION *sess, const char *fname)
Definition: httpsession.c:550
GWENHYWFAR_API GWEN_HTTPSESSION_INITSYNCIO_FN GWEN_HttpSession_SetInitSyncIoFn(GWEN_HTTP_SESSION *sess, GWEN_HTTPSESSION_INITSYNCIO_FN f)
Definition: httpsession.c:85
GWENHYWFAR_API GWEN_HTTP_SESSION * GWEN_HttpSession_new(const char *url, const char *defaultProto, int defaultPort)
Definition: httpsession.c:39
GWENHYWFAR_API void GWEN_HttpSession_free(GWEN_HTTP_SESSION *sess)
Definition: httpsession.c:65
GWENHYWFAR_API void GWEN_HttpSession_SetHttpVMajor(GWEN_HTTP_SESSION *sess, int i)
Definition: httpsession.c:184
GWENHYWFAR_API const char * GWEN_HttpSession_GetHttpUserAgent(const GWEN_HTTP_SESSION *sess)
Definition: httpsession.c:131
GWENHYWFAR_API int GWEN_HttpSession_GetHttpVMinor(const GWEN_HTTP_SESSION *sess)
Definition: httpsession.c:193
GWENHYWFAR_API int GWEN_HttpSession_Fini(GWEN_HTTP_SESSION *sess)
Definition: httpsession.c:282
GWENHYWFAR_API int GWEN_HttpSession_RecvPacket(GWEN_HTTP_SESSION *sess, GWEN_BUFFER *buf)
Definition: httpsession.c:455