Diff for /Amaya/amaya/query.c between versions 1.301 and 1.302

version 1.301, 2002/06/06 13:59:49 version 1.302, 2002/06/11 17:33:47
Line 123  static  FILE        *trace_fp = NULL; Line 123  static  FILE        *trace_fp = NULL;
 #include "davlib.h"  #include "davlib.h"
 #include "davlib_f.h"  #include "davlib_f.h"
 #include "davlibCommon_f.h"  #include "davlibCommon_f.h"
 #endif  #endif /* DAV */
   
 /* prototypes */  /* prototypes */
   
Line 525  AHTReqContext *AHTReqContext_new (int do Line 525  AHTReqContext *AHTReqContext_new (int do
   
 #ifdef DAV                /* clean the DAV request context */  #ifdef DAV                /* clean the DAV request context */
    me->dav_context = NULL; /* it should be create only when doing a DAV request */     me->dav_context = NULL; /* it should be create only when doing a DAV request */
 #endif     #endif /* DAV */  
   
    Amaya->open_requests++;     Amaya->open_requests++;
   
Line 998  static int redirection_handler (HTReques Line 998  static int redirection_handler (HTReques
        /* search lock information for the new url */         /* search lock information for the new url */
        if (me->method == METHOD_POST || me->method == METHOD_PUT)          if (me->method == METHOD_POST || me->method == METHOD_PUT) 
            DAVAddIfHeader (me,me->urlName);             DAVAddIfHeader (me,me->urlName);
 #endif         #endif /* DAV */      
                 
        if (me->method == METHOD_POST || me->method == METHOD_PUT)         if (me->method == METHOD_POST || me->method == METHOD_PUT)
          {           {
Line 1065  static int precondition_handler (HTReque Line 1065  static int precondition_handler (HTReque
           noIf = NO;            noIf = NO;
       else        else
           noIf = YES;                  noIf = YES;      
 #endif    /* DAV */  #endif /* DAV */
               
               
       /* start a new PUT request without preconditions */        /* start a new PUT request without preconditions */
Line 1102  static int precondition_handler (HTReque Line 1102  static int precondition_handler (HTReque
   
               
 #ifdef DAV  #ifdef DAV
       /* MKP: add an If header only if there wasn't preconditions */        /* MKP: add an If header (lock information) only 
          * if there wasn't preconditions */
       if (noIf!=YES) DAVAddIfHeader (me,HTAnchor_address(me->dest));        if (noIf!=YES) DAVAddIfHeader (me,HTAnchor_address(me->dest));
 #endif /* DAV */  #endif /* DAV */
               
Line 1182  static int check_handler (HTRequest * re Line 1183  static int check_handler (HTRequest * re
         HTRequest_setFlush(me->request, YES);          HTRequest_setFlush(me->request, YES);
         
 #ifdef DAV  #ifdef DAV
       /* MKP: try to add an if header */        /* MKP: try to add an "If" header (lock information) 
          *      Such header will be added only if there is a
          *      lock information in the local base. */
       DAVAddIfHeader (me,me->urlName);           DAVAddIfHeader (me,me->urlName);   
 #endif  #endif /* DAV */
   
   
       /* turn on the special preconditions, to avoid having this        /* turn on the special preconditions, to avoid having this
Line 1220  static int check_handler (HTRequest * re Line 1223  static int check_handler (HTRequest * re
           HTRequest_setPreemptive (me->request, NO);            HTRequest_setPreemptive (me->request, NO);
         
 #ifdef DAV  #ifdef DAV
           /* MKP: try to add an if header */           /* MKP: try to add an "If" header (lock information) 
             *      Such header will be added only if there is a
             *      lock information in the local base. */ 
           DAVAddIfHeader (me,HTAnchor_address(me->dest));               DAVAddIfHeader (me,HTAnchor_address(me->dest));   
 #endif  #endif /* DAV */
   
                       
           /*            /*
           ** Make sure that the first request is flushed immediately and not            ** Make sure that the first request is flushed immediately and not
Line 1296  static int terminate_handler (HTRequest Line 1302  static int terminate_handler (HTRequest
 #ifdef DAV  #ifdef DAV
    else if (status == HT_LOCKED      else if (status == HT_LOCKED 
             || status ==  HT_FAILED_DEPENDENCY               || status ==  HT_FAILED_DEPENDENCY 
             || status == HT_MULTI_STATUS) {              || status == HT_MULTI_STATUS) 
       {
      /* WebDAV return codes - they are handled in       /* WebDAV return codes - they are handled in
       * specific filters. We don't need to deal        * specific filters. We don't need to deal
       * with them anymore        * with them anymore
       */        */
      error_flag = FALSE;                  error_flag = FALSE;           
    }      }
 #endif     #endif   /* DAV */
    else     else
      error_flag = TRUE;       error_flag = TRUE;
   
Line 1457  int AHTLoadTerminate_handler (HTRequest Line 1464  int AHTLoadTerminate_handler (HTRequest
          HTTrace ("Load End.... OK BUT NO DATA: `%s\'\n",            HTTrace ("Load End.... OK BUT NO DATA: `%s\'\n", 
                   me->status_urlName);                    me->status_urlName);
 #ifdef DAV        #ifdef DAV      
        if (me->method==METHOD_UNLOCK) {         if (me->method==METHOD_UNLOCK) 
            /* MKP: NEED set a good status message */          {
              /* MKP: set an appropriate status message */
            TtaSetStatus (me->docid, 1,              TtaSetStatus (me->docid, 1, 
                      TtaGetMessage (AMAYA, AM_UNLOCK_SUCCEED),                       TtaGetMessage (AMAYA, AM_UNLOCK_SUCCEED),
                      NULL);                       NULL);
        }          }
        else         else
 #endif  #endif /* DAV */
            TtaSetStatus (me->docid, 1,              TtaSetStatus (me->docid, 1, 
                      TtaGetMessage (AMAYA, AM_LOADED_NO_DATA),                       TtaGetMessage (AMAYA, AM_LOADED_NO_DATA),
                      me->status_urlName);                       me->status_urlName);
Line 3023  int GetObjectWWW (int docid, char *urlNa Line 3031  int GetObjectWWW (int docid, char *urlNa
   
                 
 #ifdef DAV   #ifdef DAV 
    /* try to add an If header for POST requests and for GET forms */     /* try to add an "If" header (lock information) also for POST 
       * requests and for GET forms */
    if (HTRequest_method(me->request) == METHOD_POST ||     if (HTRequest_method(me->request) == METHOD_POST ||
           (HTRequest_method(me->request) == METHOD_GET && me->formdata))                       (HTRequest_method(me->request) == METHOD_GET && me->formdata))           
        DAVAddIfHeader (me,HTAnchor_address((HTAnchor*)me->anchor));         DAVAddIfHeader (me,HTAnchor_address((HTAnchor*)me->anchor));
 #endif  #endif /* DAV */
                 
         
    /* do the request */     /* do the request */
Line 3431  int PutObjectWWW (int docid, char *fileN Line 3440  int PutObjectWWW (int docid, char *fileN
   
         
 #ifdef DAV  #ifdef DAV
    /* MKP: for a PUT request, try to add an if header      /* MKP: for a PUT request, try to add an "If" header (lock information)
     * for a HEAD request, leave this for check_handler */      * for a HEAD request, leave this for check_handler */
    if ( !(lost_update_check && (!UsePreconditions || !etag)) )     if ( !(lost_update_check && (!UsePreconditions || !etag)) )
        DAVAddIfHeader (me,HTAnchor_address(me->dest));            DAVAddIfHeader (me,HTAnchor_address(me->dest));   
 #endif  #endif /* DAV */
   
         
    /* make the request */     /* make the request */

Removed from v.1.301  
changed lines
  Added in v.1.302


Webmaster