Diff for /Amaya/amaya/query.c between versions 1.92 and 1.93

version 1.92, 1997/10/23 15:57:40 version 1.93, 1997/11/12 13:45:44
Line 474  HTRequest           *request; Line 474  HTRequest           *request;
   
   me = HTRequest_context (request);    me = HTRequest_context (request);
   
   
     if (!me)
         return HT_ERROR;
   
 #ifdef DEBUG_LIBWWW  #ifdef DEBUG_LIBWWW
   fprintf(stderr, "AHTOpen_file: start\n");    fprintf(stderr, "AHTOpen_file: start\n");
 #endif /* DEBUG_LIBWWW */  #endif /* DEBUG_LIBWWW */
Line 1499  char       *content_type; Line 1503  char       *content_type;
        HTRequest_setConversion(me->request, acceptTypes, TRUE);         HTRequest_setConversion(me->request, acceptTypes, TRUE);
    }     }
   
   
   #if !defined(AMAYA_JAVA) && !defined(AMAYA_ILU) && defined (_WINDOWS)
      /* forces libwww to do sync request if in MakeBook mode */
      if (WinMakeBookFlag)
              mode = AMAYA_SYNC;
   #endif /* _WINDOWS */
   
    /* Common initialization */     /* Common initialization */
    me->mode = mode;     me->mode = mode;
    me->error_html = error_html;     me->error_html = error_html;
Line 1628  char       *content_type; Line 1639  char       *content_type;
           {            {
             status = HT_OK;              status = HT_OK;
       }        }
   
      /* part of the stop button handler */  
      if ((mode & AMAYA_SYNC) || (mode & AMAYA_ISYNC)) {  
                  AHTReqContext_delete (me);  
          }  
     
      /* part of the stop button handler */
        if ((mode & AMAYA_SYNC) || (mode & AMAYA_ISYNC))
          {
           if (HTRequest_net (me->request))
              HTRequest_kill (me->request);
           else
              AHTReqContext_delete (me);
          }
   
 #endif /* !_WINDOWS */  #endif /* !_WINDOWS */
   
Line 1891  char               *outputfile; Line 1905  char               *outputfile;
         {          {
          HTRequest_kill (me->request);           HTRequest_kill (me->request);
         }          }
     /* AHTReqContext_delete (me); */      else 
           AHTReqContext_delete (me);
    return (status);     return (status);
 }  }
   
