[Debian-on-mobile-maintainers] [Git][DebianOnMobile-team/purple-xmpp-http-upload][upstream/latest] 4 commits: Fix windows/mingw build.

Arnaud Ferraris (@a-wai) gitlab at salsa.debian.org
Tue Dec 7 20:01:19 GMT 2021



Arnaud Ferraris pushed to branch upstream/latest at Debian On Mobile / purple-xmpp-http-upload


Commits:
79a15c22 by Jeremy Drake at 2020-06-30T16:57:07-07:00
Fix windows/mingw build.

fbbd41 (Pull request #16) added g_autofree, which is not supported on the old version of GTK in the pidgin-windev.

Fix a size_t printf format (on Windows, size_t is not necessarily the same as unsigned long)

Fix a duplicate symbol at link by declaring HFUJabberStreamDataTable extern in the header, and only defining it in jabber_http_file_upload.c.

- - - - -
c085d10c by Eion Robb at 2021-10-04T23:36:28+13:00
Fix for Prosody servers, which don't have services on subdomains

- - - - -
812715ef by Dmitry Kosenkov at 2021-10-04T23:33:19+07:00
Merge pull request #24 from EionRobb/master

Fix for Prosody servers, which don't have services on subdomains
- - - - -
f370b4a2 by Dmitry Kosenkov at 2021-10-05T01:37:59+07:00
Merge pull request #19 from jeremydrake-eAc/fix_mingw_build

Fix windows/mingw build.
- - - - -


3 changed files:

- src/hfu_disco.c
- src/jabber_http_file_upload.c
- src/jabber_http_file_upload.h


Changes:

=====================================
src/hfu_disco.c
=====================================
@@ -107,6 +107,12 @@ void jabber_hfu_disco_items_server(JabberStream *js)
 
 	jabber_iq_set_callback(iq, jabber_hfu_disco_server_items_result_cb, NULL);
 	jabber_iq_send(iq);
+	
+	
+	iq = jabber_iq_new_query(js, JABBER_IQ_GET, NS_DISCO_INFO);
+	xmlnode_set_attrib(iq->node, "to", js->user->domain);
+	jabber_iq_set_callback(iq, jabber_hfu_disco_info_cb, NULL);
+	jabber_iq_send(iq);
 }
 
 


=====================================
src/jabber_http_file_upload.c
=====================================
@@ -44,6 +44,7 @@ static inline PurpleHttpURL *purple_http_url_parse(const gchar *url) {
     return ret;
 }
 
+GHashTable *HFUJabberStreamDataTable;
 GHashTable *ht_hfu_sending;
 
 #define purple_http_url_get_host(httpurl) (httpurl->host)
@@ -62,7 +63,7 @@ static void jabber_hfu_http_read(gpointer user_data, PurpleSslConnection *ssl_co
 
     //Read the server buffer
     size_t rl = purple_ssl_read(ssl_connection, buf, 1024);
-    purple_debug_info("jabber_http_upload", "Server file send response was %ld bytes: %s\n", rl, buf);
+    purple_debug_info("jabber_http_upload", "Server file send response was %" G_GSIZE_FORMAT " bytes: %s\n", (gsize) rl, buf);
 
     if(rl == (size_t)-1)
 	return;
@@ -84,12 +85,12 @@ static void jabber_hfu_http_read(gpointer user_data, PurpleSslConnection *ssl_co
 static void jabber_hfu_http_send_connect_cb(gpointer data, PurpleSslConnection *ssl_connection, PurpleInputCondition cond)
 {
     PurpleHttpURL *httpurl;
-    g_autofree gchar *headers, *auth = NULL, *expire = NULL, *cookie = NULL;
+    gchar *headers, *auth = NULL, *expire = NULL, *cookie = NULL;
 
     PurpleXfer *xfer = data;
     HFUXfer *hfux = purple_xfer_get_protocol_data(xfer);
     HFUJabberStreamData *js_data = hfux->js_data;
-    g_autofree char *filemime = file_get_mime(purple_xfer_get_local_filename(xfer));
+    char *filemime = file_get_mime(purple_xfer_get_local_filename(xfer));
 
     httpurl = purple_http_url_parse(hfux->put_url);
 
@@ -118,10 +119,16 @@ static void jabber_hfu_http_send_connect_cb(gpointer data, PurpleSslConnection *
 	    (filemime?:"application/octet-stream"),
 	    (auth?:""), (expire?:""), (cookie?:""));
 
+    g_free(auth);
+    g_free(expire);
+    g_free(cookie);
+    g_free(filemime);
+
     hfux->ssl_conn = ssl_connection;
     purple_ssl_input_add(ssl_connection, jabber_hfu_http_read, xfer);
 
     purple_ssl_write(ssl_connection, headers, strlen(headers));
+    g_free(headers);
 
     purple_xfer_ref(xfer);
     purple_xfer_start(xfer, ssl_connection->fd, NULL, 0);
@@ -271,8 +278,9 @@ jabber_hfu_xmlnode_send_cb(PurpleConnection *gc, xmlnode **packet, gpointer null
     if (g_strcmp0 ((*packet)->name, "message") == 0) {
       xmlnode *node_body = xmlnode_get_child (*packet, "body");
       if (node_body) {
-	g_autofree char *url = xmlnode_get_data(node_body);
+	char *url = xmlnode_get_data(node_body);
         HFUXfer *hfux = g_hash_table_lookup(ht_hfu_sending, url);
+	g_free(url);
         if(hfux) {
            xmlnode *x, *url;
            x = xmlnode_new_child (*packet, "x");


=====================================
src/jabber_http_file_upload.h
=====================================
@@ -22,4 +22,4 @@ extern GHashTable *HFUJabberStreamDataTable;
 #define NS_HTTP_FILE_UPLOAD_V0 "urn:xmpp:http:upload:0"
 
 #define purple_xfer_get_protocol_data(xfer) ((xfer)->data)
-#define purple_xfer_set_protocol_data(xfer, proto_data) ((xfer)->data = (proto_data))
\ No newline at end of file
+#define purple_xfer_set_protocol_data(xfer, proto_data) ((xfer)->data = (proto_data))



View it on GitLab: https://salsa.debian.org/DebianOnMobile-team/purple-xmpp-http-upload/-/compare/d4af6545c64fd22821c30744402f36664529425f...f370b4a2c474c6fe4098d929d8b7c18aeba87b6b

-- 
View it on GitLab: https://salsa.debian.org/DebianOnMobile-team/purple-xmpp-http-upload/-/compare/d4af6545c64fd22821c30744402f36664529425f...f370b4a2c474c6fe4098d929d8b7c18aeba87b6b
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-on-mobile-maintainers/attachments/20211207/a295de9c/attachment-0001.htm>


More information about the Debian-on-mobile-maintainers mailing list