http: add support TCP transport
[siplcs.git] / src / core / sipe-http-transport.h
blob06b5a814e0c0489d94a07a5bac71377000f5fc8d
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 */
45 gchar *host;
46 guint32 port;
47 gboolean connected;
50 /**
51 * Check if we're shutting down the HTTP stack
53 * @param sipe_private SIPE core private data
55 * @return return @c TRUE if HTTP stack is shutting down
57 gboolean sipe_http_shutting_down(struct sipe_core_private *sipe_private);
59 /**
60 * Initiate HTTP connection
62 * If a connection to this host/port already exists it will be reused.
64 * @param sipe_private SIPE core private data
65 * @param host name of the host to connect to
66 * @param port port number to connect to
67 * @param use_tls use TLS if @c TRUE, otherwise TCP
69 * @return HTTP connection public data
71 struct sipe_http_connection_public *sipe_http_transport_new(struct sipe_core_private *sipe_private,
72 const gchar *host,
73 guint32 port,
74 gboolean use_tls);
76 /**
77 * Send HTTP request
79 * @param conn_public HTTP connection public data
80 * @param header HTTP header
81 * @param body HTTP body (may be @c NULL)
83 void sipe_http_transport_send(struct sipe_http_connection_public *conn_public,
84 const gchar *header,
85 const gchar *body);