How to enable --ipv4 for pull?
(1) By anonymous on 2025-03-21 07:53:41 [source]
The fossil help pull
lists --ipv4
as a way to use only ipv4. But I see this:
$ fossil pull -R fossil.db
Pull from http://www.fossil-scm.org/
redirect with status 301 to https://www.fossil-scm.org/home
Round-trips: 1 Artifacts sent: 0 received: 0
Pull done, wire bytes sent: 632 received: 3309 remote: 2600:3c00::f03c:91ff:fe96:b959
$ fossil pull -R fossil.db --ipv4
Pull from http://www.fossil-scm.org/
redirect with status 301 to https://www.fossil-scm.org/home
Round-trips: 1 Artifacts sent: 0 received: 0
Pull done, wire bytes sent: 626 received: 3309 remote: 2600:3c00::f03c:91ff:fe96:b959
$ fossil pull --ipv4 -R fossil.db
Pull from http://www.fossil-scm.org/
redirect with status 301 to https://www.fossil-scm.org/home
Round-trips: 1 Artifacts sent: 0 received: 0
Pull done, wire bytes sent: 626 received: 3310 remote: 2600:3c00::f03c:91ff:fe96:b959
All three invocations use ipv6 only. How can I make it use ipv4?
Also, it always redirects to the https site with a 301 (Moved Permanently). Is there a way to get fossil to store the new address and avoid future 301's?
(2) By Richard Hipp (drh) on 2025-03-21 10:03:09 in reply to 1 [link] [source]
I thought that worked. Which version of Fossil are you using? What does "fossil version
" say?
(3) By anonymous on 2025-03-21 11:05:01 in reply to 2 [link] [source]
Awaiting Moderator Approval
(4) By Stephan Beal (stephan) on 2025-03-21 11:18:03 in reply to 1 [link] [source]
Also, it always redirects to the https site with a 301 (Moved Permanently). Is there a way to get fossil to store the new address and avoid future 301's?
This was discussed recently in 023e28f488982d3b. TL;DR: it's supposed to record that redirect but is apparently not doing so due to a bug.
(5) By Richard Hipp (drh) on 2025-03-21 11:27:03 in reply to 4 [link] [source]
I think it doesn't record the redirect because the server is sending a 302 Moved Temporarily, not a 301 Moved Permanently.
(6) By anonymous on 2025-03-21 11:40:12 in reply to 5 [link] [source]
With trace.
$ fossil pull -R fossil.db -v -v
Pull from http://www.fossil-scm.org/
Bytes Cards Artifacts Deltas
URL: http://www.fossil-scm.org/
Sending 162 byte header and 150 byte payload
Read: [HTTP/1.0 301 Moved Permanently]
Read: [Location: https://www.fossil-scm.org/home]
redirect with status 301 to https://www.fossil-scm.org/home
URL: https://www.fossil-scm.org/home
Sending 166 byte header and 150 byte payload
Read: [HTTP/1.0 200 OK]
Read: [Cache-control: no-cache]
Read: [X-Frame-Options: SAMEORIGIN]
Read: [Content-Type: application/x-fossil]
Read: [Content-length: 2990]
Reply received: 2990 of 2990 bytes
Sent: 174 1 0 0
Received: 5335 77 0 0
Pull done, wire bytes sent: 628 received: 3390 remote: www.fossil-scm.org (2600:3c00::f03c:91ff:fe96:b959)
Uncompressed payload sent: 174 received: 5335
Output from strace
...
recvfrom(5, "HTTP/1.0 301 Moved Permanently\r\n"..., 1000, 0, NULL, NULL) = 269
...
(7) By Daniel Dumitriu (danield) on 2025-03-21 11:49:36 in reply to 5 [link] [source]
No, it is a correctly reported 301:
$ curl -I http://www.fossil-scm.org
HTTP/1.1 301 Moved Permanently
(8) By Richard Hipp (drh) on 2025-03-21 14:16:18 in reply to 1 [link] [source]
Please recompile. I think all the problems are fixed now.
(9) By Kirill M (Kirill) on 2025-03-21 21:58:40 in reply to 8 [link] [source]
I had just updated trunk, and got error. This is OpenBSD system, OpenBSD uses LibreSSL by default, and LibreSSL doesn't have the defines which are present in OpenSSL.
cc -I. -I./src -I./extsrc -Ibld -Wall -Wdeclaration-after-statement -DFOSSIL_ENABLE_JSON -DFOSSIL_DYNAMIC_BUILD=1 -DFOSSIL_HAVE_FUSEFS -g -Os -DHAVE_AUTOCONFIG_H -o bld/http_ssl.o -c bld/http_ssl_.c
./src/http_ssl.c:457:7: warning: call to undeclared function 'BIO_set_conn_ip_family'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
BIO_set_conn_ip_family(sBio, BIO_FAMILY_IPV4);
^
./src/http_ssl.c:457:36: error: use of undeclared identifier 'BIO_FAMILY_IPV4'
BIO_set_conn_ip_family(sBio, BIO_FAMILY_IPV4);
^
./src/http_ssl.c:513:7: warning: call to undeclared function 'BIO_set_conn_ip_family'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
BIO_set_conn_ip_family(iBio, BIO_FAMILY_IPV4);
^
./src/http_ssl.c:513:36: error: use of undeclared identifier 'BIO_FAMILY_IPV4'
BIO_set_conn_ip_family(iBio, BIO_FAMILY_IPV4);
^
2 warnings and 2 errors generated.
*** Error 1 in /home/km/fossil (./src/main.mk:1390 'bld/http_ssl.o')
Following defines are present in OpenSSL, but not in LibreSSL:
km@stable /usr/local/include/eopenssl33 $ grep -r BIO_FAMILY .
./openssl/bio.h:# define BIO_FAMILY_IPV4 4
./openssl/bio.h:# define BIO_FAMILY_IPV6 6
./openssl/bio.h:# define BIO_FAMILY_IPANY 256
(10) By Richard Hipp (drh) on 2025-03-21 22:49:24 in reply to 9 [link] [source]
Does it build and work correctly if you build with -DBIO_FAMILY_IPV4=4?
(11) By Stephan Beal (stephan) on 2025-03-21 22:58:37 in reply to 10 [link] [source]
Does it build and work correctly if you build with -DBIO_FAMILY_IPV4=4?
Nope: it doesn't know BIO_set_conn_ip_family()
./src/http_ssl.c:457:7: warning: call to undeclared function 'BIO_set_conn_ip_family'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] BIO_set_conn_ip_family(sBio, BIO_FAMILY_IPV4);
(12) By Richard Hipp (drh) on 2025-03-21 23:17:19 in reply to 9 [link] [source]
I downloaded, compiled, and installed Libressl on my Linux desktop. It almost worked. Three link failures - none of which had anything to do with BIO_FAMILY_IPV4. So something is not quite right.
I have detailed instrunctions on how to compile OpenSSL on various platforms over at https://fossil-scm.org/home/wiki?name=Release+Build+How-To. If someone can suggest similar instructions on how to build LibreSSL, that would be most helpful in resolving this issue.
(13) By Richard Hipp (drh) on 2025-03-21 23:34:22 in reply to 9 [link] [source]
Stephan tells me (on chat) that the patch I just added to trunk fixes the missing BIO_set_conn_ip_family() API. The downside is that the --ipv4 option does not work when linking against LibreSSL.
(14) By anonymous on 2025-03-24 11:54:32 in reply to 8 [link] [source]
Please recompile. I think all the problems are fixed now.
Yes, both problems are fixed.
I am very pleased that finally after all these years the redirect has finally taken hold. The updates take half the time now without the extra round trip to follow the 301.
How can I mark this thread as solved? Or can a mod please mark it solved. Thanks.
(15) By Stephan Beal (stephan) on 2025-03-24 19:26:33 in reply to 14 [link] [source]
How can I mark this thread as solved? Or can a mod please mark it solved.
Fossil's forum doesn't have the notion of "marked as solved." You're welcome to edit the title of the post to add "[RESOLVED]" if you like, but that's not commonly done here.
(16) By anonymous on 2025-03-24 23:16:53 in reply to 15 [link] [source]
You're welcome to edit the title of the post to add "[RESOLVED]" if you like
I don't see any "Edit" button. There is only "Reply".
(17) By Mike Swanson (chungy) on 2025-03-24 23:34:14 in reply to 16 [link] [source]
That is probably because you logged in as anonymous. If you created a user account, you'd be able to edit your own posts.
(18) By Stephan Beal (stephan) on 2025-03-24 23:34:33 in reply to 16 [link] [source]
I don't see any "Edit" button. There is only "Reply".
Ah, right - anonymous accounts can't do that. It's not important - we've never had the convention of specifically flagging posts as resolved and that's worked fine for us so far.