soc.2008.xmpp: 99542a49: * some refactoring

tfar at soc.pidgin.im tfar at soc.pidgin.im
Sun Aug 3 18:55:39 EDT 2008


-----------------------------------------------------------------
Revision: 99542a49e993a03d38de798cde1979a4901998e2
Ancestor: 8b86cecf9b220c8c8caae1564356469cebf82fd4
Author: tfar at soc.pidgin.im
Date: 2008-08-03T22:50:13
Branch: im.pidgin.soc.2008.xmpp
URL: http://d.pidgin.im/viewmtn/revision/info/99542a49e993a03d38de798cde1979a4901998e2

Modified files:
        libpurple/protocols/jabber/bosh.c
        libpurple/protocols/jabber/bosh.h

ChangeLog: 

* some refactoring

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/bosh.c	011efc14eb01eb45a435ae8a01cf74de70e18265
+++ libpurple/protocols/jabber/bosh.c	b848bb9c2bc73b09db310bae9222629bad980ae7
@@ -37,3 +37,13 @@
 #include "pep.h"
 #include "adhoccommands.h"
 
+PurpleHTTPHeaderField* jabber_bosh_http_header_field(const char *name, *const char *value) {
+	PurpleHTTPHeaderField *tmp = g_new0(PurpleHTTPHeaderField, 0);
+	tmp->name = g_strdup(name);
+	tmp->value = g_strdup(value);
+	return tmp;
+}
+
+void jabber_bosh_http_connection_connect(PurpleHTTPConnection *conn) {
+	
+}
============================================================
--- libpurple/protocols/jabber/bosh.h	f852f17c88140b0db215acc746b013f8bde7c185
+++ libpurple/protocols/jabber/bosh.h	47b44b75394e8ac8e4636be5956a3d970bec4d36
@@ -22,13 +22,54 @@
 #ifndef _PURPLE_JABBER_BOSH_H_
 #define _PURPLE_JABBER_BOSH_H_
 
+#include <glib.h>
+
+typedef struct _PurpleHTTPRequest PurpleHTTPRequest;
+typedef struct _PurpleHTTPResponse PurpleHTTPResponse;
+typedef struct _PurpleHTTPHeaderField PurpleHTTPHeaderField;
+
+typedef void (*PurpleHTTPRequestCallback)(PurpleHTTPRequest *req, PurpleHTTPResponse *res, void *userdata);
+
 typedef struct {
+    int fd;
+    PurpleConnection *conn;
+    GQueue *requests;
+    void *userdata;
+} PurpleHTTPConnection;
+
+typedef struct {
     char *url;
     gboolean pipelining;
+    PurpleHTTPConnection *conn_a;
+    PurpleHTTPConnection *conn_b;
 } PurpleBOSHConnection;
 
-typedef struct {
-    
-} PurpleHTTPRequest;
+struct _PurpleHTTPRequest {
+    PurpleHTTPRequestCallback cb;
+    char *method;
+    char *url;
+    GList *header;
+    char *data;
+    void *userdata;
+};
 
+struct _PurpleHTTPResponse {
+    int status;
+    GList *header;
+    char *data;
+};
+
+struct _PurpleHTTPHeaderField {
+    char *name;
+    char *value;
+};
+
+PurpleHTTPHeaderField *jabber_bosh_http_header_field(const char *name, const char *value);
+
+void jabber_bosh_http_connection_connect(PurpleHTTPConnection *conn);
+void jabber_bosh_http_send_request(PurpleHTTPConnection *conn, PurpleHTTPRequest *req);
+void jabber_bosh_http_connection_clean(PurpleHTTPConnection *conn);
+
+void jabber_bosh_http_request_init(PurpleHTTPRequest *req, const char *method, const char *url, PurpleHTTPRequestCallback cb, void *userdata);
+void jabber_bosh_http_request_clean(PurpleHTTPRequest *req);
 #endif /* _PURPLE_JABBER_BOSH_H_ */


More information about the Commits mailing list