Diff for /Amaya/amaya/query.c between versions 1.27 and 1.28

version 1.27, 1997/02/05 22:06:57 version 1.28, 1997/02/06 05:35:12
Line 287  AHTReqContext      *me; Line 287  AHTReqContext      *me;
         HTRequest_delete (me->request);          HTRequest_delete (me->request);
   
         if (me->error_stream != (char *) NULL)          if (me->error_stream != (char *) NULL)
            HT_FREE (me->error_stream);            HT_FREE (me->error_stream);
                   
         if (me->read_xtinput_id || me->write_xtinput_id ||          if (me->read_xtinput_id || me->write_xtinput_id ||
             me->except_xtinput_id)              me->except_xtinput_id)
Line 523  HTRequest          *request; Line 523  HTRequest          *request;
 HTResponse         *response;  HTResponse         *response;
 void               *context;  void               *context;
 int                 status;  int                 status;
   
 #endif  #endif
 {  {
    AHTReqContext      *me = (AHTReqContext *) HTRequest_context (request);     AHTReqContext      *me = (AHTReqContext *) HTRequest_context (request);
    boolean             error_flag;     boolean             error_flag;
      char                msg_status[10];
      HTError             *error;
   
    if (!me)     if (!me)
       return HT_OK;             /* not an Amaya request */        return HT_OK;             /* not an Amaya request */
Line 656  int                 status; Line 657  int                 status;
   
    /* don't remove or Xt will hang up during the put */     /* don't remove or Xt will hang up during the put */
   
    if (AmayaIsAlive && (me->method == METHOD_PUT || me->method == METHOD_POST))     if (AmayaIsAlive  && ((me->method == METHOD_POST) ||
                            (me->method == METHOD_PUT)))
      {       {
          TtaSetStatus (me->docid, 1, TtaGetMessage (AMAYA, AM_PROG_WRITE),         /* JK: Experimental */
                        me->urlName);         if (me->method == METHOD_PUT) 
            {
              TtaHandlePendingEvents ();
            }
   
          /* output the status of the request */
          if (status == 200)
            TtaSetStatus (me->docid, 1, TtaGetMessage (AMAYA, AM_REQUEST_SUCCEEDED), me->urlName);
          else if (status == 201)
            TtaSetStatus (me->docid, 1, TtaGetMessage (AMAYA, AM_CREATED_NEW_REMOTE_RESSOURCE), me->urlName);
          else if (status == 204 && me->method == METHOD_PUT)
            TtaSetStatus (me->docid, 1, TtaGetMessage (AMAYA, AM_UPDATED_REMOTE_RESSOURCE), me->urlName);
          else if (status == 204 && me->method == METHOD_PUT)
            TtaSetStatus (me->docid, 1, TtaGetMessage (AMAYA, AM_NO_DATA), (char *) NULL);
          else if (status == -400 || status == 505)
            TtaSetStatus (me->docid, 1, TtaGetMessage (AMAYA, AM_SERVER_DID_NOT_UNDERSTAND_REQ_SYNTAX), (char *) NULL);
          else if (status == -401)
              TtaSetStatus (me->docid, 1,
                            TtaGetMessage (AMAYA, AM_AUTHENTICATION_FAILURE), me->urlName);
          else if (status == -403)
            TtaSetStatus (me->docid, 1,
                            TtaGetMessage (AMAYA, AM_FORBIDDEN_ACCESS), me->urlName);
          else if (status == -405)
            TtaSetStatus (me->docid, 1, TtaGetMessage (AMAYA, AM_METHOD_NOT_ALLOWED), (char *) NULL);
          else if (status == -1)
            {
              HTError = HTRequest_error (request);
              if ((HTErrorElement) HTError->element == HTERR_INTERNAL)
                /* an error Henrik forgot :-/ */
                {
                  TtaSetStatus (me->docid, 1, "Internal Server Error", (char *) NULL);
                  status = -500; 
                }
            }
          else if (status != -1)
            {
              sprintf (msg_status, "%d", status); 
            TtaSetStatus (me->docid, 1, TtaGetMessage (AMAYA, AM_UNKNOWN_XXX_STATUS), msg_status);
            }
      }       }
    return HT_OK;     return HT_OK;
 }  }
