annotate libpurple/protocols/jabber/bosh.h @ 28133:3eef8392a54b

jabber: Add a BOSH send timer (queue up stanzas), fixes connecting to Prosody This send timer shouldn't strictly be necessary, but Prosody currently closes the TCP stream after every response (MattJ tells me there's a pipelining bug that they couldn't fix, so they just disabled it), but in my tests, the initial purple_ssl_read doesn't catch the EOF/disconnection (the read returns EAGAIN), so the prpl, while processing the response from the server, thinks that BOSH connection is still open, and tries to send to send to it. *Then*, the write input watcher triggers and read returns 0 (EOF). The request that was sent is then lost. Anyway, I've termed Prosody a fuzzer for BOSH. :-)
author Paul Aurich <paul@darkrain42.org>
date Sun, 02 Aug 2009 03:00:00 +0000
parents 374c4e3a73f0
children c585572e80dd
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
25596
7768cad83127 * looking for alternative connection methods if direct connection fails
Tobias Markmann <tfar@soc.pidgin.im>
parents:
diff changeset
1 /**
26741
374c4e3a73f0 Header file cleanup
Paul Aurich <paul@darkrain42.org>
parents: 26530
diff changeset
2 * @file bosh.h Bidirectional-streams over Synchronous HTTP (BOSH) (XEP-0124 and XEP-0206)
25596
7768cad83127 * looking for alternative connection methods if direct connection fails
Tobias Markmann <tfar@soc.pidgin.im>
parents:
diff changeset
3 *
7768cad83127 * looking for alternative connection methods if direct connection fails
Tobias Markmann <tfar@soc.pidgin.im>
parents:
diff changeset
4 * purple
7768cad83127 * looking for alternative connection methods if direct connection fails
Tobias Markmann <tfar@soc.pidgin.im>
parents:
diff changeset
5 *
7768cad83127 * looking for alternative connection methods if direct connection fails
Tobias Markmann <tfar@soc.pidgin.im>
parents:
diff changeset
6 * Copyright (C) 2008, Tobias Markmann <tmarkmann@googlemail.com>
7768cad83127 * looking for alternative connection methods if direct connection fails
Tobias Markmann <tfar@soc.pidgin.im>
parents:
diff changeset
7 *
7768cad83127 * looking for alternative connection methods if direct connection fails
Tobias Markmann <tfar@soc.pidgin.im>
parents:
diff changeset
8 * This program is free software; you can redistribute it and/or modify
7768cad83127 * looking for alternative connection methods if direct connection fails
Tobias Markmann <tfar@soc.pidgin.im>
parents:
diff changeset
9 * it under the terms of the GNU General Public License as published by
7768cad83127 * looking for alternative connection methods if direct connection fails
Tobias Markmann <tfar@soc.pidgin.im>
parents:
diff changeset
10 * the Free Software Foundation; either version 2 of the License, or
7768cad83127 * looking for alternative connection methods if direct connection fails
Tobias Markmann <tfar@soc.pidgin.im>
parents:
diff changeset
11 * (at your option) any later version.
7768cad83127 * looking for alternative connection methods if direct connection fails
Tobias Markmann <tfar@soc.pidgin.im>
parents:
diff changeset
12 *
7768cad83127 * looking for alternative connection methods if direct connection fails
Tobias Markmann <tfar@soc.pidgin.im>
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful,
7768cad83127 * looking for alternative connection methods if direct connection fails
Tobias Markmann <tfar@soc.pidgin.im>
parents:
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
7768cad83127 * looking for alternative connection methods if direct connection fails
Tobias Markmann <tfar@soc.pidgin.im>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7768cad83127 * looking for alternative connection methods if direct connection fails
Tobias Markmann <tfar@soc.pidgin.im>
parents:
diff changeset
16 * GNU General Public License for more details.
7768cad83127 * looking for alternative connection methods if direct connection fails
Tobias Markmann <tfar@soc.pidgin.im>
parents:
diff changeset
17 *
7768cad83127 * looking for alternative connection methods if direct connection fails
Tobias Markmann <tfar@soc.pidgin.im>
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License
7768cad83127 * looking for alternative connection methods if direct connection fails
Tobias Markmann <tfar@soc.pidgin.im>
parents:
diff changeset
19 * along with this program; if not, write to the Free Software
7768cad83127 * looking for alternative connection methods if direct connection fails
Tobias Markmann <tfar@soc.pidgin.im>
parents:
diff changeset
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
7768cad83127 * looking for alternative connection methods if direct connection fails
Tobias Markmann <tfar@soc.pidgin.im>
parents:
diff changeset
21 */
26741
374c4e3a73f0 Header file cleanup
Paul Aurich <paul@darkrain42.org>
parents: 26530
diff changeset
22 #ifndef PURPLE_JABBER_BOSH_H_
374c4e3a73f0 Header file cleanup
Paul Aurich <paul@darkrain42.org>
parents: 26530
diff changeset
23 #define PURPLE_JABBER_BOSH_H_
25596
7768cad83127 * looking for alternative connection methods if direct connection fails
Tobias Markmann <tfar@soc.pidgin.im>
parents:
diff changeset
24
25600
1cbe5a9f6efb * adding bosh files to Makefile.am & .mingw
Tobias Markmann <tfar@soc.pidgin.im>
parents: 25598
diff changeset
25 typedef struct _PurpleBOSHConnection PurpleBOSHConnection;
25598
b238da95f39a * some refactoring
Tobias Markmann <tfar@soc.pidgin.im>
parents: 25596
diff changeset
26
25776
7de1f124f95a Jabber BOSH: Many fixes
Paul Aurich <paul@darkrain42.org>
parents: 25610
diff changeset
27 #include "jabber.h"
25600
1cbe5a9f6efb * adding bosh files to Makefile.am & .mingw
Tobias Markmann <tfar@soc.pidgin.im>
parents: 25598
diff changeset
28
25777
17b60b844803 Jabber BOSH: more fixes.
Paul Aurich <paul@darkrain42.org>
parents: 25776
diff changeset
29 void jabber_bosh_init(void);
17b60b844803 Jabber BOSH: more fixes.
Paul Aurich <paul@darkrain42.org>
parents: 25776
diff changeset
30 void jabber_bosh_uninit(void);
17b60b844803 Jabber BOSH: more fixes.
Paul Aurich <paul@darkrain42.org>
parents: 25776
diff changeset
31
25776
7de1f124f95a Jabber BOSH: Many fixes
Paul Aurich <paul@darkrain42.org>
parents: 25610
diff changeset
32 PurpleBOSHConnection* jabber_bosh_connection_init(JabberStream *js, const char *url);
25777
17b60b844803 Jabber BOSH: more fixes.
Paul Aurich <paul@darkrain42.org>
parents: 25776
diff changeset
33 void jabber_bosh_connection_destroy(PurpleBOSHConnection *conn);
17b60b844803 Jabber BOSH: more fixes.
Paul Aurich <paul@darkrain42.org>
parents: 25776
diff changeset
34
26354
fcee93c74230 BOSH: For authentication purposes, HTTPS is equivalent to a secured JabberStream.
Paul Aurich <paul@darkrain42.org>
parents: 25778
diff changeset
35 gboolean jabber_bosh_connection_is_ssl(PurpleBOSHConnection *conn);
fcee93c74230 BOSH: For authentication purposes, HTTPS is equivalent to a secured JabberStream.
Paul Aurich <paul@darkrain42.org>
parents: 25778
diff changeset
36
25600
1cbe5a9f6efb * adding bosh files to Makefile.am & .mingw
Tobias Markmann <tfar@soc.pidgin.im>
parents: 25598
diff changeset
37 void jabber_bosh_connection_connect(PurpleBOSHConnection *conn);
25777
17b60b844803 Jabber BOSH: more fixes.
Paul Aurich <paul@darkrain42.org>
parents: 25776
diff changeset
38 void jabber_bosh_connection_close(PurpleBOSHConnection *conn);
26530
d4af753e0e33 Pass all messages to BOSH as text, so they pass through the sending-text
Paul Aurich <paul@darkrain42.org>
parents: 26354
diff changeset
39 void jabber_bosh_connection_send_raw(PurpleBOSHConnection *conn, const char *data);
26741
374c4e3a73f0 Header file cleanup
Paul Aurich <paul@darkrain42.org>
parents: 26530
diff changeset
40 #endif /* PURPLE_JABBER_BOSH_H_ */