2 (http://www.clearskyinstitute.com/xephem/contrib/xephem-3.7.7_openssl_earthmenu.patch)
3 is another patch from Mr. Mändl dated 2018 September. This one fixes the
4 weather map in the Earth view which also now requires https.
6 diff -Naur ./orig/xephem-3.7.7/GUI/xephem/earthmenu.c ./patched/xephem-3.7.7/GUI/xephem/earthmenu.c
\r
7 --- ./orig/xephem-3.7.7/GUI/xephem/earthmenu.c 2012-11-23 05:15:39.000000000 +0100
\r
8 +++ ./patched/xephem-3.7.7/GUI/xephem/earthmenu.c 2018-09-24 01:17:34.248048815 +0200
\r
9 @@ -4886,8 +4886,11 @@
\r
16 + memset(&ssl_fd, 0, sizeof(ssl_fd));
\r
18 /* open test case, else real network */
\r
19 fd = openh ("/tmp/latest_cmoll.gif", O_RDONLY);
\r
21 @@ -4902,12 +4905,12 @@
\r
24 /* make connection to server for the file */
\r
25 - xe_msg (0, "Getting\nhttp://%s%s", wxhost, wxfile);
\r
26 - (void) sprintf (buf, "GET http://%s%s HTTP/1.0\r\nUser-Agent: xephem/%s\r\n\r\n",
\r
27 - wxhost, wxfile, PATCHLEVEL);
\r
28 - fd = httpGET (wxhost, buf, buf);
\r
29 + xe_msg (0, "Getting\nhttps://%s%s", wxhost, wxfile);
\r
30 + (void) sprintf (buf, "GET %s HTTP/1.1\r\nHost: %s\r\nConnection: close\r\nUser-Agent: xephem/%s\r\n\r\n",
\r
31 + wxfile, wxhost, PATCHLEVEL);
\r
32 + fd = httpsGET (wxhost, buf, buf, &ssl_fd);
\r
34 - xe_msg (1, "http get:\n%s", buf);
\r
35 + xe_msg (1, "https get:\n%s", buf);
\r
39 @@ -4915,7 +4918,7 @@
\r
40 /* read header, looking for some header info */
\r
43 - while (recvline (fd, buf, sizeof(buf)) > 1) {
\r
44 + while (ssl_recvline (&ssl_fd, buf, sizeof(buf)) > 1) {
\r
45 xe_msg (0, "Rcv: %s", buf);
\r
46 if (strstr (buf, "image/gif"))
\r
48 @@ -4923,9 +4926,10 @@
\r
49 length = atoi (buf+15);
\r
52 - while (recvline (fd, buf, sizeof(buf)) > 1)
\r
53 + while (ssl_recvline (&ssl_fd, buf, sizeof(buf)) > 1)
\r
54 xe_msg (0, "Rcv: %s", buf);
\r
56 + SSL_free (ssl_fd.ssl);
\r
57 + close (ssl_fd.fd);
\r
61 @@ -4936,12 +4940,13 @@
\r
63 for (nrawgif = 0; nrawgif < sizeof(rawgif); nrawgif += nr) {
\r
64 pm_set (100*nrawgif/length);
\r
65 - nr = readbytes (fd, rawgif+nrawgif, 4096);
\r
66 + nr = SSL_read (ssl_fd.ssl, rawgif+nrawgif, 4096);
\r
68 - xe_msg (1, "%s:\n%s", wxhost, syserrstr());
\r
69 + xe_msg (1, "%s: ssl read error code: %d", wxhost, SSL_get_error(ssl_fd.ssl, nr));
\r
73 + SSL_free (ssl_fd.ssl);
\r
74 + close (ssl_fd.fd);
\r
78 @@ -4949,7 +4954,8 @@
\r
83 + SSL_free (ssl_fd.ssl);
\r
84 + close (ssl_fd.fd);
\r
86 xe_msg (1, "File too large");
\r