Line 938  static void         AHTAlertInit () Line 977  static void         AHTAlertInit ()
    HTAlert_add (AHTProgress, HT_A_PROGRESS);     HTAlert_add (AHTProgress, HT_A_PROGRESS);
    HTAlert_add ((HTAlertCallback *) Add_NewSocket_to_Loop, HT_PROG_CONNECT);     HTAlert_add ((HTAlertCallback *) Add_NewSocket_to_Loop, HT_PROG_CONNECT);
    HTAlert_add (AHTError_print, HT_A_MESSAGE);     HTAlert_add (AHTError_print, HT_A_MESSAGE);
    HTError_setShow (0xFF);      /* process all messages */     HTError_setShow (~((int) 0 ) & ~((int) HT_ERR_SHOW_DEBUG));  /* process all messages except debug ones*/
    HTAlert_add (AHTConfirm, HT_A_CONFIRM);     HTAlert_add (AHTConfirm, HT_A_CONFIRM);
    HTAlert_add (AHTPrompt, HT_A_PROMPT);     HTAlert_add (AHTPrompt, HT_A_PROMPT);
    HTAlert_add (AHTPromptPassword, HT_A_SECRET);     HTAlert_add (AHTPromptPassword, HT_A_SECRET);
Line 1703  void               *context_tcbf; Line 1742  void               *context_tcbf;
                           context_tcbf, (char *) NULL);                            context_tcbf, (char *) NULL);
   
    TtaFreeMemory (mem_ptr);     TtaFreeMemory (mem_ptr);
      TtaHandlePendingEvents ();
   
 #endif /*WWW_XWINDOWS */  #endif /*WWW_XWINDOWS */
   
Line 1790  char               *outputfile; Line 1830  char               *outputfile;
   
    me->anchor = (HTParentAnchor *) HTAnchor_findAddress (urlName);     me->anchor = (HTParentAnchor *) HTAnchor_findAddress (urlName);
   
    /* Set the Content-Type of the file we are uplaoding */     /* Set the Content-Type of the file we are uploading */
    HTAnchor_setFormat ((HTParentAnchor *) me->anchor, AHTGuessAtom_for (me->urlName, contentType));     HTAnchor_setFormat ((HTParentAnchor *) me->anchor, AHTGuessAtom_for (me->urlName, contentType));
   
    HTAnchor_setLength ((HTParentAnchor *) me->anchor, me->block_size);     HTAnchor_setLength ((HTParentAnchor *) me->anchor, me->block_size);
    HTRequest_setEntityAnchor (me->request, me->anchor);     HTRequest_setEntityAnchor (me->request, me->anchor);
    status = HTLoadAbsolute (urlName, me->request);     status = HTLoadAbsolute (urlName, me->request);
   
    if (status == HT_ERROR || me->reqStatus == HT_END     if (status == HT_ERROR || me->reqStatus == HT_END || me->reqStatus == HT_ERR || HTError_hasSeverity (HTRequest_error (me->request), ERR_INFO))
        || me->reqStatus == HT_ERR || HTError_hasSeverity (HTRequest_error (me->request), ERR_NON_FATAL))  
      {       {
        TtaSetStatus (me->docid, 1, TtaGetMessage (AMAYA, AM_CANNOT_SAVE),  
                      me->urlName);  
   
        status = HT_ERROR;         status = HT_ERROR;
        AHTReqContext_delete (me);         AHTReqContext_delete (me);
      }       }     
    else     else
      {       {
         TtaSetStatus (me->docid, 1, TtaGetMessage (AMAYA, AM_REMOTE_SAVING),          TtaSetStatus (me->docid, 1, TtaGetMessage (AMAYA, AM_REMOTE_SAVING),
Line 1819  char               *outputfile; Line 1855  char               *outputfile;
              AHTReqContext_delete (me);               AHTReqContext_delete (me);
           }            }
      }       }
   
    return (status);     return (status);
   
 }  }
   
   
   
 /*----------------------------------------------------------------------  /*----------------------------------------------------------------------
   Stop Request    Stop Request
   stops (kills) all active requests associated with a docid     stops (kills) all active requests associated with a docid 

Removed from v.1.27  
changed lines
  Added in v.1.28


Webmaster