version 1.385, 2009/04/24 16:00:42
|
version 1.386, 2009/05/06 12:30:19
|
Line 3220 int PutObjectWWW (int docid, char *fileN
|
Line 3220 int PutObjectWWW (int docid, char *fileN
|
{ |
{ |
AHTReqContext *me; |
AHTReqContext *me; |
CHARSET charset; |
CHARSET charset; |
|
HTParentAnchor *dest_anc_parent; |
int status; |
int status; |
unsigned long file_size = 0; |
unsigned long file_size = 0; |
char *fileURL; |
char *fileURL; |
char *etag = NULL; |
char *etag = NULL; |
HTParentAnchor *dest_anc_parent; |
|
char *esc_url; |
char *esc_url; |
int UsePreconditions; |
int UsePreconditions; |
char url_name[MAX_LENGTH]; |
char url_name[MAX_LENGTH]; |
char *resource_name, *localfilename; |
char *resource_name, *localfilename; |
char *tmp2; |
char *tmp2; |
char file_name[MAX_LENGTH]; |
char file_name[MAX_LENGTH]; |
|
ThotBool lost_update_check = FALSE; |
|
|
if (mode & AMAYA_SIMPLE_PUT) |
if (mode & AMAYA_SIMPLE_PUT) |
{ |
{ |
Line 3428 int PutObjectWWW (int docid, char *fileN
|
Line 3429 int PutObjectWWW (int docid, char *fileN
|
/* Should we use preconditions? */ |
/* Should we use preconditions? */ |
if (UsePreconditions) |
if (UsePreconditions) |
{ |
{ |
etag = HTAnchor_etag (HTAnchor_parent (me->dest)); |
HTRequest_setPreconditions(me->request, HT_NO_MATCH); |
|
HTRequest_addAfter(me->request, check_handler, NULL, NULL, HT_ALL, |
|
HT_FILTER_MIDDLE, YES); |
|
HTRequest_addAfter (me->request, HTAuthFilter, "http://*", NULL, |
|
HT_NO_ACCESS, HT_FILTER_MIDDLE, YES); |
|
HTRequest_addAfter (me->request, HTAuthFilter, "http://*", NULL, |
|
HT_REAUTH, HT_FILTER_MIDDLE, YES); |
|
HTRequest_addAfter (me->request, HTAuthInfoFilter, "http://*", NULL, |
|
HT_ALL, HT_FILTER_MIDDLE, YES); |
|
HTRequest_addAfter (me->request, HTUseProxyFilter, "http://*", NULL, |
|
HT_USE_PROXY, HT_FILTER_MIDDLE, YES); |
|
} |
|
else |
|
{ |
|
//TtaGetEnvBoolean ("ENABLE_LOST_UPDATE_CHECK", &lost_update_check); |
|
if (lost_update_check) |
|
etag = HTAnchor_etag (HTAnchor_parent (me->dest)); |
if (etag) |
if (etag) |
HTRequest_setPreconditions(me->request, HT_MATCH_THIS); |
HTRequest_setPreconditions(me->request, HT_MATCH_THIS); |
else |
else |
{ |
/* don't use preconditions */ |
HTRequest_setPreconditions(me->request, HT_NO_MATCH); |
HTRequest_setPreconditions(me->request, HT_NO_MATCH); |
HTRequest_addAfter(me->request, check_handler, NULL, NULL, HT_ALL, |
|
HT_FILTER_MIDDLE, YES); |
|
HTRequest_addAfter (me->request, HTAuthFilter, "http://*", NULL, |
|
HT_NO_ACCESS, HT_FILTER_MIDDLE, YES); |
|
HTRequest_addAfter (me->request, HTAuthFilter, "http://*", NULL, |
|
HT_REAUTH, HT_FILTER_MIDDLE, YES); |
|
HTRequest_addAfter (me->request, HTAuthInfoFilter, "http://*", NULL, |
|
HT_ALL, HT_FILTER_MIDDLE, YES); |
|
HTRequest_addAfter (me->request, HTUseProxyFilter, "http://*", NULL, |
|
HT_USE_PROXY, HT_FILTER_MIDDLE, YES); |
|
} |
|
} |
} |
else |
|
/* don't use preconditions */ |
|
HTRequest_setPreconditions(me->request, HT_NO_MATCH); |
|
|
|
/* don't use the cache while saving a document */ |
/* don't use the cache while saving a document */ |
HTRequest_setReloadMode (me->request, HT_CACHE_FLUSH); |
HTRequest_setReloadMode (me->request, HT_CACHE_FLUSH); |
Line 3472 int PutObjectWWW (int docid, char *fileN
|
Line 3475 int PutObjectWWW (int docid, char *fileN
|
|
|
|
|
/* make the request */ |
/* make the request */ |
if (UsePreconditions && !etag) |
if (UsePreconditions) |
status = HTHeadAnchor (me->dest, me->request); |
status = HTHeadAnchor (me->dest, me->request); |
else |
else |
status = HTPutDocumentAnchor (HTAnchor_parent (me->source), me->dest, me->request); |
status = HTPutDocumentAnchor (HTAnchor_parent (me->source), me->dest, me->request); |