media: fix relay-info with Farstream 0.2
[siplcs.git] / src / core / sipe-http-transport.h
blobd82cd1bb5d5b1de270f4fdc4324ed5c470addf8d
1 /**
2 * @file sipe-http-transport.h
4 * pidgin-sipe
6 * Copyright (C) 2013 SIPE Project <http://sipe.sourceforge.net/>
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 /* Private interface between HTTP Request <-> Transport layers */
25 #ifndef _SIPE_HTTP_PRIVATE_IF_TRANSPORT
26 #error "you are not allowed to include sipe-http-transport.h!"
27 #endif
30 * Interface dependencies:
32 * <glib.h>
35 /* Forward declarations */
36 struct sipe_core_private;
37 struct sip_sec_context;
39 struct sipe_http_connection_public {
40 struct sipe_core_private *sipe_private;
42 GSList *pending_requests; /* handled by sipe-http-request.c */
43 struct sip_sec_context *context; /* handled by sipe-http-request.c */
44 gchar *cached_authorization; /* handled by sipe-http-request.c */
46 gchar *host;
47 guint32 port;
48 gboolean connected;
51 /**
52 * Check if we're shutting down the HTTP stack
54 * @param sipe_private SIPE core private data
56 * @return return @c TRUE if HTTP stack is shutting down
58 gboolean sipe_http_shutting_down(struct sipe_core_private *sipe_private);
60 /**
61 * Initiate HTTP connection
63 * If a connection to this host/port already exists it will be reused.
65 * @param sipe_private SIPE core private data
66 * @param host name of the host to connect to
67 * @param port port number to connect to
68 * @param use_tls use TLS if @c TRUE, otherwise TCP
70 * @return HTTP connection public data
72 struct sipe_http_connection_public *sipe_http_transport_new(struct sipe_core_private *sipe_private,
73 const gchar *host,
74 guint32 port,
75 gboolean use_tls);
77 /**
78 * Send HTTP request
80 * @param conn_public HTTP connection public data
81 * @param header HTTP header
82 * @param body HTTP body (may be @c NULL)
84 void sipe_http_transport_send(struct sipe_http_connection_public *conn_public,
85 const gchar *header,
86 const gchar *body);