Wed, 21 Jan 2009 00:19:33 +0000
Don't track a cb-per-POST and remove the PurpleHTTPResponse structure.
The only callback ever used is http_received_cb and the ordering of
responses from the server is not guaranteed to match the order of our requests,
so the metaphor of matching them doesn't make sense. Instead of that, just
track the number of requests (to ensure there is always a request outstanding).
Additionally, pass the data const-ified instead of copying it. It's just
fed to an XML parser anyway.
UPDATE:
Tobias pointed out my explanation was flat-out wrong. The server's replies *do*
correspond to a specific request (HTTP pipelining). I believe what I meant to
say is that the XML in the replies isn't guaranteed to correspond to the
request's payload.
In any event, the critical point is that the callback is always the same, so
there's no need to store it per-request.
| 7014 | 1 | /** |
| 2 | * @file auth.h Authentication routines | |
| 3 | * | |
| 15884 | 4 | * purple |
| 7014 | 5 | * |
| 6 | * Copyright (C) 2003 Nathan Walp <faceprint@faceprint.com> | |
| 7 | * | |
| 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. | |
| 12 | * | |
| 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. | |
| 17 | * | |
| 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 | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
15884
diff
changeset
|
20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 7014 | 21 | */ |
| 15884 | 22 | #ifndef _PURPLE_JABBER_AUTH_H_ |
| 23 | #define _PURPLE_JABBER_AUTH_H_ | |
| 7014 | 24 | |
| 25 | #include "jabber.h" | |
| 26 | #include "xmlnode.h" | |
| 27 | ||
| 8296 | 28 | gboolean jabber_process_starttls(JabberStream *js, xmlnode *packet); |
| 7014 | 29 | void jabber_auth_start(JabberStream *js, xmlnode *packet); |
| 30 | void jabber_auth_start_old(JabberStream *js); | |
| 31 | void jabber_auth_handle_challenge(JabberStream *js, xmlnode *packet); | |
| 32 | void jabber_auth_handle_success(JabberStream *js, xmlnode *packet); | |
| 33 | void jabber_auth_handle_failure(JabberStream *js, xmlnode *packet); | |
| 34 | ||
| 15884 | 35 | #endif /* _PURPLE_JABBER_AUTH_H_ */ |