6 * Copyright (C) 2009 pier11 <pier11@operamail.com>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 /* Forward declarations */
24 struct _PurpleAccount
;
26 #define HTTP_CONN_SSL "SSL"
27 #define HTTP_CONN_TCP "TCP"
29 #define HTTP_CONN_ERROR -100
30 #define HTTP_CONN_ERROR_FATAL -200
32 struct http_conn_auth
{
38 typedef struct http_conn_auth HttpConnAuth
;
40 struct http_conn_struct
;
41 typedef struct http_conn_struct HttpConn
;
44 typedef void (*HttpConnCallback
) (int return_code
, const char *body
,
45 HttpConn
*conn
, void *data
);
48 * Creates SSL connection and POST.
51 http_conn_create(struct _PurpleAccount
*account
,
52 const char *conn_type
,
55 const char *content_type
,
57 HttpConnCallback callback
,
61 * POST on existing http_conn connection.
64 http_conn_post( HttpConn
*http_conn
,
67 const char *content_type
,
68 HttpConnCallback callback
,
72 * Marks connection for close
75 http_conn_set_close(HttpConn
* http_conn
);
78 http_conn_auth_free(struct http_conn_auth
* auth
);