6 * Copyright (C) 2010 SIPE Project <http://sipe.sourceforge.net/>
7 * Copyright (C) 2009 pier11 <pier11@operamail.com>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 /* Forward declarations */
25 struct sipe_core_public
;
27 #define HTTP_CONN_GET "GET"
28 #define HTTP_CONN_POST "POST"
30 #define HTTP_CONN_SSL SIPE_TRANSPORT_TLS
31 #define HTTP_CONN_TCP SIPE_TRANSPORT_TCP
33 #define HTTP_CONN_ALLOW_REDIRECT TRUE
34 #define HTTP_CONN_NO_REDIRECT FALSE
36 #define HTTP_CONN_ERROR -100
37 #define HTTP_CONN_ERROR_FATAL -200
40 struct http_conn_auth
{
46 typedef struct http_conn_auth HttpConnAuth
;
48 struct http_conn_struct
;
49 typedef struct http_conn_struct HttpConn
;
50 typedef struct http_session_struct HttpSession
;
53 typedef void (*HttpConnCallback
) (int return_code
, const char *body
, GSList
* headers
,
54 HttpConn
*conn
, void *data
);
57 * Creates SSL connection and sends.
60 http_conn_create(struct sipe_core_public
*sipe_public
,
61 HttpSession
*http_session
,
64 gboolean allow_redirect
,
67 const char *content_type
,
68 const gchar
*additional_headers
,
70 HttpConnCallback callback
,
74 * Sends on existing http_conn connection.
77 http_conn_send( HttpConn
*http_conn
,
81 const char *content_type
,
82 HttpConnCallback callback
,
86 http_conn_is_closed(HttpConn
*http_conn
);
89 * Marks connection for close
92 http_conn_set_close(HttpConn
* http_conn
);
95 http_conn_free(HttpConn
* http_conn
);
98 http_conn_session_create(void);
101 http_conn_session_free(HttpSession
*http_session
);