home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / infosyst / gopher / 1738 < prev    next >
Encoding:
Text File  |  1992-12-24  |  3.5 KB  |  119 lines

  1. Newsgroups: comp.infosystems.gopher
  2. Path: sparky!uunet!nntp1.radiomail.net!pandora!mitra
  3. From: mitra@pandora.sf.ca.us (Mitra)
  4. Subject: Re: Gopher and FTP - is there a better way to do it
  5. Organization: Pandora Systems
  6. Date: Thu, 24 Dec 1992 19:09:27 GMT
  7. Message-ID: <Bzs2Jr.8Lu@pandora.sf.ca.us>
  8. X-Newsreader: TIN [version 1.1 PL6]
  9. References: <BzIzz2.D5L@pandora.sf.ca.us>
  10. Lines: 107
  11.  
  12.  
  13. I'll leave tackling the problem of moving the ftp protocols into the client
  14. to someone else, but here is a patch that will allow the client to 
  15. override the Host and Port for Path's starting with "ftp:". The method
  16. used would work well to be extended to other special cases as well. 
  17.  
  18. The rational - for those who missed the earlier post - is that it is crazy to 
  19. ftp a file via a gateway specified by the Gopher that gave you the pointer
  20. to the file. That Gopher has no idea which is the most efficient ftp gateway
  21. for you. If I can get it from a local gopher-server then it reduces the 
  22. bandwidth requirement (and potentially response time) by a factor of two.
  23.  
  24. To apply the patch do something like
  25. "cd gopher1.1+ ; patch -l -p1 <gopher1.1.ftp.patch"
  26.  
  27. I dont believe this patch is dependant on any of the others I've distributed?
  28.  
  29. - Mitra
  30.  
  31.  
  32. diff -b -c -r gopher1.1sc.re.pa.co/conf.h gopher1.1+/conf.h
  33. *** gopher1.1sc.re.pa.co/conf.h    Wed Dec 23 17:04:20 1992
  34. --- gopher1.1+/conf.h    Wed Dec 23 21:39:31 1992
  35. ***************
  36. *** 41,46 ****
  37. --- 41,49 ----
  38.   #define CLIENT1_PORT 70
  39.   #define CLIENT2_PORT 0
  40.   
  41. + /* Define a reliable and close gopher->ftp gateway */
  42. + #define GOPHERTOFTP_HOST CLIENT1_HOST
  43. + #define GOPHERTOFTP_PORT CLIENT1_PORT
  44.   
  45.   /*
  46.    * Override some defaults for various platforms
  47. diff -b -c -r gopher1.1sc.re.pa.co/object/GDgopherdir.c gopher1.1+/object/GDgopherdir.c
  48. *** gopher1.1sc.re.pa.co/object/GDgopherdir.c    Thu Dec 10 15:28:20 1992
  49. --- gopher1.1+/object/GDgopherdir.c    Wed Dec 23 21:34:28 1992
  50. ***************
  51. *** 200,205 ****
  52. --- 200,209 ----
  53.         GSinit(TempGopher);
  54.         i = GSfromNet(TempGopher, sockfd);
  55.   
  56. + #ifdef PANDORA
  57. +       GSprocessObject(TempGopher);
  58. + #endif
  59.         if (i==0) {
  60.              GDaddGS(gd, TempGopher);
  61.              if (eachitem != NULL) 
  62. diff -b -c -r gopher1.1sc.re.pa.co/object/GSgopherobj.c gopher1.1+/object/GSgopherobj.c
  63. *** gopher1.1sc.re.pa.co/object/GSgopherobj.c    Thu Dec 10 15:28:20 1992
  64. --- gopher1.1+/object/GSgopherobj.c    Wed Dec 23 21:33:51 1992
  65. ***************
  66. *** 46,51 ****
  67. --- 46,55 ----
  68.   
  69.   #include "Malloc.h"
  70.   
  71. + #ifdef PANDORA
  72. + #include "../conf.h"
  73. + #endif
  74.   /*
  75.    * Make a new gopherobj, set the fields accordingly...
  76.    */
  77. ***************
  78. *** 229,234 ****
  79. --- 233,251 ----
  80.   extern int readfield();
  81.   extern int readline();
  82.   
  83. + #ifdef PANDORA
  84. + void
  85. + GSprocessObject(gs)
  86. +   GopherObj *gs;
  87. + {
  88. + #ifdef GOPHERTOFTP_HOST
  89. +     if (strncmp(GSgetPath(gs),"ftp:",4) == 0) {
  90. +     GSsetPort(gs,GOPHERTOFTP_PORT);
  91. +     GSsetHost(gs,GOPHERTOFTP_HOST);
  92. +     }
  93. + #endif
  94. + }
  95. + #endif
  96.   int
  97.   GSfromNet(gs, sockfd)
  98.     GopherObj *gs;
  99. diff -b -c -r gopher1.1sc.re.pa.co/object/Makefile gopher1.1+/object/Makefile
  100. *** gopher1.1sc.re.pa.co/object/Makefile    Thu Dec 10 15:28:20 1992
  101. --- gopher1.1+/object/Makefile    Wed Dec 23 21:06:53 1992
  102. ***************
  103. *** 1,6 ****
  104.   include ../Makefile.config
  105.   
  106. ! CCFLAGS    = $(OPT) $(COMPAT) $(GSYSTYPE) -I. 
  107.   
  108.   OBJS    = STRstring.o GDgopherdir.o GSgopherobj.o DAarray.o util.o  \
  109.         compatible.o 
  110. --- 1,6 ----
  111.   include ../Makefile.config
  112.   
  113. ! CCFLAGS    = $(OPT) $(LOCALINCLUDES) $(COMPAT) $(GSYSTYPE) -I. 
  114.   
  115.   OBJS    = STRstring.o GDgopherdir.o GSgopherobj.o DAarray.o util.o  \
  116.         compatible.o 
  117.