version 1.170, 1999/02/02 19:06:20
|
version 1.171, 1999/02/09 11:10:21
|
Line 730 int status;
|
Line 730 int status;
|
TtaSetStatus (me->docid, 1, TtaGetMessage (AMAYA, AM_RED_FETCHING), |
TtaSetStatus (me->docid, 1, TtaGetMessage (AMAYA, AM_RED_FETCHING), |
me->status_urlName); |
me->status_urlName); |
|
|
|
/* @@ verify if this is important */ |
/* Start request with new credentials */ |
/* Start request with new credentials */ |
if (HTRequest_outputStream (me->request) != NULL) { |
if (HTRequest_outputStream (me->request) != NULL) { |
AHTFWriter_FREE (HTRequest_outputStream (me->request)); |
AHTFWriter_FREE (HTRequest_outputStream (me->request)); |
Line 743 int status;
|
Line 744 int status;
|
} |
} |
} |
} |
|
|
|
/* |
|
** launch the request |
|
*/ |
/* reset the status */ |
/* reset the status */ |
me->reqStatus = HT_NEW; |
me->reqStatus = HT_NEW; |
/* clear the errors */ |
/* clear the errors */ |
HTError_deleteAll (HTRequest_error (request)); |
HTError_deleteAll (HTRequest_error (request)); |
HTRequest_setError (request, NULL); |
HTRequest_setError (request, NULL); |
|
|
if (me->method == METHOD_PUT |
if (me->method == METHOD_POST |
|| me->method == METHOD_POST) /* PUT, POST etc. */ |
|| me->method == METHOD_PUT) /* PUT, POST etc. */ |
status = HTLoadAbsolute (me->urlName, request); |
status = HTLoadAbsolute (me->urlName, request); |
else |
else |
HTLoadAnchor (new_anchor, request); |
HTLoadAnchor (new_anchor, request); |
} |
} |
Line 811 int status;
|
Line 815 int status;
|
fclose (me->output); |
fclose (me->output); |
me->output = NULL; |
me->output = NULL; |
} |
} |
/* turn off preconditions */ |
|
HTRequest_setPreconditions(me->request, HT_NO_MATCH); |
|
/* |
/* |
** reset the Amaya and libwww request status |
** reset the Amaya and libwww request status |
*/ |
*/ |
me->reqStatus = HT_NEW; |
|
/* clear the errors */ |
/* clear the errors */ |
HTError_deleteAll (HTRequest_error (request)); |
HTError_deleteAll (HTRequest_error (request)); |
HTRequest_setError (request, NULL); |
HTRequest_setError (request, NULL); |
/* make the request */ |
/* the method has to be GET in order to download the source file */ |
|
HTRequest_setMethod (me->request, METHOD_GET); |
|
/* turn off preconditions */ |
|
HTRequest_setPreconditions(me->request, HT_NO_MATCH); |
|
me->reqStatus = HT_NEW; |
|
/* make the request */ |
status = HTPutDocumentAnchor (HTAnchor_parent (me->source), me->dest, me->request); |
status = HTPutDocumentAnchor (HTAnchor_parent (me->source), me->dest, me->request); |
/* stop here */ |
/* stop here */ |
return HT_ERROR; |
return HT_ERROR; |
Line 876 static int check_handler (HTRequest * re
|
Line 882 static int check_handler (HTRequest * re
|
{ |
{ |
/* it's a new ressource, so we start a new PUT request with a |
/* it's a new ressource, so we start a new PUT request with a |
"if-none-match *" precondition */ |
"if-none-match *" precondition */ |
|
/* clear the errors */ |
|
HTError_deleteAll (HTRequest_error (request)); |
|
HTRequest_setError (request, NULL); |
|
/* the method has to be GET in order to download the source file */ |
|
HTRequest_setMethod (me->request, METHOD_GET); |
HTRequest_setPreconditions(me->request, HT_DONT_MATCH_ANY); |
HTRequest_setPreconditions(me->request, HT_DONT_MATCH_ANY); |
|
me->reqStatus = HT_NEW; |
status = HTPutDocumentAnchor (HTAnchor_parent (me->source), me->dest, me->request); |
status = HTPutDocumentAnchor (HTAnchor_parent (me->source), me->dest, me->request); |
return HT_ERROR; /* stop here */ |
return HT_ERROR; /* stop here */ |
} |
} |
Line 891 static int check_handler (HTRequest * re
|
Line 903 static int check_handler (HTRequest * re
|
if (force_put) |
if (force_put) |
{ |
{ |
/* Start a new PUT request without preconditions */ |
/* Start a new PUT request without preconditions */ |
|
/* clear the errors */ |
|
HTError_deleteAll (HTRequest_error (request)); |
|
HTRequest_setError (request, NULL); |
|
/* the method has to be GET in order to download the source file */ |
|
HTRequest_setMethod (me->request, METHOD_GET); |
|
/* Start a new PUT request without preconditions */ |
HTRequest_setPreconditions(me->request, HT_NO_MATCH); |
HTRequest_setPreconditions(me->request, HT_NO_MATCH); |
|
me->reqStatus = HT_NEW; |
status = HTPutDocumentAnchor (HTAnchor_parent (me->source), me->dest, me->request); |
status = HTPutDocumentAnchor (HTAnchor_parent (me->source), me->dest, me->request); |
return HT_ERROR; /* stop here */ |
return HT_ERROR; /* stop here */ |
} |
} |
Line 2346 char *content_type;
|
Line 2365 char *content_type;
|
{ |
{ |
me->method = METHOD_POST; |
me->method = METHOD_POST; |
HTRequest_setMethod (me->request, METHOD_POST); |
HTRequest_setMethod (me->request, METHOD_POST); |
|
/* don't use the cache for post requests */ |
|
HTRequest_setReloadMode (me->request, HT_CACHE_FLUSH); |
} |
} |
else |
else |
{ |
{ |
Line 2623 void *context_tcbf;
|
Line 2644 void *context_tcbf;
|
me->block_size = file_stat.st_size; |
me->block_size = file_stat.st_size; |
/* select the parameters that distinguish a PUT from a GET/POST */ |
/* select the parameters that distinguish a PUT from a GET/POST */ |
me->method = METHOD_PUT; |
me->method = METHOD_PUT; |
HTRequest_setMethod (me->request, METHOD_PUT); |
|
me->output = stdout; |
me->output = stdout; |
/* we are not expecting to receive any input from the server */ |
/* we are not expecting to receive any input from the server */ |
me->outputfile = (char *) NULL; |
me->outputfile = (char *) NULL; |
Line 2666 void *context_tcbf;
|
Line 2686 void *context_tcbf;
|
HTRequest_setOutputFormat (me->request, |
HTRequest_setOutputFormat (me->request, |
HTAtom_for (tmp)); |
HTAtom_for (tmp)); |
|
|
/* associate the anchor to the request */ |
|
HTRequest_setEntityAnchor (me->request, HTAnchor_parent (me->source)); |
|
|
|
/* define other request characteristics */ |
/* define other request characteristics */ |
#ifdef _WINDOWS |
#ifdef _WINDOWS |
HTRequest_setPreemptive (me->request, NO); |
HTRequest_setPreemptive (me->request, NO); |