Diff for /libwww/Robot/src/HTRobot.c between versions 1.64 and 1.65

version 1.64, 1998/02/07 23:59:38 version 1.65, 1998/02/25 20:48:38
Line 62 Line 62
 #define DEFAULT_DELAY           50                      /* Write delay in ms */  #define DEFAULT_DELAY           50                      /* Write delay in ms */
   
 #if 0  #if 0
 #define HT_MEMLOG               /* May be expensive in performance! */  #define HT_MEMLOG               /* Is expensive in performance! */
 #endif  #endif
   
 /* #define SHOW_MSG             (WWWTRACE || HTAlert_interactive()) */  /* #define SHOW_MSG             (WWWTRACE || HTAlert_interactive()) */
Line 98  typedef struct _Robot { Line 98  typedef struct _Robot {
     HTList *            fingers;      HTList *            fingers;
   
     int                 timer;      int                 timer;
     char *              cwd;                              /* Current dir URL */      char *              cwd;                    /* Current dir URL */
     char *              rules;      char *              rules;
     char *              prefix;      char *              prefix;
     char *              img_prefix;      char *              img_prefix;
Line 172  typedef struct _HyperDoc { Line 172  typedef struct _HyperDoc {
 } HyperDoc;  } HyperDoc;
   
 /*  /*
 ** This is the HText object that is created every time we start parsing a   ** This is the HText object that is created every time we start parsing an 
 ** HTML object  ** HTML object
 */  */
 struct _HText {  struct _HText {
     HTRequest *         request;      HTRequest *         request;
       BOOL                follow;
 };  };
   
 /*  /*
Line 976  PUBLIC HText * HText_new2 (HTRequest * r Line 977  PUBLIC HText * HText_new2 (HTRequest * r
     HText * me;      HText * me;
     Finger * finger = (Finger *) HTRequest_context(request);      Finger * finger = (Finger *) HTRequest_context(request);
     Robot * mr = finger->robot;      Robot * mr = finger->robot;
       char * robots = NULL;
   
     if ((me = (HText *) HT_CALLOC(1, sizeof(HText))) == NULL)      if ((me = (HText *) HT_CALLOC(1, sizeof(HText))) == NULL)
         HT_OUTOFMEM("HText_new2");          HT_OUTOFMEM("HText_new2");
   
     /* Bind the HText object together with the Request Object */      /* Bind the HText object together with the Request Object */
     me->request = request;      me->request = request;
       me->follow = YES;
   
       /* Check to see if we have any meta tags */
       if ((robots = HTAnchor_robots(anchor)) != NULL) {
           char * strval = NULL;
           char * ptr = NULL;
           char * token = NULL;
           StrAllocCopy(strval, robots);
           ptr = strval;
           while ((token = HTNextField(&ptr)) != NULL) {
               if (!strcasecomp(token, "nofollow")) {
                   me->follow = NO;
                   break;
               }
           }
           HT_FREE(strval);
       }
   
     /* Add this HyperDoc object to our list */      /* Add this HyperDoc object to our list */
     if (!mr->htext) mr->htext = HTList_new();      if (!mr->htext) mr->htext = HTList_new();
Line 1002  PUBLIC void HText_beginAnchor (HText * t Line 1022  PUBLIC void HText_beginAnchor (HText * t
         char * uri = HTAnchor_address((HTAnchor *) dest_parent);          char * uri = HTAnchor_address((HTAnchor *) dest_parent);
         HyperDoc * hd = HTAnchor_document(dest_parent);          HyperDoc * hd = HTAnchor_document(dest_parent);
         HTParentAnchor * referer = HTRequest_anchor(text->request);          HTParentAnchor * referer = HTRequest_anchor(text->request);
         BOOL match = YES;          BOOL match = text->follow;
         BOOL check = NO;          BOOL check = NO;
   
         if (!uri) return;          if (!uri) return;
Line 1016  PUBLIC void HText_beginAnchor (HText * t Line 1036  PUBLIC void HText_beginAnchor (HText * t
         }          }
                           
         /* Check for prefix match */          /* Check for prefix match */
         if (mr->prefix) match = HTStrMatch(mr->prefix, uri) ? YES : NO;          if (match && mr->prefix) {
               match = HTStrMatch(mr->prefix, uri) ? YES : NO;
           }
   
 #ifdef HT_POSIX_REGEX  #ifdef HT_POSIX_REGEX
         /* Check for any regular expression */          /* Check for any regular expression */

Removed from v.1.64  
changed lines
  Added in v.1.65


Webmaster