Re: ftp url problem?

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Mon, 21 Sep 1998 22:51:24 +0200

Rodney Holm wrote:

> I would like to back port this change to my 1.1 source tree. We run in a
> production enivorment and will need to distribute this fix to our customers.

Unfortunately the FTP code is completely rewritten in 1.2. There is no
external ftpget process anymore. It is not trivial to backport the
change.

> the first of which fails. In contrast, when the request is serviced by the
> ftpget program it is sent incorrectly and only once.

I wouldn't say Squid 1.1.X does it incorrectly. Squid 1.1.X is somewhat
closer to the specification (RFC 1738, section 3.3.2) than Netscape
Navigator/Communicator is. Neither of them is correct.

Squid 1.2 first tries to follow RFC 1738, if this fails then it also
tries several other methods to support some wide-spread non-standard
URL styles (like Netscape style URLs).

> If you could tell me where in the code to change and send me a snippet I
> will be more than happy to do it.

The code you need to change is ftpget.c.

I have attached a small patch that adds a compile-time option to use
Netscape style FTP URLs.

1. Apply the patch
2. run configure
3. edit src/Makefile to include NETSCAPE_STYLE_FTP
4. make install

---
Henrik Nordström
Sparetime Squid Hacker

--- squid-1.1.21/src/Makefile.in.orig Mon Sep 21 22:23:26 1998
+++ squid-1.1.21/src/Makefile.in Mon Sep 21 22:23:55 1998
@@ -18,12 +18,14 @@
 USE_BIN_TREE = # -DUSE_BIN_TREE
 RELOAD_INTO_IMS = # -DRELOAD_INTO_IMS
 UNDERSCORES_OPT = # -DALLOW_HOSTNAME_UNDERSCORES
+NETSCAPE_FTP = # -DNETSCAPE_STYLE_FTP
 
 DEFINES = $(HOST_OPT) $(AUTH_OPT) $(LOG_HDRS_OPT) \
                   $(ICMP_OPT) $(DELAY_HACK) $(USERAGENT_OPT) \
                   $(KILL_PARENT_OPT) $(USE_POLL_OPT) \
                   $(USE_SPLAY_TREE) $(USE_BIN_TREE) \
- $(RELOAD_INTO_IMS) $(UNDERSCORES_OPT)
+ $(RELOAD_INTO_IMS) $(UNDERSCORES_OPT) \
+ $(NETSCAPE_FTP)
 
 prefix = @prefix@
 exec_prefix = @exec_prefix@
--- squid-1.1.21/src/ftpget.c.orig Tue Mar 17 04:05:02 1998
+++ squid-1.1.21/src/ftpget.c Mon Sep 21 22:21:49 1998
@@ -2436,6 +2436,16 @@
             again = 1;
         }
     } while (again);
+
+#if NETSCAPE_STYLE_FTP
+ /* Add leading / for netscape style URLs */
+ s = xmalloc(strlen(r->path+1));
+ strcpy(s, "/");
+ strcat(s, r->path);
+ xfree(r->path);
+ r->path = s;
+#endif
+
 }
 
 #define MAX_ARGS 64
Received on Mon Sep 21 1998 - 14:27:37 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:42:04 MST