update.patch 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527
  1. diff -Naur old/libsoup/soup-date.h new/libsoup/soup-date.h
  2. --- old/libsoup/soup-date.h 2017-02-10 01:35:49.989098347 -0300
  3. +++ new/libsoup/soup-date.h 2017-02-10 01:57:25.820430907 -0300
  4. @@ -7,7 +7,7 @@
  5. #define SOUP_DATE_H 1
  6. #include <time.h>
  7. -#include <glib/gmacros.h>
  8. +#include <glib.h>
  9. G_BEGIN_DECLS
  10. diff -Naur old/libsoup/soup-gnutls.c new/libsoup/soup-gnutls.c
  11. --- old/libsoup/soup-gnutls.c 2017-02-10 01:35:50.009097801 -0300
  12. +++ new/libsoup/soup-gnutls.c 2017-02-10 01:55:37.232919388 -0300
  13. @@ -31,7 +31,7 @@
  14. #define DH_BITS 1024
  15. struct SoupSSLCredentials {
  16. - gnutls_certificate_credentials creds;
  17. + gnutls_certificate_credentials_t creds;
  18. gboolean have_ca_file;
  19. };
  20. @@ -39,7 +39,7 @@
  21. GIOChannel channel;
  22. int fd;
  23. GIOChannel *real_sock;
  24. - gnutls_session session;
  25. + gnutls_session_t session;
  26. SoupSSLCredentials *creds;
  27. char *hostname;
  28. gboolean established;
  29. @@ -47,11 +47,15 @@
  30. } SoupGNUTLSChannel;
  31. static gboolean
  32. -verify_certificate (gnutls_session session, const char *hostname, GError **err)
  33. +verify_certificate (gnutls_session_t session, const char *hostname, GError **err)
  34. {
  35. + gnutls_typed_vdata_st dns_hostname_data;
  36. int status;
  37. - status = gnutls_certificate_verify_peers (session);
  38. + dns_hostname_data.type = GNUTLS_DT_DNS_HOSTNAME;
  39. + dns_hostname_data.data = hostname;
  40. + dns_hostname_data.size = sizeof(hostname);
  41. + gnutls_certificate_verify_peers (session, &dns_hostname_data, 1, &status);
  42. if (status == GNUTLS_E_NO_CERTIFICATE_FOUND) {
  43. g_set_error (err, SOUP_SSL_ERROR,
  44. @@ -97,7 +101,7 @@
  45. "Error initializing SSL certificate.");
  46. return FALSE;
  47. }
  48. -
  49. +
  50. cert_list = gnutls_certificate_get_peers (
  51. session, &cert_list_size);
  52. diff -Naur old/libsoup/soup-portability.h new/libsoup/soup-portability.h
  53. --- old/libsoup/soup-portability.h 2017-02-10 01:35:49.922433498 -0300
  54. +++ new/libsoup/soup-portability.h 2017-02-10 00:36:13.098107354 -0300
  55. @@ -6,7 +6,7 @@
  56. #ifndef SOUP_PORTABILITY_H
  57. #define SOUP_PORTABILITY_H
  58. -#include <glibconfig.h>
  59. +#include <glib.h>
  60. #ifdef G_OS_WIN32
  61. diff -Naur old/libsoup/soup-types.h new/libsoup/soup-types.h
  62. --- old/libsoup/soup-types.h 2017-02-10 01:35:49.989098347 -0300
  63. +++ new/libsoup/soup-types.h 2017-02-10 01:01:39.436418562 -0300
  64. @@ -6,7 +6,7 @@
  65. #ifndef SOUP_TYPES_H
  66. #define SOUP_TYPES_H 1
  67. -#include <glib/gtypes.h>
  68. +#include <glib.h>
  69. #include <glib-object.h>
  70. #include <libsoup/soup-status.h>
  71. diff -Naur old/tests/context-test.c new/tests/context-test.c
  72. --- old/tests/context-test.c 2017-02-10 02:13:38.945262431 -0300
  73. +++ new/tests/context-test.c 2017-02-10 02:13:20.739447586 -0300
  74. @@ -28,7 +28,7 @@
  75. char *base_uri;
  76. static void
  77. -dprintf (const char *format, ...)
  78. +_dprintf (const char *format, ...)
  79. {
  80. va_list args;
  81. @@ -168,7 +168,7 @@
  82. {
  83. GMainLoop *loop;
  84. - dprintf ("Test 1: blocking the main thread does not block other thread\n");
  85. + _dprintf ("Test 1: blocking the main thread does not block other thread\n");
  86. test1_cond = g_cond_new ();
  87. test1_mutex = g_mutex_new ();
  88. @@ -196,7 +196,7 @@
  89. if (g_cond_timed_wait (test1_cond, test1_mutex, &time))
  90. g_thread_join (thread);
  91. else {
  92. - dprintf (" timeout!\n");
  93. + _dprintf (" timeout!\n");
  94. errors++;
  95. }
  96. @@ -232,17 +232,17 @@
  97. uri = g_build_filename (base_uri, "slow", NULL);
  98. - dprintf (" send_message\n");
  99. + _dprintf (" send_message\n");
  100. msg = soup_message_new ("GET", uri);
  101. soup_session_send_message (session, msg);
  102. if (msg->status_code != SOUP_STATUS_OK) {
  103. - dprintf (" unexpected status: %d %s\n",
  104. + _dprintf (" unexpected status: %d %s\n",
  105. msg->status_code, msg->reason_phrase);
  106. errors++;
  107. }
  108. g_object_unref (msg);
  109. - dprintf (" queue_message\n");
  110. + _dprintf (" queue_message\n");
  111. msg = soup_message_new ("GET", uri);
  112. loop = g_main_loop_new (async_context, FALSE);
  113. g_object_ref (msg);
  114. @@ -250,7 +250,7 @@
  115. g_main_loop_run (loop);
  116. g_main_loop_unref (loop);
  117. if (msg->status_code != SOUP_STATUS_OK) {
  118. - dprintf (" unexpected status: %d %s\n",
  119. + _dprintf (" unexpected status: %d %s\n",
  120. msg->status_code, msg->reason_phrase);
  121. errors++;
  122. }
  123. @@ -279,7 +279,7 @@
  124. char *uri;
  125. SoupMessage *msg;
  126. - dprintf ("Test 2: a session with its own context is independent of the main loop.\n");
  127. + _dprintf ("Test 2: a session with its own context is independent of the main loop.\n");
  128. idle = g_idle_add_full (G_PRIORITY_HIGH, idle_test2_fail, NULL, NULL);
  129. @@ -291,11 +291,11 @@
  130. uri = g_build_filename (base_uri, "slow", NULL);
  131. - dprintf (" send_message\n");
  132. + _dprintf (" send_message\n");
  133. msg = soup_message_new ("GET", uri);
  134. soup_session_send_message (session, msg);
  135. if (msg->status_code != SOUP_STATUS_OK) {
  136. - dprintf (" unexpected status: %d %s\n",
  137. + _dprintf (" unexpected status: %d %s\n",
  138. msg->status_code, msg->reason_phrase);
  139. errors++;
  140. }
  141. @@ -311,7 +311,7 @@
  142. static gboolean
  143. idle_test2_fail (gpointer user_data)
  144. {
  145. - dprintf (" idle ran!\n");
  146. + _dprintf (" idle ran!\n");
  147. errors++;
  148. return FALSE;
  149. }
  150. @@ -356,7 +356,7 @@
  151. g_free (base_uri);
  152. g_main_context_unref (g_main_context_default ());
  153. - dprintf ("\n");
  154. + _dprintf ("\n");
  155. if (errors) {
  156. printf ("context-test: %d error(s). Run with '-d' for details\n",
  157. errors);
  158. diff -Naur old/tests/header-parsing.c new/tests/header-parsing.c
  159. --- old/tests/header-parsing.c 2017-02-10 02:13:38.871932506 -0300
  160. +++ new/tests/header-parsing.c 2017-02-10 02:23:46.022468627 -0300
  161. @@ -10,7 +10,7 @@
  162. gboolean debug = FALSE;
  163. static void
  164. -dprintf (const char *format, ...)
  165. +_dprintf (const char *format, ...)
  166. {
  167. va_list args;
  168. @@ -455,7 +455,7 @@
  169. print_header (gpointer key, gpointer value, gpointer data)
  170. {
  171. GSList *values = value;
  172. - dprintf (" '%s': '%s'\n",
  173. + _dprintf (" '%s': '%s'\n",
  174. (char *)key, (char*)values->data);
  175. }
  176. @@ -480,11 +480,11 @@
  177. SoupHttpVersion version;
  178. GHashTable *headers;
  179. - dprintf ("Request tests\n");
  180. + _dprintf ("Request tests\n");
  181. for (i = 0; i < 1; i++) {
  182. gboolean ok = TRUE;
  183. - dprintf ("%2d. %s (%s): ", i + 1, reqtests[i].description,
  184. + _dprintf ("%2d. %s (%s): ", i + 1, reqtests[i].description,
  185. reqtests[i].method ? "should parse" : "should NOT parse");
  186. headers = g_hash_table_new_full (g_str_hash, g_str_equal,
  187. @@ -519,34 +519,34 @@
  188. }
  189. if (ok)
  190. - dprintf ("OK!\n");
  191. + _dprintf ("OK!\n");
  192. else {
  193. - dprintf ("BAD!\n");
  194. + _dprintf ("BAD!\n");
  195. errors++;
  196. if (reqtests[i].method) {
  197. - dprintf (" expected: '%s' '%s' 'HTTP/1.%d'\n",
  198. + _dprintf (" expected: '%s' '%s' 'HTTP/1.%d'\n",
  199. reqtests[i].method, reqtests[i].path,
  200. reqtests[i].version);
  201. for (h = 0; reqtests[i].headers[h].name; h++) {
  202. - dprintf (" '%s': '%s'\n",
  203. + _dprintf (" '%s': '%s'\n",
  204. reqtests[i].headers[h].name,
  205. reqtests[i].headers[h].value);
  206. }
  207. } else
  208. - dprintf (" expected: parse error\n");
  209. + _dprintf (" expected: parse error\n");
  210. if (method) {
  211. - dprintf (" got: '%s' '%s' 'HTTP/1.%d'\n",
  212. + _dprintf (" got: '%s' '%s' 'HTTP/1.%d'\n",
  213. method, path, version);
  214. g_hash_table_foreach (headers, print_header, NULL);
  215. } else
  216. - dprintf (" got: parse error\n");
  217. + _dprintf (" got: parse error\n");
  218. }
  219. g_free (method);
  220. g_free (path);
  221. g_hash_table_destroy (headers);
  222. }
  223. - dprintf ("\n");
  224. + _dprintf ("\n");
  225. return errors;
  226. }
  227. @@ -561,11 +561,11 @@
  228. SoupHttpVersion version;
  229. GHashTable *headers;
  230. - dprintf ("Response tests\n");
  231. + _dprintf ("Response tests\n");
  232. for (i = 0; i < num_resptests; i++) {
  233. gboolean ok = TRUE;
  234. - dprintf ("%2d. %s (%s): ", i + 1, resptests[i].description,
  235. + _dprintf ("%2d. %s (%s): ", i + 1, resptests[i].description,
  236. resptests[i].reason_phrase ? "should parse" : "should NOT parse");
  237. headers = g_hash_table_new_full (g_str_hash, g_str_equal,
  238. @@ -600,34 +600,34 @@
  239. }
  240. if (ok)
  241. - dprintf ("OK!\n");
  242. + _dprintf ("OK!\n");
  243. else {
  244. - dprintf ("BAD!\n");
  245. + _dprintf ("BAD!\n");
  246. errors++;
  247. if (resptests[i].reason_phrase) {
  248. - dprintf (" expected: 'HTTP/1.%d' '%03d' '%s'\n",
  249. + _dprintf (" expected: 'HTTP/1.%d' '%03d' '%s'\n",
  250. resptests[i].version,
  251. resptests[i].status_code,
  252. resptests[i].reason_phrase);
  253. for (h = 0; resptests[i].headers[h].name; h++) {
  254. - dprintf (" '%s': '%s'\n",
  255. + _dprintf (" '%s': '%s'\n",
  256. resptests[i].headers[h].name,
  257. resptests[i].headers[h].value);
  258. }
  259. } else
  260. - dprintf (" expected: parse error\n");
  261. + _dprintf (" expected: parse error\n");
  262. if (reason_phrase) {
  263. - dprintf (" got: 'HTTP/1.%d' '%03d' '%s'\n",
  264. + _dprintf (" got: 'HTTP/1.%d' '%03d' '%s'\n",
  265. version, status_code, reason_phrase);
  266. g_hash_table_foreach (headers, print_header, NULL);
  267. } else
  268. - dprintf (" got: parse error\n");
  269. + _dprintf (" got: parse error\n");
  270. }
  271. g_free (reason_phrase);
  272. g_hash_table_destroy (headers);
  273. }
  274. - dprintf ("\n");
  275. + _dprintf ("\n");
  276. return errors;
  277. }
  278. @@ -651,7 +651,7 @@
  279. errors = do_request_tests ();
  280. errors += do_response_tests ();
  281. - dprintf ("\n");
  282. + _dprintf ("\n");
  283. if (errors) {
  284. printf ("header-parsing: %d error(s). Run with '-d' for details\n",
  285. errors);
  286. diff -Naur old/tests/ntlm-test.c new/tests/ntlm-test.c
  287. --- old/tests/ntlm-test.c 2017-02-10 02:13:38.945262431 -0300
  288. +++ new/tests/ntlm-test.c 2017-02-10 02:25:13.617865774 -0300
  289. @@ -29,7 +29,7 @@
  290. gboolean debug = FALSE;
  291. static void
  292. -dprintf (const char *format, ...)
  293. +_dprintf (const char *format, ...)
  294. {
  295. va_list args;
  296. @@ -219,58 +219,58 @@
  297. G_CALLBACK (ntlm_response_check), &state);
  298. soup_session_send_message (session, msg);
  299. - dprintf (" %-10s -> ", path);
  300. + _dprintf (" %-10s -> ", path);
  301. if (state.got_prompt) {
  302. - dprintf (" PROMPT");
  303. + _dprintf (" PROMPT");
  304. if (!get_prompt) {
  305. - dprintf ("???");
  306. + _dprintf ("???");
  307. errors++;
  308. }
  309. } else if (get_prompt) {
  310. - dprintf (" no-prompt???");
  311. + _dprintf (" no-prompt???");
  312. errors++;
  313. }
  314. if (state.sent_request) {
  315. - dprintf (" REQUEST");
  316. + _dprintf (" REQUEST");
  317. if (!do_ntlm) {
  318. - dprintf ("???");
  319. + _dprintf ("???");
  320. errors++;
  321. }
  322. } else if (do_ntlm) {
  323. - dprintf (" no-request???");
  324. + _dprintf (" no-request???");
  325. errors++;
  326. }
  327. if (state.got_challenge) {
  328. - dprintf (" CHALLENGE");
  329. + _dprintf (" CHALLENGE");
  330. if (!do_ntlm) {
  331. - dprintf ("???");
  332. + _dprintf ("???");
  333. errors++;
  334. }
  335. } else if (do_ntlm) {
  336. - dprintf (" no-challenge???");
  337. + _dprintf (" no-challenge???");
  338. errors++;
  339. }
  340. if (state.sent_response) {
  341. - dprintf (" RESPONSE");
  342. + _dprintf (" RESPONSE");
  343. if (!do_ntlm) {
  344. - dprintf ("???");
  345. + _dprintf ("???");
  346. errors++;
  347. }
  348. } else if (do_ntlm) {
  349. - dprintf (" no-response???");
  350. + _dprintf (" no-response???");
  351. errors++;
  352. }
  353. - dprintf (" -> %s", msg->reason_phrase);
  354. + _dprintf (" -> %s", msg->reason_phrase);
  355. if (msg->status_code != status_code) {
  356. - dprintf ("???");
  357. + _dprintf ("???");
  358. errors++;
  359. }
  360. - dprintf ("\n");
  361. + _dprintf ("\n");
  362. g_object_unref (msg);
  363. return errors;
  364. @@ -327,11 +327,11 @@
  365. {
  366. int errors = 0;
  367. - dprintf ("Round 1: Non-NTLM Connection\n");
  368. + _dprintf ("Round 1: Non-NTLM Connection\n");
  369. errors += do_ntlm_round (base_uri, NULL);
  370. - dprintf ("Round 2: NTLM Connection, user=alice\n");
  371. + _dprintf ("Round 2: NTLM Connection, user=alice\n");
  372. errors += do_ntlm_round (base_uri, "alice");
  373. - dprintf ("Round 3: NTLM Connection, user=bob\n");
  374. + _dprintf ("Round 3: NTLM Connection, user=bob\n");
  375. errors += do_ntlm_round (base_uri, "bob");
  376. return errors;
  377. @@ -397,7 +397,7 @@
  378. g_hash_table_destroy (connections);
  379. g_main_context_unref (g_main_context_default ());
  380. - dprintf ("\n");
  381. + _dprintf ("\n");
  382. if (errors) {
  383. printf ("ntlm-test: %d error(s). Run with '-d' for details\n",
  384. errors);
  385. diff -Naur old/tests/uri-parsing.c new/tests/uri-parsing.c
  386. --- old/tests/uri-parsing.c 2017-02-10 02:13:38.871932506 -0300
  387. +++ new/tests/uri-parsing.c 2017-02-10 02:26:01.758934976 -0300
  388. @@ -10,7 +10,7 @@
  389. gboolean debug = FALSE;
  390. static void
  391. -dprintf (const char *format, ...)
  392. +_dprintf (const char *format, ...)
  393. {
  394. va_list args;
  395. @@ -113,21 +113,21 @@
  396. char *uri_string;
  397. if (base_uri) {
  398. - dprintf ("<%s> + <%s> = <%s>? ", base_str, in_uri,
  399. + _dprintf ("<%s> + <%s> = <%s>? ", base_str, in_uri,
  400. out_uri ? out_uri : "ERR");
  401. uri = soup_uri_new_with_base (base_uri, in_uri);
  402. } else {
  403. - dprintf ("<%s> => <%s>? ", in_uri,
  404. + _dprintf ("<%s> => <%s>? ", in_uri,
  405. out_uri ? out_uri : "ERR");
  406. uri = soup_uri_new (in_uri);
  407. }
  408. if (!uri) {
  409. if (out_uri) {
  410. - dprintf ("ERR\n Could not parse %s\n", in_uri);
  411. + _dprintf ("ERR\n Could not parse %s\n", in_uri);
  412. return FALSE;
  413. } else {
  414. - dprintf ("OK\n");
  415. + _dprintf ("OK\n");
  416. return TRUE;
  417. }
  418. }
  419. @@ -136,18 +136,18 @@
  420. soup_uri_free (uri);
  421. if (!out_uri) {
  422. - dprintf ("ERR\n Got %s\n", uri_string);
  423. + _dprintf ("ERR\n Got %s\n", uri_string);
  424. return FALSE;
  425. }
  426. if (strcmp (uri_string, out_uri) != 0) {
  427. - dprintf ("NO\n Unparses to <%s>\n", uri_string);
  428. + _dprintf ("NO\n Unparses to <%s>\n", uri_string);
  429. g_free (uri_string);
  430. return FALSE;
  431. }
  432. g_free (uri_string);
  433. - dprintf ("OK\n");
  434. + _dprintf ("OK\n");
  435. return TRUE;
  436. }
  437. @@ -169,14 +169,14 @@
  438. }
  439. }
  440. - dprintf ("Absolute URI parsing\n");
  441. + _dprintf ("Absolute URI parsing\n");
  442. for (i = 0; i < num_abs_tests; i++) {
  443. if (!do_uri (NULL, NULL, abs_tests[i].uri_string,
  444. abs_tests[i].result))
  445. errs++;
  446. }
  447. - dprintf ("\nRelative URI parsing\n");
  448. + _dprintf ("\nRelative URI parsing\n");
  449. base_uri = soup_uri_new (base);
  450. if (!base_uri) {
  451. fprintf (stderr, "Could not parse %s!\n", base);
  452. @@ -198,7 +198,7 @@
  453. }
  454. soup_uri_free (base_uri);
  455. - dprintf ("\n");
  456. + _dprintf ("\n");
  457. if (errs) {
  458. printf ("uri-parsing: %d error(s). Run with '-d' for details\n",
  459. errs);