Line 1942  int                 docid; Line 1957  int                 docid;
                  reqChannel = HTChannel_find(reqSock);                   reqChannel = HTChannel_find(reqSock);
                  reqHost = HTChannel_host (reqChannel);                   reqHost = HTChannel_host (reqChannel);
                                     
                  if (HTRequest_net (me->request))                   if ((me->mode & AMAYA_IASYNC) ||
                    {                         (me->mode & AMAYA_ASYNC))
                     HTRequest_kill (me->request);  
                    }  
                  else if ((me->mode & AMAYA_ISYNC) ||  
                           (me->mode & AMAYA_ASYNC))  
                    {                     {
                      AHTReqContext_delete (me);                       if (HTRequest_net (me->request))
                          HTRequest_kill (me->request);
                        else
                          AHTReqContext_delete (me);                      
                    }                     }
                                     
                  if (HTHost_isIdle (reqHost) ) {                   if (HTHost_isIdle (reqHost) ) {
Line 1981  int                 docid; Line 1995  int                 docid;
           {            {
              if (me->docid == docid)               if (me->docid == docid)
                {                 {
                   /* kill this request */                   /* kill this request */
   
                   switch (me->reqStatus)  
                         {  
                            case HT_ABORT:  
                               break;  
   
                            case HT_BUSY:  
                               me->reqStatus = HT_ABORT;  
                               break;  
                            case HT_NEW_PENDING:  
                            case HT_WAITING:  
                            default:  
                               me->reqStatus = HT_ABORT;  
   
                    switch (me->reqStatus)
                      {
                      case HT_ABORT:
                        break;
                        
                      case HT_BUSY:
                        me->reqStatus = HT_ABORT;
                        break;
                      case HT_NEW_PENDING:
                      case HT_WAITING:
                      default:
                        me->reqStatus = HT_ABORT;
                        
 #                 ifndef _WINDOWS  #                 ifndef _WINDOWS
                               RequestKillAllXtevents (me);                       RequestKillAllXtevents (me);
 #                 endif _WINDOWS  #                 endif _WINDOWS
                         
                               reqNet = HTRequest_net (me->request);                       reqNet = HTRequest_net (me->request);
                               reqSock = HTNet_socket (reqNet);                       reqSock = HTNet_socket (reqNet);
                               reqChannel = HTChannel_find(reqSock);                       reqChannel = HTChannel_find(reqSock);
                               reqHost = HTChannel_host (reqChannel);                       reqHost = HTChannel_host (reqChannel);
                        
                   if (HTRequest_net (me->request))                       if ((me->mode & AMAYA_IASYNC) ||
                                     {                                      (me->mode & AMAYA_ASYNC))
                                                 HTRequest_kill (me->request);                          {
                                         } else if ((me->mode & AMAYA_ASYNC) ||                           if (HTRequest_net (me->request))
                                   (me->mode & AMAYA_IASYNC))                             HTRequest_kill (me->request);
                                 {                           else
                                    AHTReqContext_delete (me);                             AHTReqContext_delete (me);                  
                                                               }
                                 }                       
                        
                               /* if there are no more requests, then close                       /* if there are no more requests, then close
                                  the connection */                          the connection */
                        
                               if (HTHost_isIdle (reqHost) ) {                       if (HTHost_isIdle (reqHost) ) {
 #ifdef                        DEBUG_LIBWWW  #ifdef                        DEBUG_LIBWWW
                                 fprintf (stderr, "Host is idle, "                         fprintf (stderr, "Host is idle, "
                                          "killing socket %d\n",                                  "killing socket %d\n",
                                          reqSock);                                  reqSock);
 #endif                        /* DEBUG_LIBWWW */  #endif                        /* DEBUG_LIBWWW */
                                 HTEvent_unregister (reqSock, FD_ALL);                         HTEvent_unregister (reqSock, FD_ALL);
                                 HTEvent_register(reqSock,                         HTEvent_register(reqSock,
                                                  NULL,                                          NULL,
                                                  (SockOps) FD_READ,                                          (SockOps) FD_READ,
                                                  HTHost_catchClose,                                          HTHost_catchClose,
                                                  HT_PRIORITY_MAX);                                          HT_PRIORITY_MAX);
                                 close (reqSock);                                                         close (reqSock);                         
                                 HTHost_clearChannel (reqHost, HT_ERROR);                         HTHost_clearChannel (reqHost, HT_ERROR);
                                 /*                         /*
                                 if (reqChannel && reqHost)                           if (reqChannel && reqHost)
                                   HTHost_clearChannel(reqHost, HT_OK);                           HTHost_clearChannel(reqHost, HT_OK);
                                 HTHost_catchClose (reqSock, NULL, FD_CLOSE);                           HTHost_catchClose (reqSock, NULL, FD_CLOSE);
                                 */                           */
 #ifdef                          DEBUG_LIBWWW                              #ifdef                          DEBUG_LIBWWW                            
                                 fprintf (stderr, "After killing, "                         fprintf (stderr, "After killing, "
                                          "HTHost_isIdle gives %d\n",                                  "HTHost_isIdle gives %d\n",
                                          HTHost_isIdle (reqHost));                                  HTHost_isIdle (reqHost));
 #endif                          /* DEBUG_LIBWWW */  #endif                          /* DEBUG_LIBWWW */
                               }                       }
                                                             
                               cur = Amaya->reqlist;                       cur = Amaya->reqlist;
                               open_requests--;                       open_requests--;
                        
                               break;                       break;
                        
                         }       /* switch */                     }    /* switch */
                }                /* if me docid */                 }                /* if me docid */
           }                     /* while */            }                     /* while */
      }                          /* if amaya open requests */       }                          /* if amaya open requests */
      
 } /* StopRequest */  } /* StopRequest */
   
 /*  /*

Removed from v.1.92  
changed lines
  Added in v.1.93


Webmaster