lib_4.0C_1.fix
上传用户:zlh9724
上传日期:2007-01-04
资源大小:1991k
文件大小:128k
- diff -c Library/Repository/Implementation/HTAABrow.c:2.28.4.1 Library/Repository/Implementation/HTAABrow.c:2.28
- *** Library/Repository/Implementation/HTAABrow.c:2.28.4.1 Tue Jan 23 16:31:15 1996
- --- Library/Repository/Implementation/HTAABrow.c Tue Jan 23 16:31:15 1996
- ***************
- *** 768,810 ****
- return (HTPasswordDialog(req));
- }
-
- - /*
- - ** Setup HTTP access authentication
- - */
- - PUBLIC BOOL HTAA_authentication (HTRequest * request)
- - {
- - HTAAScheme scheme;
- - HTList *valid_schemes = HTList_new();
- - HTAssocList **scheme_specifics = NULL;
- - char *tmplate = NULL;
- -
- - if (request->WWWAAScheme) {
- - if ((scheme = HTAAScheme_enum(request->WWWAAScheme)) != HTAA_UNKNOWN) {
- - HTList_addObject(valid_schemes, (void *) scheme);
- - if (!scheme_specifics) {
- - int i;
- - scheme_specifics = (HTAssocList**)
- - malloc(HTAA_MAX_SCHEMES * sizeof(HTAssocList*));
- - if (!scheme_specifics)
- - outofmem(__FILE__, "HTTPAuthentication");
- - for (i=0; i < HTAA_MAX_SCHEMES; i++)
- - scheme_specifics[i] = NULL;
- - }
- - scheme_specifics[scheme] = HTAA_parseArgList(request->WWWAARealm);
- - } else if (PROT_TRACE) {
- - HTRequest_addError(request, ERR_INFO, NO, HTERR_UNKNOWN_AA,
- - (void *) request->WWWAAScheme, 0, "HTTPAuthentication");
- - return NO;
- - }
- - }
- - if (request->WWWprotection) {
- - if (PROT_TRACE)
- - TTYPrint(TDEST, "Protection template set to `%s'n",
- - request->WWWprotection);
- - StrAllocCopy(tmplate, request->WWWprotection);
- - }
- - request->valid_schemes = valid_schemes;
- - request->scheme_specifics = scheme_specifics;
- - request->prot_template = tmplate;
- - return YES;
- - }
- --- 768,770 ----
- diff -c Library/Repository/Implementation/HTAABrow.html:2.20.4.1 Library/Repository/Implementation/HTAABrow.html:2.20
- *** Library/Repository/Implementation/HTAABrow.html:2.20.4.1 Tue Jan 23 16:31:16 1996
- --- Library/Repository/Implementation/HTAABrow.html Tue Jan 23 16:31:16 1996
- ***************
- *** 1,6 ****
- <HEAD>
- <TITLE>Browser side Access Auth</TITLE>
- ! <!-- Changed by: Henrik Frystyk Nielsen, 20-Jan-1996 -->
- </HEAD>
- <BODY>
-
- --- 1,6 ----
- <HEAD>
- <TITLE>Browser side Access Auth</TITLE>
- ! <!-- Changed by: Henrik Frystyk Nielsen, 19-Nov-1995 -->
- </HEAD>
- <BODY>
-
- ***************
- *** 186,197 ****
- extern void HTAAForwardAuth_set (CONST char * scheme_name,
- CONST char * scheme_specifics);
- extern void HTAAForwardAuth_reset (void);
- - </PRE>
- -
- - <H2>Setup HTTP access authentication</H2>
- -
- - <PRE>
- - extern BOOL HTAA_authentication (HTRequest * request);
- </PRE>
-
- <PRE>
- --- 186,191 ----
- diff -c Library/Repository/Implementation/HTAccess.c:1.108.2.1 Library/Repository/Implementation/HTAccess.c:1.108
- *** Library/Repository/Implementation/HTAccess.c:1.108.2.1 Tue Jan 23 16:31:17 1996
- --- Library/Repository/Implementation/HTAccess.c Tue Jan 23 16:31:17 1996
- ***************
- *** 423,443 ****
- ** to NNTP and puts into the "newsgroups" header
- ** Returns YES if request accepted, else NO
- */
- ! PUBLIC BOOL HTCopyAnchor (HTAnchor * src_anchor, HTRequest * main_dest)
- {
- HTRequest * src_req;
- HTList * cur;
- ! if (!src_anchor || !main_dest) {
- ! if (WWWTRACE) TTYPrint(TDEST, "Copy........ BAD ARGUMENTn");
- return NO;
- - }
-
- /* Build the POST web if not already there */
- ! if (!main_dest->source) {
- ! src_req = HTRequest_dupInternal(main_dest); /* Get a duplicate */
- HTAnchor_clearHeader((HTParentAnchor *) src_anchor);
- - src_req->method = METHOD_GET;
- src_req->reload = HT_MEM_REFRESH;
- src_req->output_stream = NULL;
- src_req->output_format = WWW_SOURCE; /* We want source (for now) */
-
- --- 423,441 ----
- ** to NNTP and puts into the "newsgroups" header
- ** Returns YES if request accepted, else NO
- */
- ! PUBLIC BOOL HTCopyAnchor (HTAnchor * src_anchor, HTRequest * main_req)
- {
- HTRequest * src_req;
- HTList * cur;
- ! if (!src_anchor || !main_req)
- return NO;
-
- /* Build the POST web if not already there */
- ! if (!main_req->source) {
- ! src_req = HTRequest_dup(main_req); /* First set up the source */
- HTAnchor_clearHeader((HTParentAnchor *) src_anchor);
- src_req->reload = HT_MEM_REFRESH;
- + src_req->source = src_req; /* Point to myself */
- src_req->output_stream = NULL;
- src_req->output_format = WWW_SOURCE; /* We want source (for now) */
-
- ***************
- *** 448,470 ****
- HTMethod method = HTLink_method(main_link);
- if (!main_link || method==METHOD_INVALID) {
- if (WWWTRACE)
- ! TTYPrint(TDEST, "Copy Anchor. No destination found or unspecified methodn");
- HTRequest_delete(src_req);
- return NO;
- }
- ! main_dest->GenMask |= HT_G_DATE; /* Send date header */
- ! main_dest->reload = HT_CACHE_REFRESH;
- ! main_dest->method = method;
- ! main_dest->input_format = WWW_SOURCE;
- ! HTRequest_addDestination(src_req, main_dest);
- ! if (HTLoadAnchor(main_anchor, main_dest) == NO)
- ! return NO;
- }
-
- /* For all other links in the source anchor */
- if ((cur = HTAnchor_subLinks(src_anchor))) {
- HTLink * pres;
- ! while ((pres = (HTLink *) HTList_nextObject(cur))) {
- HTAnchor *dest = HTLink_destination(pres);
- HTMethod method = HTLink_method(pres);
- HTRequest *dest_req;
- --- 446,472 ----
- HTMethod method = HTLink_method(main_link);
- if (!main_link || method==METHOD_INVALID) {
- if (WWWTRACE)
- ! TTYPrint(TDEST, "Copy Anchor. No destination found or unspecified method");
- HTRequest_delete(src_req);
- return NO;
- }
- ! if (HTLink_result(main_link) == HT_LINK_NONE) {
- ! main_req->GenMask |= HT_G_DATE; /* Send date header */
- ! main_req->source = src_req;
- ! main_req->reload = HT_CACHE_REFRESH;
- ! main_req->method = method;
- ! HTRequest_addDestination(src_req, main_req);
- ! main_req->input_format = WWW_SOURCE;
- ! if (HTLoadAnchor(main_anchor, main_req) == NO)
- ! return NO;
- ! }
- }
-
- /* For all other links in the source anchor */
- if ((cur = HTAnchor_subLinks(src_anchor))) {
- HTLink * pres;
- ! while ((pres = (HTLink *) HTList_nextObject(cur)) &&
- ! HTLink_result(pres) == HT_LINK_NONE) {
- HTAnchor *dest = HTLink_destination(pres);
- HTMethod method = HTLink_method(pres);
- HTRequest *dest_req;
- ***************
- *** 474,495 ****
- dest);
- return NO;
- }
- ! dest_req = HTRequest_dupInternal(main_dest);
- dest_req->GenMask |= HT_G_DATE; /* Send date header */
- dest_req->reload = HT_CACHE_REFRESH;
- dest_req->method = method;
- dest_req->output_stream = NULL;
- dest_req->output_format = WWW_SOURCE;
- - HTRequest_addDestination(src_req, dest_req);
-
- if (HTLoadAnchor(dest, dest_req) == NO)
- return NO;
- }
- }
- } else { /* Use the existing Post Web and restart it */
- ! src_req = main_dest->source;
- if (src_req->mainDestination)
- ! if (HTLoadDocument(main_dest, NO) == NO)
- return NO;
- if (src_req->destinations) {
- HTRequest * pres;
- --- 476,499 ----
- dest);
- return NO;
- }
- ! dest_req = HTRequest_dup(main_req);
- dest_req->GenMask |= HT_G_DATE; /* Send date header */
- + dest_req->source = src_req;
- dest_req->reload = HT_CACHE_REFRESH;
- dest_req->method = method;
- + HTRequest_addDestination(src_req, dest_req);
- +
- dest_req->output_stream = NULL;
- dest_req->output_format = WWW_SOURCE;
-
- if (HTLoadAnchor(dest, dest_req) == NO)
- return NO;
- }
- }
- } else { /* Use the existing Post Web and restart it */
- ! src_req = main_req->source;
- if (src_req->mainDestination)
- ! if (HTLoadDocument(main_req, NO) == NO)
- return NO;
- if (src_req->destinations) {
- HTRequest * pres;
- ***************
- *** 519,528 ****
- HTRequest * dest_req)
- {
- HTMethod allowed = HTAnchor_methods(dest_anchor);
- ! if (!src_anchor || !dest_anchor || !dest_req) {
- ! if (WWWTRACE) TTYPrint(TDEST, "Upload...... BAD ARGUMENTn");
- return NO;
- - }
- if (!(allowed & dest_req->method)) {
- BOOL confirm = NO;
- HTAlertCallback *cbf = HTAlert_find(HT_A_CONFIRM);
- --- 523,530 ----
- HTRequest * dest_req)
- {
- HTMethod allowed = HTAnchor_methods(dest_anchor);
- ! if (!src_anchor || !dest_anchor || !dest_req)
- return NO;
- if (!(allowed & dest_req->method)) {
- BOOL confirm = NO;
- HTAlertCallback *cbf = HTAlert_find(HT_A_CONFIRM);
- diff -c Library/Repository/Implementation/HTConLen.c:2.4.4.1 Library/Repository/Implementation/HTConLen.c:2.4
- *** Library/Repository/Implementation/HTConLen.c:2.4.4.1 Tue Jan 23 16:31:18 1996
- --- Library/Repository/Implementation/HTConLen.c Tue Jan 23 16:31:18 1996
- ***************
- *** 125,131 ****
- me->head = cur->next;
- free_buf(cur);
- }
- - me->give_up = YES;
- return HT_OK;
- }
-
- --- 125,130 ----
- ***************
- *** 187,201 ****
-
- PRIVATE int buf_abort (HTStream * me, HTList * e)
- {
- - HTBufItem * cur;
- if (!me->give_up)
- free_buf_all(me);
- if (me->target)
- (*me->target->isa->abort)(me->target,e);
- - while ((cur = me->head)) {
- - me->head = cur->next;
- - free_buf(cur);
- - }
- free(me);
- if (PROT_TRACE) TTYPrint(TDEST, "Length...... ABORTING...n");
- return HT_ERROR;
- --- 186,195 ----
- diff -c Library/Repository/Implementation/HTDialog.c:2.3.2.1 Library/Repository/Implementation/HTDialog.c:2.3
- *** Library/Repository/Implementation/HTDialog.c:2.3.2.1 Tue Jan 23 16:31:19 1996
- --- Library/Repository/Implementation/HTDialog.c Tue Jan 23 16:31:20 1996
- ***************
- *** 136,153 ****
- break;
-
- case HT_PROG_WRITE:
- ! if (HTRequest_isPostWeb(request)) {
- ! HTParentAnchor *anchor=HTRequest_anchor(HTRequest_source(request));
- ! long cl = HTAnchor_length(anchor);
- ! if (cl > 0) {
- ! long b_write = HTRequest_bytesWritten(request);
- ! double pro = (double) b_write/cl*100;
- ! char buf[10];
- ! HTNumToStr((unsigned long) cl, buf, 10);
- ! TTYPrint(TDEST, "Written (%d%% of %s)n", (int) pro, buf);
- ! } else
- ! TTYPrint(TDEST, "Writing...n");
- ! }
- break;
-
- case HT_PROG_DONE:
- --- 136,142 ----
- break;
-
- case HT_PROG_WRITE:
- ! TTYPrint(TDEST, "Writing...n");
- break;
-
- case HT_PROG_DONE:
- diff -c Library/Repository/Implementation/HTEvntrg.c:2.24.2.1 Library/Repository/Implementation/HTEvntrg.c:2.24
- *** Library/Repository/Implementation/HTEvntrg.c:2.24.2.1 Tue Jan 23 16:31:20 1996
- --- Library/Repository/Implementation/HTEvntrg.c Tue Jan 23 16:31:20 1996
- ***************
- *** 431,437 ****
- TTYPrint(TDEST, "Req Update.. updating for socket %un", s) ;
- rqp->unregister = (ops & FD_UNREGISTER) ? YES : NO;
- rqp->actions[0].rq = rq ;
- ! rqp->actions[0].ops |= ops ;
- rqp->actions[0].cbf = cbf ;
- rqp->actions[0].p = p ;
- return;
- --- 431,437 ----
- TTYPrint(TDEST, "Req Update.. updating for socket %un", s) ;
- rqp->unregister = (ops & FD_UNREGISTER) ? YES : NO;
- rqp->actions[0].rq = rq ;
- ! rqp->actions[0].ops = ops ;
- rqp->actions[0].cbf = cbf ;
- rqp->actions[0].p = p ;
- return;
- ***************
- *** 459,466 ****
- }
-
- if (THD_TRACE)
- ! TTYPrint(TDEST, "UnRegister.. %s entry for socket %d with ops %xn",
- ! (found) ? "Found" : "Didn't find", s, (unsigned) ops);
- if (! found)
- return 0;
-
- --- 459,466 ----
- }
-
- if (THD_TRACE)
- ! TTYPrint(TDEST, "UnRegister.. %s entry for socket %dn",
- ! (found) ? "Found" : "Didn't find", s);
- if (! found)
- return 0;
-
- ***************
- *** 844,853 ****
- HTRequest * rqp = NULL;
- HTEventCallback *cbf = HTEvent_Retrieve( s, ops, &rqp);
- /* although it makes no sense, callbacks can be null */
- ! if (!cbf || !rqp || rqp->priority == HT_PRIORITY_OFF) {
- ! if (THD_TRACE) TTYPrint(TDEST, "Callback.... No callback foundn");
- return (0);
- - }
- return (*cbf)(s, rqp, ops);
- }
-
- --- 844,851 ----
- HTRequest * rqp = NULL;
- HTEventCallback *cbf = HTEvent_Retrieve( s, ops, &rqp);
- /* although it makes no sense, callbacks can be null */
- ! if (!cbf || rqp->priority == HT_PRIORITY_OFF)
- return (0);
- return (*cbf)(s, rqp, ops);
- }
-
- ***************
- *** 860,869 ****
- HTRequest * rqp = NULL;
- HTEventCallback *cbf = HTEvent_Retrieve( s, ops, &rqp);
- /* although it makes no sense, callbacks can be null*/
- ! if (!cbf || !rqp || rqp->priority == HT_PRIORITY_OFF) {
- ! if (THD_TRACE) TTYPrint(TDEST, "UserCallback No callback foundn");
- return (0);
- - }
- return (*cbf)(s, rqp, ops);
- }
-
- --- 858,865 ----
- HTRequest * rqp = NULL;
- HTEventCallback *cbf = HTEvent_Retrieve( s, ops, &rqp);
- /* although it makes no sense, callbacks can be null*/
- ! if (!cbf || rqp->priority == HT_PRIORITY_OFF)
- return (0);
- return (*cbf)(s, rqp, ops);
- }
-
- ***************
- *** 966,972 ****
- s = all_fds.fd_array[ui] ;
- #else
- for (s = 0 ; s <= max_sock; s++) {
- ! if (FD_ISSET(s, fdp))
- #endif
- {
- TTYPrint(TDEST, "%4dn", s);
- --- 962,968 ----
- s = all_fds.fd_array[ui] ;
- #else
- for (s = 0 ; s <= max_sock; s++) {
- ! if (FD_ISSET(s, &all_fds))
- #endif
- {
- TTYPrint(TDEST, "%4dn", s);
- diff -c Library/Repository/Implementation/HTFile.c:1.106.2.1 Library/Repository/Implementation/HTFile.c:1.106
- *** Library/Repository/Implementation/HTFile.c:1.106.2.1 Tue Jan 23 16:31:21 1996
- --- Library/Repository/Implementation/HTFile.c Tue Jan 23 16:31:21 1996
- ***************
- *** 119,125 ****
- ** Reads the directory "path"
- ** Returns:
- ** HT_ERROR Error
- ! ** HT_FORBIDDEN Directory reading not allowed
- ** HT_LOADED Successfully read the directory
- */
- PRIVATE int HTFile_readDir (HTRequest * request, file_info *file)
- --- 119,125 ----
- ** Reads the directory "path"
- ** Returns:
- ** HT_ERROR Error
- ! ** HT_NO_ACCESS Directory reading not allowed
- ** HT_LOADED Successfully read the directory
- */
- PRIVATE int HTFile_readDir (HTRequest * request, file_info *file)
- ***************
- *** 136,142 ****
- if (dir_access == HT_DIR_FORBID) {
- HTRequest_addError(request, ERR_FATAL, NO, HTERR_FORBIDDEN,
- NULL, 0, "HTFile_readDir");
- ! return HT_FORBIDDEN;
- }
-
- /* Initialize path name for stat() */
- --- 136,142 ----
- if (dir_access == HT_DIR_FORBID) {
- HTRequest_addError(request, ERR_FATAL, NO, HTERR_FORBIDDEN,
- NULL, 0, "HTFile_readDir");
- ! return HT_NO_ACCESS;
- }
-
- /* Initialize path name for stat() */
- ***************
- *** 160,166 ****
- "Read dir.... `%s' not foundn", DEFAULT_DIR_FILE);
- HTRequest_addError(request, ERR_FATAL, NO, HTERR_FORBIDDEN,
- NULL, 0, "HTFile_readDir");
- ! return HT_FORBIDDEN;
- }
- }
-
- --- 160,166 ----
- "Read dir.... `%s' not foundn", DEFAULT_DIR_FILE);
- HTRequest_addError(request, ERR_FATAL, NO, HTERR_FORBIDDEN,
- NULL, 0, "HTFile_readDir");
- ! return HT_NO_ACCESS;
- }
- }
-
- ***************
- *** 363,371 ****
- file_info *file = (file_info *) net->context;
-
- /* Free stream with data TO Local file system */
- ! if (HTRequest_isDestination(req))
- ! HTRequest_removeDestination(req);
- ! else if (req->input_stream) {
- if (status == HT_INTERRUPTED)
- (*req->input_stream->isa->abort)(req->input_stream, NULL);
- else
- --- 363,369 ----
- file_info *file = (file_info *) net->context;
-
- /* Free stream with data TO Local file system */
- ! if (!HTRequest_isDestination(req) && req->input_stream) {
- if (status == HT_INTERRUPTED)
- (*req->input_stream->isa->abort)(req->input_stream, NULL);
- else
- ***************
- *** 384,390 ****
- FREE(file->local);
- free(file);
- }
- ! HTNet_delete(net, req->internal ? HT_IGNORE : status);
- return YES;
- }
-
- --- 382,388 ----
- FREE(file->local);
- free(file);
- }
- ! HTNet_delete(net, status);
- return YES;
- }
-
- ***************
- *** 418,426 ****
- file->state = FS_BEGIN;
- net->context = file;
- } if (ops == FD_CLOSE) { /* Interrupted */
- ! HTRequest_addError(request, ERR_FATAL, NO, HTERR_INTERRUPTED,
- ! NULL, 0, "HTLoadHTTP");
- ! FileCleanup(request, HT_INTERRUPTED);
- return HT_OK;
- } else
- file = (file_info *) net->context; /* Get existing copy */
- --- 416,425 ----
- file->state = FS_BEGIN;
- net->context = file;
- } if (ops == FD_CLOSE) { /* Interrupted */
- ! if(HTRequest_isPostWeb(request)&&!HTRequest_isMainDestination(request))
- ! FileCleanup(request, HT_IGNORE);
- ! else
- ! FileCleanup(request, HT_INTERRUPTED);
- return HT_OK;
- } else
- file = (file_info *) net->context; /* Get existing copy */
- ***************
- *** 560,565 ****
- --- 559,573 ----
- TTYPrint(TDEST,"HTLoadFile.. `%s' opened using FILE %pn",
- file->local, file->fp);
- #endif /* !NO_UNIX_IO */
- + file->state = FS_NEED_TARGET;
- + break;
- +
- + case FS_NEED_TARGET:
- + /*
- + ** We need to wait for the destinations to get ready
- + */
- + if (HTRequest_isSource(request) && !request->output_stream)
- + return HT_OK;
-
- /* Set up stream TO local file system */
- request->input_stream = HTBufWriter_new(net, YES, 512);
- ***************
- *** 570,586 ****
- ** before all destinations are ready. If destination then
- ** register the input stream and get ready for read
- */
- ! if (HTRequest_isDestination(request)) {
- HTEvent_Register(net->sockfd, request, (SockOps) FD_READ,
- HTLoadFile, net->priority);
- HTRequest_linkDestination(request);
- }
- - file->state = FS_NEED_TARGET;
- - if (HTRequest_isSource(request) && !HTRequest_destinationsReady(request))
- - return HT_OK;
- - break;
-
- - case FS_NEED_TARGET:
- /*
- ** Set up read buffer and streams.
- ** If cache element, we know that it's MIME, so call MIME parser
- --- 578,589 ----
- ** before all destinations are ready. If destination then
- ** register the input stream and get ready for read
- */
- ! if (HTRequest_isPostWeb(request)) {
- HTEvent_Register(net->sockfd, request, (SockOps) FD_READ,
- HTLoadFile, net->priority);
- HTRequest_linkDestination(request);
- }
-
- /*
- ** Set up read buffer and streams.
- ** If cache element, we know that it's MIME, so call MIME parser
- ***************
- *** 636,690 ****
-
- case FS_GOT_DATA:
- if (HTRequest_isPostWeb(request)) {
- if (HTRequest_isDestination(request)) {
- HTLink *link =
- HTAnchor_findLink((HTAnchor *) request->source->anchor,
- (HTAnchor *) anchor);
- HTLink_setResult(link, HT_LINK_OK);
- }
- ! }
- ! FileCleanup(request, HT_LOADED);
- return HT_OK;
- break;
-
- case FS_NO_DATA:
- if (HTRequest_isPostWeb(request)) {
- if (HTRequest_isDestination(request)) {
- HTLink *link =
- HTAnchor_findLink((HTAnchor *) request->source->anchor,
- (HTAnchor *) anchor);
- HTLink_setResult(link, HT_LINK_OK);
- }
- ! }
- ! FileCleanup(request, HT_NO_DATA);
- return HT_OK;
- break;
-
- case FS_RETRY:
- if (HTRequest_isPostWeb(request)) {
- if (HTRequest_isDestination(request)) {
- HTLink *link =
- HTAnchor_findLink((HTAnchor *) request->source->anchor,
- (HTAnchor *) anchor);
- HTLink_setResult(link, HT_LINK_ERROR);
- }
- ! HTRequest_killPostWeb(request);
- ! }
- ! FileCleanup(request, HT_RETRY);
- return HT_OK;
- break;
-
- case FS_ERROR:
- if (HTRequest_isPostWeb(request)) {
- if (HTRequest_isDestination(request)) {
- HTLink *link =
- HTAnchor_findLink((HTAnchor *) request->source->anchor,
- (HTAnchor *) anchor);
- HTLink_setResult(link, HT_LINK_ERROR);
- }
- ! HTRequest_killPostWeb(request);
- ! }
- ! FileCleanup(request, HT_ERROR);
- return HT_OK;
- break;
- }
- --- 639,706 ----
-
- case FS_GOT_DATA:
- if (HTRequest_isPostWeb(request)) {
- + FileCleanup(request, HTRequest_isMainDestination(request) ?
- + HT_LOADED : HT_IGNORE);
- if (HTRequest_isDestination(request)) {
- HTLink *link =
- HTAnchor_findLink((HTAnchor *) request->source->anchor,
- (HTAnchor *) anchor);
- HTLink_setResult(link, HT_LINK_OK);
- }
- ! HTRequest_removeDestination(request);
- ! } else
- ! FileCleanup(request, HT_LOADED);
- return HT_OK;
- break;
-
- case FS_NO_DATA:
- if (HTRequest_isPostWeb(request)) {
- + FileCleanup(request, HTRequest_isMainDestination(request) ?
- + HT_NO_DATA : HT_IGNORE);
- if (HTRequest_isDestination(request)) {
- HTLink *link =
- HTAnchor_findLink((HTAnchor *) request->source->anchor,
- (HTAnchor *) anchor);
- HTLink_setResult(link, HT_LINK_OK);
- }
- ! HTRequest_removeDestination(request);
- ! } else
- ! FileCleanup(request, HT_NO_DATA);
- return HT_OK;
- break;
-
- case FS_RETRY:
- if (HTRequest_isPostWeb(request)) {
- + FileCleanup(request, HTRequest_isMainDestination(request) ?
- + HT_RETRY : HT_IGNORE);
- + HTRequest_killPostWeb(request);
- if (HTRequest_isDestination(request)) {
- HTLink *link =
- HTAnchor_findLink((HTAnchor *) request->source->anchor,
- (HTAnchor *) anchor);
- HTLink_setResult(link, HT_LINK_ERROR);
- }
- ! HTRequest_removeDestination(request);
- ! } else
- ! FileCleanup(request, HT_RETRY);
- return HT_OK;
- break;
-
- case FS_ERROR:
- + /* Clean up the other connections or just this one */
- if (HTRequest_isPostWeb(request)) {
- + FileCleanup(request, HTRequest_isMainDestination(request) ?
- + HT_ERROR : HT_IGNORE);
- + HTRequest_killPostWeb(request);
- if (HTRequest_isDestination(request)) {
- HTLink *link =
- HTAnchor_findLink((HTAnchor *) request->source->anchor,
- (HTAnchor *) anchor);
- HTLink_setResult(link, HT_LINK_ERROR);
- }
- ! HTRequest_removeDestination(request);
- ! } else
- ! FileCleanup(request, HT_ERROR);
- return HT_OK;
- break;
- }
- diff -c Library/Repository/Implementation/HTInit.html:2.28.2.1 Library/Repository/Implementation/HTInit.html:2.28
- *** Library/Repository/Implementation/HTInit.html:2.28.2.1 Tue Jan 23 16:31:22 1996
- --- Library/Repository/Implementation/HTInit.html Tue Jan 23 16:31:22 1996
- ***************
- *** 1,7 ****
- <HTML>
- <HEAD>
- <TITLE>Initialization Routines</TITLE>
- ! <!-- Changed by: Henrik Frystyk Nielsen, 22-Jan-1996 -->
- </HEAD>
- <BODY>
- <H1>Initialization Module</H1>
- --- 1,7 ----
- <HTML>
- <HEAD>
- <TITLE>Initialization Routines</TITLE>
- ! <!-- Changed by: Henrik Frystyk Nielsen, 8-Dec-1995 -->
- </HEAD>
- <BODY>
- <H1>Initialization Module</H1>
- ***************
- *** 36,42 ****
-
- <IMG SRC="../../Icons/32x32/warning.gif"> <B>PLEASE SEE THE <A
- HREF="HTBInit.html">HTBInit MODULE</A> FOR STANDARD BINDINGS BETWEEN
- ! FILE EXTENSIONS AND MEDIA TYPES.</B>
-
- <PRE>
- #ifndef HTINIT_H
- --- 36,42 ----
-
- <IMG SRC="../../Icons/32x32/warning.gif"> <B>PLEASE SEE THE <A
- HREF="HTBInit.html">HTBInit MODULE</A> FOR STANDARD BINDINGS BETWEEN
- ! FILE EXTENSIONS AND MEDIA TYPES.
-
- <PRE>
- #ifndef HTINIT_H
- ***************
- *** 95,101 ****
-
- <PRE>
- #include "HTIcons.h"
- ! #include "WWWHTTP.h"
- #include "HTFile.h"
- #include "HTFTP.h"
- #include "HTGopher.h"
- --- 95,101 ----
-
- <PRE>
- #include "HTIcons.h"
- ! #include "HTTP.h"
- #include "HTFile.h"
- #include "HTFTP.h"
- #include "HTGopher.h"
- diff -c Library/Repository/Implementation/HTMIME.c:2.45.2.1 Library/Repository/Implementation/HTMIME.c:2.45
- *** Library/Repository/Implementation/HTMIME.c:2.45.2.1 Tue Jan 23 16:31:23 1996
- --- Library/Repository/Implementation/HTMIME.c Tue Jan 23 16:31:23 1996
- ***************
- *** 499,505 ****
- break;
-
- case LOCATION:
- ! request->redirectionAnchor = HTAnchor_findAddress(HTStrip(ptr));
- state = JUNK_LINE;
- break;
-
- --- 499,513 ----
- break;
-
- case LOCATION:
- ! #if 0
- ! /*
- ! ** Doesn't work as a redirection header might contain a '='
- ! ** Thanks to mitch@tam.net (Mitch DeShields)
- ! */
- ! if ((value = HTNextField(&ptr)) != NULL)
- ! StrAllocCopy(request->redirect, value);
- ! #endif
- ! StrAllocCopy(request->redirect, ptr);
- state = JUNK_LINE;
- break;
-
- ***************
- *** 586,592 ****
- if (me->EOLstate == EOL_FCR) {
- if (*b == CR) { /* End of header */
- int status = parseheader(me, me->request, me->anchor);
- ! HTNet_setBytesRead(me->net, l);
- if (status != HT_OK)
- return status;
- } else if (*b == LF) /* CRLF */
- --- 594,600 ----
- if (me->EOLstate == EOL_FCR) {
- if (*b == CR) { /* End of header */
- int status = parseheader(me, me->request, me->anchor);
- ! me->net->bytes_read = l;
- if (status != HT_OK)
- return status;
- } else if (*b == LF) /* CRLF */
- ***************
- *** 604,610 ****
- me->EOLstate = EOL_SCR;
- else if (*b == LF) { /* End of header */
- int status = parseheader(me, me->request, me->anchor);
- ! HTNet_setBytesRead(me->net, l);
- if (status != HT_OK)
- return status;
- } else if (WHITE(*b)) { /* Folding: LF SP or CR LF SP */
- --- 612,618 ----
- me->EOLstate = EOL_SCR;
- else if (*b == LF) { /* End of header */
- int status = parseheader(me, me->request, me->anchor);
- ! me->net->bytes_read = l;
- if (status != HT_OK)
- return status;
- } else if (WHITE(*b)) { /* Folding: LF SP or CR LF SP */
- ***************
- *** 618,624 ****
- } else if (me->EOLstate == EOL_SCR) {
- if (*b==CR || *b==LF) { /* End of header */
- int status = parseheader(me, me->request, me->anchor);
- ! HTNet_setBytesRead(me->net, l);
- if (status != HT_OK)
- return status;
- } else if (WHITE(*b)) { /* Folding: LF CR SP or CR LF CR SP */
- --- 626,632 ----
- } else if (me->EOLstate == EOL_SCR) {
- if (*b==CR || *b==LF) { /* End of header */
- int status = parseheader(me, me->request, me->anchor);
- ! me->net->bytes_read = l;
- if (status != HT_OK)
- return status;
- } else if (WHITE(*b)) { /* Folding: LF CR SP or CR LF CR SP */
- ***************
- *** 643,662 ****
- ** that we get the correct content length of data
- */
- if (l > 0) {
- - HTParentAnchor * anchor = me->anchor;
- if (me->target) {
- int status = (*me->target->isa->put_block)(me->target, b, l);
- if (status == HT_OK)
- /* Check if CL at all - thanks to jwei@hal.com (John Wei) */
- return (me->request->method == METHOD_HEAD ||
- ! (anchor->content_length >= 0 &&
- ! HTNet_bytesRead(me->net) >= anchor->content_length)) ?
- HT_LOADED : HT_OK;
- else
- return status;
- ! } else if (anchor->header_parsed)
- ! return HT_LOADED;
- ! else
- return HT_WOULD_BLOCK;
- }
- return HT_OK;
- --- 651,667 ----
- ** that we get the correct content length of data
- */
- if (l > 0) {
- if (me->target) {
- int status = (*me->target->isa->put_block)(me->target, b, l);
- if (status == HT_OK)
- /* Check if CL at all - thanks to jwei@hal.com (John Wei) */
- return (me->request->method == METHOD_HEAD ||
- ! (me->anchor->content_length >= 0 &&
- ! me->net->bytes_read >= me->anchor->content_length)) ?
- HT_LOADED : HT_OK;
- else
- return status;
- ! } else
- return HT_WOULD_BLOCK;
- }
- return HT_OK;
- diff -c Library/Repository/Implementation/HTMIMERq.c:2.8.2.1 Library/Repository/Implementation/HTMIMERq.c:2.8
- *** Library/Repository/Implementation/HTMIMERq.c:2.8.2.1 Tue Jan 23 16:31:24 1996
- --- Library/Repository/Implementation/HTMIMERq.c Tue Jan 23 16:31:24 1996
- ***************
- *** 197,207 ****
- return b ? PUTBLOCK(b, l) : HT_OK;
- else {
- MIMEMakeRequest(me, me->request);
- ! if (HTRequest_isDestination(me->request)) {
- ! (*me->target->isa->flush)(me->target);
- ! HTNet_setBytesWritten(me->request->net, 0);
- }
- ! me->transparent = YES;
- return b ? PUTBLOCK(b, l) : HT_OK;
- }
- }
- --- 197,210 ----
- return b ? PUTBLOCK(b, l) : HT_OK;
- else {
- MIMEMakeRequest(me, me->request);
- ! #if 0
- ! if ((status = PUTBLOCK(HTChunk_data(me->buffer),
- ! HTChunk_size(me->buffer))) == HT_OK) {
- ! me->transparent = YES;
- ! return b ? PUTBLOCK(b, l) : HT_OK;
- }
- ! #endif
- ! me->transparent = YES;
- return b ? PUTBLOCK(b, l) : HT_OK;
- }
- }
- diff -c Library/Repository/Implementation/HTNet.c:2.44.2.1 Library/Repository/Implementation/HTNet.c:2.44
- *** Library/Repository/Implementation/HTNet.c:2.44.2.1 Tue Jan 23 16:31:25 1996
- --- Library/Repository/Implementation/HTNet.c Tue Jan 23 16:31:25 1996
- ***************
- *** 503,520 ****
-
- /* Close socket */
- if (net->sockfd != INVSOC) {
- - HTEvent_UnRegister(net->sockfd, (SockOps) FD_ALL);
- if (HTDNS_socket(net->dns) == INVSOC) {
- if ((status = NETCLOSE(net->sockfd)) < 0)
- HTRequest_addSystemError(net->request, ERR_FATAL,
- socerrno, NO, "NETCLOSE");
- if (WWWTRACE)
- TTYPrint(TDEST, "HTNet_delete closing %dn", net->sockfd);
- } else {
- if (WWWTRACE)
- TTYPrint(TDEST, "HTNet_delete keeping %dn", net->sockfd);
- HTDNS_clearActive(net->dns);
- /* Here we should probably use a low priority */
- HTEvent_Register(net->sockfd, net->request, (SockOps) FD_READ,
- HTDNS_closeSocket, net->priority);
- }
- --- 503,521 ----
-
- /* Close socket */
- if (net->sockfd != INVSOC) {
- if (HTDNS_socket(net->dns) == INVSOC) {
- if ((status = NETCLOSE(net->sockfd)) < 0)
- HTRequest_addSystemError(net->request, ERR_FATAL,
- socerrno, NO, "NETCLOSE");
- if (WWWTRACE)
- TTYPrint(TDEST, "HTNet_delete closing %dn", net->sockfd);
- + HTEvent_UnRegister(net->sockfd, (SockOps) FD_ALL);
- } else {
- if (WWWTRACE)
- TTYPrint(TDEST, "HTNet_delete keeping %dn", net->sockfd);
- HTDNS_clearActive(net->dns);
- /* Here we should probably use a low priority */
- + HTEvent_UnRegister(net->sockfd, (SockOps) FD_ALL);
- HTEvent_Register(net->sockfd, net->request, (SockOps) FD_READ,
- HTDNS_closeSocket, net->priority);
- }
- diff -c Library/Repository/Implementation/HTNetMan.html:2.5.4.1 Library/Repository/Implementation/HTNetMan.html:2.6
- *** Library/Repository/Implementation/HTNetMan.html:2.5.4.1 Tue Jan 23 16:31:26 1996
- --- Library/Repository/Implementation/HTNetMan.html Tue Jan 23 16:31:26 1996
- ***************
- *** 1,7 ****
- <HTML>
- <HEAD>
- <TITLE>Asyncronous Socket Management</TITLE>
- ! <!-- Changed by: Henrik Frystyk Nielsen, 21-Jan-1996 -->
- </HEAD>
- <BODY>
-
- --- 1,7 ----
- <HTML>
- <HEAD>
- <TITLE>Asyncronous Socket Management</TITLE>
- ! <!-- Changed by: Henrik Frystyk Nielsen, 23-Sep-1995 -->
- </HEAD>
- <BODY>
-
- ***************
- *** 65,85 ****
- int home; /* Current home if multiple */
- time_t connecttime; /* Used on multihomed hosts */
- long bytes_read; /* Bytes read from network */
- ! long bytes_written; /* Bytes written to network */
- ! BOOL preemtive; /* Eff result from Request and Protocol */
- HTPriority priority; /* Priority of this request (event) */
- HTEventCallback * cbf; /* Library load routine */
- HTRequest * request; /* Link back to request structure */
- void * context; /* Protocol Specific context */
- };
-
- ! #define HTNet_bytesRead(me) ((me) ? (me)->bytes_read : -1)
- ! #define HTNet_bytesWritten(me) ((me) ? (me)->bytes_written : -1)
- !
- ! #define HTNet_setBytesRead(me,l) ((me) ? (me->bytes_read=(l)) : -1)
- ! #define HTNet_setBytesWritten(me,l) ((me) ? (me->bytes_written=(l)) :-1)
- !
- ! #define HTNet_dns(me) ((me) ? (me)->dns : NULL)
- </PRE>
-
- <PRE>
- --- 65,79 ----
- int home; /* Current home if multiple */
- time_t connecttime; /* Used on multihomed hosts */
- long bytes_read; /* Bytes read from network */
- ! BOOL preemptive; /* Eff result from Request and Protocol */
- HTPriority priority; /* Priority of this request (event) */
- HTEventCallback * cbf; /* Library load routine */
- HTRequest * request; /* Link back to request structure */
- void * context; /* Protocol Specific context */
- };
-
- ! #define HTNet_bytesRead(me) ((me) ? (me)->bytes_read : -1)
- ! #define HTNet_dns(me) ((me) ? (me)->dns : NULL)
- </PRE>
-
- <PRE>
- diff -c Library/Repository/Implementation/HTProt.html:2.11 Library/Repository/Implementation/HTProt.html:2.12
- *** Library/Repository/Implementation/HTProt.html:2.11 Tue Jan 23 16:31:27 1996
- --- Library/Repository/Implementation/HTProt.html Tue Jan 23 16:31:27 1996
- ***************
- *** 59,69 ****
- access acheme. For example HTTP.c is bound to http URLs. The call back
- function is the function to be called for loading. The reason why it
- is of type HTEventCallback is that it then can be used directly in the
- ! event loop when used in non-preemtive mode.
-
- <PRE>
- extern BOOL HTProtocol_add (CONST char * name,
- ! BOOL preemtive,
- HTEventCallback * client,
- HTEventCallback * server);
- </PRE>
- --- 59,69 ----
- access acheme. For example HTTP.c is bound to http URLs. The call back
- function is the function to be called for loading. The reason why it
- is of type HTEventCallback is that it then can be used directly in the
- ! event loop when used in non-preemptive mode.
-
- <PRE>
- extern BOOL HTProtocol_add (CONST char * name,
- ! BOOL preemptive,
- HTEventCallback * client,
- HTEventCallback * server);
- </PRE>
- ***************
- *** 106,118 ****
- extern HTEventCallback * HTProtocol_server (HTProtocol * protocol);
- </PRE>
-
- ! <H3>Is Access Scheme Preemtive</H3>
-
- Returns YES if the implementation of the access scheme supports
- ! preemtive access only.
-
- <PRE>
- ! extern BOOL HTProtocol_preemtive (HTProtocol * protocol);
- </PRE>
-
- <PRE>
- --- 106,118 ----
- extern HTEventCallback * HTProtocol_server (HTProtocol * protocol);
- </PRE>
-
- ! <H3>Is Access Scheme Preemptive</H3>
-
- Returns YES if the implementation of the access scheme supports
- ! preemptive access only.
-
- <PRE>
- ! extern BOOL HTProtocol_preemptive (HTProtocol * protocol);
- </PRE>
-
- <PRE>
- diff -c Library/Repository/Implementation/HTReq.html:2.17.2.1 Library/Repository/Implementation/HTReq.html:2.18
- *** Library/Repository/Implementation/HTReq.html:2.17.2.1 Tue Jan 23 16:31:28 1996
- --- Library/Repository/Implementation/HTReq.html Tue Jan 23 16:31:28 1996
- ***************
- *** 1,7 ****
- <HTML>
- <HEAD>
- <TITLE>Public Declaration of Request Manager</TITLE>
- ! <!-- Changed by: Henrik Frystyk Nielsen, 23-Jan-1996 -->
- <NEXTID N="z11">
- </HEAD>
- <BODY>
- --- 1,7 ----
- <HTML>
- <HEAD>
- <TITLE>Public Declaration of Request Manager</TITLE>
- ! <!-- Changed by: Henrik Frystyk Nielsen, 18-Dec-1995 -->
- <NEXTID N="z11">
- </HEAD>
- <BODY>
- ***************
- *** 85,102 ****
- extern HTRequest * HTRequest_dup (HTRequest * src);
- </PRE>
-
- - <H4>Create a duplicate for Internal use</H4>
- -
- - Creates a new HTRequest object as a duplicate of the src request. The
- - difference to the HTRequest_dup function is that we don't copy the
- - error_stack and other information that the application keeps in its
- - copy of the request object. Otherwise it will be freed multiple times.
- - Returns YES if OK, else NO
- -
- - <PRE>
- - extern HTRequest * HTRequest_dupInternal (HTRequest * src);
- - </PRE>
- -
- <H3>Delete Object</H3>
-
- This function deletes the object and cleans up the memory.
- --- 85,90 ----
- ***************
- *** 164,182 ****
- extern HTReload HTRequest_reloadMode (HTRequest *request);
- </PRE>
-
- - <H2>Redirections</H2>
- -
- - When a redirection response is returned to the Library, for example
- - from a remote HTTP server, this code is passed back to the
- - application. The application can then decide whether a new request
- - should be established or not. These two methods return the redirection
- - information required to issue a new request, that is the new anchor
- - and any list of keywords associated with this anchor.
- -
- - <PRE>
- - extern HTAnchor * HTRequest_redirection (HTRequest * request);
- - </PRE>
- -
- <H2>Max number of Retrys for a Down Load</H2>
-
- Automatic reload can happen in two situations:
- --- 152,157 ----
- ***************
- *** 499,507 ****
- extern void *HTRequest_context (HTRequest *request);
- </PRE>
-
- ! <H2>Preemtive or Non-preemtive Access</H2>
-
- ! A access scheme is defined with a default for using either preemtive
- (blocking I/O) or non-premitve (non-blocking I/O). This is basically a
- result of the implementation of the protocol module itself. However,
- if non-blocking I/O is the default then some times it is nice to be
- --- 474,482 ----
- extern void *HTRequest_context (HTRequest *request);
- </PRE>
-
- ! <H2>Preemptive or Non-preemptive Access</H2>
-
- ! A access scheme is defined with a default for using either preemptive
- (blocking I/O) or non-premitve (non-blocking I/O). This is basically a
- result of the implementation of the protocol module itself. However,
- if non-blocking I/O is the default then some times it is nice to be
- ***************
- *** 510,517 ****
- non-blocking.
-
- <PRE>
- ! extern void HTRequest_setPreemtive (HTRequest *request, BOOL mode);
- ! extern BOOL HTRequest_preemtive (HTRequest *request);
- </PRE>
-
- <H2>Priority Management</H2>
- --- 485,492 ----
- non-blocking.
-
- <PRE>
- ! extern void HTRequest_setPreemptive (HTRequest *request, BOOL mode);
- ! extern BOOL HTRequest_preemptive (HTRequest *request);
- </PRE>
-
- <H2>Priority Management</H2>
- ***************
- *** 586,602 ****
- char * syscall);
- </PRE>
-
- ! <H2>Bytes Read or Written in a Request</H2>
-
- This function returns the bytes read in the current request. For a
- deeper description of what the current request is, please read the
- user's guide. This function can be used in for example the <A
- HREF="HTAlert.html">HTAlert module</A> to give the number of bytes
- ! read or written in a progress message.
-
- <PRE>
- ! extern long HTRequest_bytesRead (HTRequest * request);
- ! extern long HTRequest_bytesWritten (HTRequest * request);
- </PRE>
-
- <H2>Kill a Request</H2>
- --- 561,576 ----
- char * syscall);
- </PRE>
-
- ! <H2>Bytes Read in Current Request</H2>
-
- This function returns the bytes read in the current request. For a
- deeper description of what the current request is, please read the
- user's guide. This function can be used in for example the <A
- HREF="HTAlert.html">HTAlert module</A> to give the number of bytes
- ! read in a progress message.
-
- <PRE>
- ! extern long HTRequest_bytesRead(HTRequest * request);
- </PRE>
-
- <H2>Kill a Request</H2>
- diff -c Library/Repository/Implementation/HTReqMan.c:2.22.2.1 Library/Repository/Implementation/HTReqMan.c:2.22
- *** Library/Repository/Implementation/HTReqMan.c:2.22.2.1 Tue Jan 23 16:31:29 1996
- --- Library/Repository/Implementation/HTReqMan.c Tue Jan 23 16:31:29 1996
- ***************
- *** 108,149 ****
- return me;
- }
-
- - /* HTRequest_dupInternal
- - ** ---------------------
- - ** Creates a new HTRequest object as a duplicate of the src request.
- - ** The difference to the HTRequest_dup function is that we don't copy the
- - ** error_stack and other information that the application keeps in its
- - ** copy of the request object. Otherwise it will be freed multiple times
- - ** Returns YES if OK, else NO
- - */
- - PUBLIC HTRequest * HTRequest_dupInternal (HTRequest * src)
- - {
- - HTRequest * me;
- - if (!src) return NO;
- - if ((me = (HTRequest *) malloc(sizeof(HTRequest))) == NULL)
- - outofmem(__FILE__, "HTRequest_dup");
- - memcpy(me, src, sizeof(HTRequest));
- - me->internal = YES;
- - me->boundary = NULL;
- - me->authenticate = NULL;
- - me->error_stack = NULL;
- - me->access = NULL;
- - me->authorization = NULL;
- - me->prot_template = NULL;
- - me->dialog_msg = NULL;
- - me->net = NULL;
- - me->WWWAAScheme = NULL;
- - me->WWWAARealm = NULL;
- - me->WWWprotection = NULL;
- - return me;
- - }
- -
- /* Delete a request structure
- ** --------------------------
- */
- PUBLIC void HTRequest_delete (HTRequest * request)
- {
- if (request) {
- FREE(request->boundary);
- FREE(request->authenticate);
- if (request->error_stack) HTError_deleteAll(request->error_stack);
- --- 108,120 ----
- return me;
- }
-
- /* Delete a request structure
- ** --------------------------
- */
- PUBLIC void HTRequest_delete (HTRequest * request)
- {
- if (request) {
- + FREE(request->redirect);
- FREE(request->boundary);
- FREE(request->authenticate);
- if (request->error_stack) HTError_deleteAll(request->error_stack);
- ***************
- *** 158,163 ****
- --- 129,135 ----
- request->net->request = NULL;
-
- /* These are temporary until we get a MIME thingy */
- + FREE(request->redirect);
- FREE(request->WWWAAScheme);
- FREE(request->WWWAARealm);
- FREE(request->WWWprotection);
- ***************
- *** 534,547 ****
- }
-
- /*
- - ** Bytes written in this request
- - */
- - PUBLIC long HTRequest_bytesWritten (HTRequest * request)
- - {
- - return request ? HTNet_bytesWritten(request->net) : -1;
- - }
- -
- - /*
- ** Kill this request
- */
- PUBLIC BOOL HTRequest_kill(HTRequest * request)
- --- 506,511 ----
- ***************
- *** 603,616 ****
- }
-
- /*
- - ** Redirection informantion
- - */
- - PUBLIC HTAnchor * HTRequest_redirection (HTRequest * request)
- - {
- - return (request ? request->redirectionAnchor : NULL);
- - }
- -
- - /*
- ** Set max number of automatic reload. Default is HT_MAX_RELOADS
- */
- PUBLIC BOOL HTRequest_setMaxRetry (int newmax)
- --- 567,572 ----
- ***************
- *** 682,705 ****
- ** build the internal request representation of the POST web
- ** Returns YES if OK, else NO
- */
- ! PUBLIC BOOL HTRequest_addDestination (HTRequest * src, HTRequest * dest)
- {
- if (src && dest) {
- - dest->source = src->source = src;
- if (!src->mainDestination) {
- src->mainDestination = dest;
- src->destRequests = 1;
- - if (WWWTRACE)
- - TTYPrint(TDEST,"POSTWeb..... Adding dest %p to src %pn",
- - dest, src);
- return YES;
- } else {
- ! if (!src->destinations) src->destinations = HTList_new();
- if (HTList_addObject(src->destinations, (void *) dest)==YES) {
- src->destRequests++;
- - if (WWWTRACE)
- - TTYPrint(TDEST,"POSTWeb..... Adding dest %p to src %pn",
- - dest, src);
- return YES;
- }
- }
- --- 638,655 ----
- ** build the internal request representation of the POST web
- ** Returns YES if OK, else NO
- */
- ! PUBLIC BOOL HTRequest_addDestination (HTRequest *src, HTRequest *dest)
- {
- if (src && dest) {
- if (!src->mainDestination) {
- src->mainDestination = dest;
- src->destRequests = 1;
- return YES;
- } else {
- ! if (!src->destinations)
- ! src->destinations = HTList_new();
- if (HTList_addObject(src->destinations, (void *) dest)==YES) {
- src->destRequests++;
- return YES;
- }
- }
- ***************
- *** 709,719 ****
-
- /*
- ** Remove a destination request from this source request structure
- ! ** Remember only to delete the internal request objects as the other
- ! ** comes from the application!
- ** Returns YES if OK, else NO
- */
- ! PUBLIC BOOL HTRequest_removeDestination (HTRequest * dest)
- {
- BOOL found=NO;
- if (dest && dest->source) {
- --- 659,669 ----
-
- /*
- ** Remove a destination request from this source request structure
- ! ** Remember not to delete the main destination as it comes from the
- ! ** application!
- ** Returns YES if OK, else NO
- */
- ! PUBLIC BOOL HTRequest_removeDestination (HTRequest *dest)
- {
- BOOL found=NO;
- if (dest && dest->source) {
- ***************
- *** 723,773 ****
- src->mainDestination = NULL;
- src->destRequests--;
- found = YES;
- ! } else if (src->destinations) {
- if (HTList_removeObject(src->destinations, (void *) dest)) {
- src->destRequests--;
- found = YES;
- }
- }
- if (found) {
- - if (dest->internal) HTRequest_delete(dest);
- if (WWWTRACE)
- ! TTYPrint(TDEST, "POSTWeb..... Deleting dest %p from src %pn",
- ! dest, src);
- }
- ! if (src->destRequests <= 0) {
- if (WWWTRACE)
- ! TTYPrint(TDEST, "POSTWeb..... terminatedn");
- ! if (src->internal) HTRequest_delete(src);
- }
- }
- return found;
- }
-
- /*
- ! ** Check to see whether all destinations are ready. If so then enable the
- ! ** source as ready for reading.
- ! ** Returns YES if all dests are ready, NO otherwise
- ! */
- ! PUBLIC BOOL HTRequest_destinationsReady (HTRequest * me)
- ! {
- ! HTRequest * source = me ? me->source : NULL;
- ! if (source) {
- ! if (source->destStreams == source->destRequests) {
- ! HTNet * net = source->net;
- ! if (WWWTRACE)
- ! TTYPrint(TDEST, "POSTWeb..... All destinations are ready!n");
- ! if (net) /* Might already have finished */
- ! HTEvent_Register(net->sockfd, source, (SockOps) FD_READ,
- ! net->cbf, net->priority);
- ! return YES;
- ! }
- ! }
- ! return NO;
- ! }
- !
- ! /*
- ! ** Find the source request object and make the link between the
- ** source output stream and the destination input stream. There can be
- ** a conversion between the two streams!
- ** Returns YES if link is made, NO otherwise
- --- 673,701 ----
- src->mainDestination = NULL;
- src->destRequests--;
- found = YES;
- ! } if (src->destinations) {
- if (HTList_removeObject(src->destinations, (void *) dest)) {
- + HTRequest_delete(dest);
- src->destRequests--;
- found = YES;
- }
- }
- if (found) {
- if (WWWTRACE)
- ! TTYPrint(TDEST, "Destination. %p removed from %pn",
- ! dest, src);
- }
- ! if (!src->destRequests) {
- if (WWWTRACE)
- ! TTYPrint(TDEST, "Destination. PostWeb terminatedn");
- ! HTRequest_delete(src);
- }
- }
- return found;
- }
-
- /*
- ! ** Find the source request structure and make the link between the
- ** source output stream and the destination input stream. There can be
- ** a conversion between the two streams!
- ** Returns YES if link is made, NO otherwise
- ***************
- *** 782,801 ****
- dest, YES);
-
- /* Check if we are the only one - else spawn off T streams */
- /* @@@ We don't do this yet @@@ */
-
- - /* Now set up output stream of the source */
- - if (source->output_stream)
- - (*source->output_stream->isa->_free)(source->output_stream);
- source->output_stream = pipe ? pipe : dest->input_stream;
-
- ! if (WWWTRACE)
- ! TTYPrint(TDEST,"POSTWeb..... Linking dest %p to src %pn",
- ! dest, source);
- if (++source->destStreams == source->destRequests) {
- HTNet *net = source->net;
- ! if (WWWTRACE)
- ! TTYPrint(TDEST, "POSTWeb..... All destinations ready!n");
- if (net) /* Might already have finished */
- HTEvent_Register(net->sockfd, source, (SockOps) FD_READ,
- net->cbf, net->priority);
- --- 710,726 ----
- dest, YES);
-
- /* Check if we are the only one - else spawn off T streams */
- +
- /* @@@ We don't do this yet @@@ */
-
- source->output_stream = pipe ? pipe : dest->input_stream;
-
- ! if (STREAM_TRACE)
- ! TTYPrint(TDEST,"Destination. Linked %p to source %pn",dest,source);
- if (++source->destStreams == source->destRequests) {
- HTNet *net = source->net;
- ! if (STREAM_TRACE)
- ! TTYPrint(TDEST, "Destination. All destinations ready!n");
- if (net) /* Might already have finished */
- HTEvent_Register(net->sockfd, source, (SockOps) FD_READ,
- net->cbf, net->priority);
- ***************
- *** 828,836 ****
- }
- if (found) {
- src->destStreams--;
- ! if (WWWTRACE)
- ! TTYPrint(TDEST, "POSTWeb..... Unlinking dest %p from src %pn",
- ! dest, src);
- return YES;
- }
- }
- --- 753,761 ----
- }
- if (found) {
- src->destStreams--;
- ! if (STREAM_TRACE)
- ! TTYPrint(TDEST, "Destination. Unlinked %p from source %pn",
- ! dest, src);
- return YES;
- }
- }
- ***************
- *** 866,872 ****
-
- /*
- ** Kills all threads in a POST WEB connected to this request but
- ! ** NOT this request itself. We also keep the request structures.
- ** Some requests might be preemtive, for example a SMTP request (when
- ** that has been implemented). However, this will be handled internally
- ** in the load function.
- --- 791,797 ----
-
- /*
- ** Kills all threads in a POST WEB connected to this request but
- ! ** keep the request structures.
- ** Some requests might be preemtive, for example a SMTP request (when
- ** that has been implemented). However, this will be handled internally
- ** in the load function.
- ***************
- *** 875,902 ****
- {
- if (me && me->source) {
- HTRequest *source = me->source;
- - if (WWWTRACE) TTYPrint(TDEST, "POSTWeb..... Killingn");
-
- ! /*
- ! ** Kill source. The stream tree is now freed so we have to build
- ! ** that again. This is done in HTRequest_linkDestination()
- ! */
- ! if (me != source) {
- ! HTNet_kill(source->net);
- ! source->output_stream = NULL;
- ! }
-
- /* Kill all other destinations */
- if (source->destinations) {
- HTList *cur = source->destinations;
- HTRequest *pres;
- while ((pres = (HTRequest *) HTList_nextObject(cur)) != NULL)
- ! if (me != pres) HTNet_kill(pres->net);
- }
- !
- ! /* Kill main destination */
- ! if (source->mainDestination && me != source->mainDestination)
- ! HTNet_kill(source->mainDestination->net);
- return YES;
- }
- return NO;
- --- 800,823 ----
- {
- if (me && me->source) {
- HTRequest *source = me->source;
-
- ! /* Kill main destination */
- ! if (source->mainDestination)
- ! HTNet_kill(source->mainDestination->net);
-
- /* Kill all other destinations */
- if (source->destinations) {
- HTList *cur = source->destinations;
- HTRequest *pres;
- while ((pres = (HTRequest *) HTList_nextObject(cur)) != NULL)
- ! HTNet_kill(pres->net);
- }
- ! /*
- ! ** Kill source. The stream tree is now freed so we have to build
- ! ** that again. This is done in HTRequest_linkDestination()
- ! */
- ! HTNet_kill(source->net);
- ! source->output_stream = NULL;
- return YES;
- }
- return NO;
- diff -c Library/Repository/Implementation/HTReqMan.html:2.12.2.1 Library/Repository/Implementation/HTReqMan.html:2.13
- *** Library/Repository/Implementation/HTReqMan.html:2.12.2.1 Tue Jan 23 16:31:31 1996
- --- Library/Repository/Implementation/HTReqMan.html Tue Jan 23 16:31:31 1996
- ***************
- *** 1,7 ****
- <HTML>
- <HEAD>
- <TITLE>Request Object</TITLE>
- ! <!-- Changed by: Henrik Frystyk Nielsen, 23-Jan-1996 -->
- </HEAD>
- <BODY>
-
- --- 1,7 ----
- <HTML>
- <HEAD>
- <TITLE>Request Object</TITLE>
- ! <!-- Changed by: Henrik Frystyk Nielsen, 8-Dec-1995 -->
- </HEAD>
- <BODY>
-
- ***************
- *** 49,60 ****
-
- <PRE>
- struct _HTRequest {
- -
- - BOOL internal; /* Does the app knows about this one? */
- -
- HTMethod method;
- HTReload reload;
-
- char * boundary; /* MIME multipart boundary */
- int retrys; /* Number of automatic reloads */
- time_t retry_after; /* Absolut time for a retry */
- --- 49,58 ----
-
- <PRE>
- struct _HTRequest {
- HTMethod method;
- HTReload reload;
-
- + char * redirect; /* Location or URI */
- char * boundary; /* MIME multipart boundary */
- int retrys; /* Number of automatic reloads */
- time_t retry_after; /* Absolut time for a retry */
- ***************
- *** 103,117 ****
- HTParentAnchor * parentAnchor; /* For referer field */
- </PRE>
-
- - <H4>Redirection</H4>
- -
- - If we get a redirection back then we return the new destination for
- - this request to the application using this anchor.
- -
- - <PRE>
- - HTAnchor * redirectionAnchor; /* Redirection URL */
- - </PRE>
- -
- <H3>Streams From Network to Application</H3>
-
- <PRE>
- --- 101,106 ----
- ***************
- *** 145,151 ****
- <H3>Other Flags</H3>
-
- <PRE>
- ! BOOL preemtive;
- BOOL ContentNegotiation;
- BOOL using_proxy;
- </PRE>
- --- 134,140 ----
- <H3>Other Flags</H3>
-
- <PRE>
- ! BOOL preemptive;
- BOOL ContentNegotiation;
- BOOL using_proxy;
- </PRE>
- ***************
- *** 210,216 ****
- <PRE>
- extern BOOL HTRequest_addDestination (HTRequest * src, HTRequest * dest);
- extern BOOL HTRequest_removeDestination (HTRequest * dest);
- - extern BOOL HTRequest_destinationsReady (HTRequest * me);
-
- extern BOOL HTRequest_linkDestination (HTRequest * dest);
- extern BOOL HTRequest_unlinkDestination (HTRequest * dest);
- --- 199,204 ----
- diff -c Library/Repository/Implementation/HTSocket.c:2.19.2.1 Library/Repository/Implementation/HTSocket.c:2.19
- *** Library/Repository/Implementation/HTSocket.c:2.19.2.1 Tue Jan 23 16:31:32 1996
- --- Library/Repository/Implementation/HTSocket.c Tue Jan 23 16:31:33 1996
- ***************
- *** 114,121 ****
- net->cbf, net->priority);
- return HT_WOULD_BLOCK;
- } else { /* We have a real error */
- ! HTRequest_addSystemError(request, ERR_FATAL, socerrno, NO,
- ! "NETREAD");
- return HT_ERROR;
- }
- } else if (!b_read) {
- --- 114,122 ----
- net->cbf, net->priority);
- return HT_WOULD_BLOCK;
- } else { /* We have a real error */
- ! if (PROT_TRACE)
- ! TTYPrint(TDEST, "Read Socket. READ ERROR %dn",
- ! socerrno);
- return HT_ERROR;
- }
- } else if (!b_read) {
- diff -c Library/Repository/Implementation/HTTP.c:1.111.2.1 Library/Repository/Implementation/HTTP.c:1.111
- *** Library/Repository/Implementation/HTTP.c:1.111.2.1 Tue Jan 23 16:31:34 1996
- --- Library/Repository/Implementation/HTTP.c Tue Jan 23 16:31:34 1996
- ***************
- *** 61,69 ****
- HTTP_BEGIN = 0,
- HTTP_NEED_CONNECTION,
- HTTP_NEED_REQUEST,
- ! HTTP_PERM_REDIRECT,
- ! HTTP_TEMP_REDIRECT,
- HTTP_NOT_MODIFIED,
- HTTP_AA
- } HTTPState;
-
- --- 61,69 ----
- HTTP_BEGIN = 0,
- HTTP_NEED_CONNECTION,
- HTTP_NEED_REQUEST,
- ! HTTP_REDIRECTION,
- HTTP_NOT_MODIFIED,
- + HTTP_EXPIRED,
- HTTP_AA
- } HTTPState;
-
- ***************
- *** 104,112 ****
- http_info *http = (http_info *) net->context;
-
- /* Free stream with data TO network */
- ! if (HTRequest_isDestination(req))
- ! HTRequest_removeDestination(req);
- ! else if (req->input_stream) {
- if (status == HT_INTERRUPTED)
- (*req->input_stream->isa->abort)(req->input_stream, NULL);
- else
- --- 104,110 ----
- http_info *http = (http_info *) net->context;
-
- /* Free stream with data TO network */
- ! if (!HTRequest_isDestination(req) && req->input_stream) {
- if (status == HT_INTERRUPTED)
- (*req->input_stream->isa->abort)(req->input_stream, NULL);
- else
- ***************
- *** 114,129 ****
- req->input_stream = NULL;
- }
-
- - /* Free user part of stream pipe if error */
- - if (!net->target && req->output_stream)
- - (*req->output_stream->isa->abort)(req->output_stream, NULL);
- -
- /* Remove the request object and our own context structure for http */
- ! HTNet_delete(net, req->internal ? HT_IGNORE : status);
- FREE(http);
- return YES;
- }
-
- /*
- ** This is a big switch handling all HTTP return codes. It puts in any
- ** appropiate error message and decides whether we should expect data
- --- 112,163 ----
- req->input_stream = NULL;
- }
-
- /* Remove the request object and our own context structure for http */
- ! HTNet_delete(net, status);
- FREE(http);
- return YES;
- }
-
- +
- + PRIVATE BOOL HTTPAuthentication (HTRequest * request)
- + {
- + HTAAScheme scheme;
- + HTList *valid_schemes = HTList_new();
- + HTAssocList **scheme_specifics = NULL;
- + char *tmplate = NULL;
- +
- + if (request->WWWAAScheme) {
- + if ((scheme = HTAAScheme_enum(request->WWWAAScheme)) != HTAA_UNKNOWN) {
- + HTList_addObject(valid_schemes, (void *) scheme);
- + if (!scheme_specifics) {
- + int i;
- + scheme_specifics = (HTAssocList**)
- + malloc(HTAA_MAX_SCHEMES * sizeof(HTAssocList*));
- + if (!scheme_specifics)
- + outofmem(__FILE__, "HTTPAuthentication");
- + for (i=0; i < HTAA_MAX_SCHEMES; i++)
- + scheme_specifics[i] = NULL;
- + }
- + scheme_specifics[scheme] = HTAA_parseArgList(request->WWWAARealm);
- + } else if (PROT_TRACE) {
- + HTRequest_addError(request, ERR_INFO, NO, HTERR_UNKNOWN_AA,
- + (void *) request->WWWAAScheme, 0, "HTTPAuthentication");
- + return NO;
- + }
- + }
- + if (request->WWWprotection) {
- + if (PROT_TRACE)
- + TTYPrint(TDEST, "Protection template set to `%s'n",
- + request->WWWprotection);
- + StrAllocCopy(tmplate, request->WWWprotection);
- + }
- + request->valid_schemes = valid_schemes;
- + request->scheme_specifics = scheme_specifics;
- + request->prot_template = tmplate;
- + return YES;
- + }
- +
- +
- /*
- ** This is a big switch handling all HTTP return codes. It puts in any
- ** appropiate error message and decides whether we should expect data
- ***************
- *** 135,183 ****
-
- case 0: /* 0.9 response */
- case 200:
- - me->http->next = HTTP_GOT_DATA;
- - break;
- -
- case 201:
- - HTRequest_addError(me->request, ERR_INFO, NO, HTERR_CREATED,
- - me->reason, (int) strlen(me->reason),
- - "HTTPNextState");
- - me->http->next = HTTP_GOT_DATA;
- - break;
- -
- case 202:
- - HTRequest_addError(me->request, ERR_INFO, NO, HTERR_ACCEPTED,
- - me->reason, (int) strlen(me->reason),
- - "HTTPNextState");
- - me->http->next = HTTP_GOT_DATA;
- - break;
- -
- case 203:
- - HTRequest_addError(me->request, ERR_INFO, NO, HTERR_PARTIAL,
- - me->reason, (int) strlen(me->reason),
- - "HTTPNextState");
- me->http->next = HTTP_GOT_DATA;
- break;
-
- case 204: /* No Response */
- - HTRequest_addError(me->request, ERR_INFO, NO, HTERR_NO_CONTENT,
- - me->reason, (int) strlen(me->reason),
- - "HTTPNextState");
- me->http->next = HTTP_NO_DATA;
- break;
-
- case 301: /* Moved */
- - HTRequest_addError(me->request, ERR_INFO, NO, HTERR_MOVED,
- - me->reason, (int) strlen(me->reason),
- - "HTTPNextState");
- - me->http->next = HTTP_PERM_REDIRECT;
- - break;
- -
- case 302: /* Found */
- ! HTRequest_addError(me->request, ERR_INFO, NO, HTERR_FOUND,
- ! me->reason, (int) strlen(me->reason),
- ! "HTTPNextState");
- ! me->http->next = HTTP_TEMP_REDIRECT;
- break;
-
- case 303: /* Method */
- --- 169,187 ----
-
- case 0: /* 0.9 response */
- case 200:
- case 201:
- case 202:
- case 203:
- me->http->next = HTTP_GOT_DATA;
- break;
-
- case 204: /* No Response */
- me->http->next = HTTP_NO_DATA;
- break;
-
- case 301: /* Moved */
- case 302: /* Found */
- ! me->http->next = HTTP_REDIRECTION;
- break;
-
- case 303: /* Method */
- ***************
- *** 188,196 ****
- break;
-
- case 304: /* Not Modified */
- - HTRequest_addError(me->request, ERR_FATAL, NO, HTERR_NOT_MODIFIED,
- - me->reason, (int) strlen(me->reason),
- - "HTTPNextState");
- me->http->next = HTTP_NOT_MODIFIED;
- break;
-
- --- 192,197 ----
- ***************
- *** 350,356 ****
- *ptr = '';
-
- /* Set up the streams */
- ! if (me->status==200) {
- HTStream *s;
- me->target = HTStreamStack(WWW_MIME, req->output_format,
- req->output_stream, req, NO);
- --- 351,357 ----
- *ptr = '';
-
- /* Set up the streams */
- ! if (me->status==200 && req->method==METHOD_GET) {
- HTStream *s;
- me->target = HTStreamStack(WWW_MIME, req->output_format,
- req->output_stream, req, NO);
- ***************
- *** 492,499 ****
- int status = HT_ERROR;
- HTNet *net = request->net; /* Generic protocol information */
- http_info *http; /* Specific protocol information */
- ! HTParentAnchor *anchor = HTRequest_anchor(request);
- !
- /*
- ** Initiate a new http structure and bind to request structure
- ** This is actually state HTTP_BEGIN, but it can't be in the state
- --- 493,499 ----
- int status = HT_ERROR;
- HTNet *net = request->net; /* Generic protocol information */
- http_info *http; /* Specific protocol information */
- !
- /*
- ** Initiate a new http structure and bind to request structure
- ** This is actually state HTTP_BEGIN, but it can't be in the state
- ***************
- *** 501,516 ****
- */
- if (ops == FD_NONE) {
- if (PROT_TRACE) TTYPrint(TDEST, "HTTP........ Looking for `%s'n",
- ! HTAnchor_physical(anchor));
- if ((http = (http_info *) calloc(1, sizeof(http_info))) == NULL)
- outofmem(__FILE__, "HTLoadHTTP");
- http->state = HTTP_BEGIN;
- http->next = HTTP_ERROR;
- net->context = http;
- } else if (ops == FD_CLOSE) { /* Interrupted */
- ! HTRequest_addError(request, ERR_FATAL, NO, HTERR_INTERRUPTED,
- ! NULL, 0, "HTLoadHTTP");
- ! HTTPCleanup(request, HT_INTERRUPTED);
- return HT_OK;
- } else
- http = (http_info *) net->context; /* Get existing copy */
- --- 501,521 ----
- */
- if (ops == FD_NONE) {
- if (PROT_TRACE) TTYPrint(TDEST, "HTTP........ Looking for `%s'n",
- ! HTAnchor_physical(request->anchor));
- if ((http = (http_info *) calloc(1, sizeof(http_info))) == NULL)
- outofmem(__FILE__, "HTLoadHTTP");
- http->state = HTTP_BEGIN;
- http->next = HTTP_ERROR;
- net->context = http;
- } else if (ops == FD_CLOSE) { /* Interrupted */
- ! #if 1
- ! if (HTRequest_isPostWeb(request))
- ! #else
- ! if(HTRequest_isPostWeb(request)&&!HTRequest_isMainDestination(request))
- ! #endif
- ! HTTPCleanup(request, HT_IGNORE);
- ! else
- ! HTTPCleanup(request, HT_INTERRUPTED);
- return HT_OK;
- } else
- http = (http_info *) net->context; /* Get existing copy */
- ***************
- *** 538,544 ****
- break;
-
- case HTTP_NEED_CONNECTION: /* Now let's set up a connection */
- ! status = HTDoConnect(net, HTAnchor_physical(anchor),
- HTTP_PORT);
- if (status == HT_OK) {
-
- --- 543,549 ----
- break;
-
- case HTTP_NEED_CONNECTION: /* Now let's set up a connection */
- ! status = HTDoConnect(net, HTAnchor_physical(request->anchor),
- HTTP_PORT);
- if (status == HT_OK) {
-
- ***************
- *** 566,572 ****
- ** before all destinations are ready. If destination then
- ** register the input stream and get ready for read
- */
- ! if (HTRequest_isDestination(request)) {
- HTEvent_Register(net->sockfd, request, (SockOps) FD_READ,
- HTLoadHTTP, net->priority);
- HTRequest_linkDestination(request);
- --- 571,577 ----
- ** before all destinations are ready. If destination then
- ** register the input stream and get ready for read
- */
- ! if (HTRequest_isPostWeb(request)) {
- HTEvent_Register(net->sockfd, request, (SockOps) FD_READ,
- HTLoadHTTP, net->priority);
- HTRequest_linkDestination(request);
- ***************
- *** 574,581 ****
-
- /* Set up stream FROM network and corresponding read buffer */
- net->isoc = HTInputSocket_new(net->sockfd);
- - net->target = HTTPStatus_new(request, http);
-
- http->state = HTTP_NEED_REQUEST;
- } else if (status == HT_WOULD_BLOCK || status == HT_PERSISTENT)
- return HT_OK;
- --- 579,587 ----
-
- /* Set up stream FROM network and corresponding read buffer */
- net->isoc = HTInputSocket_new(net->sockfd);
-
- + /* @@@ USE STREAM STACK @@@ */
- + net->target = HTTPStatus_new(request, http);
- http->state = HTTP_NEED_REQUEST;
- } else if (status == HT_WOULD_BLOCK || status == HT_PERSISTENT)
- return HT_OK;
- ***************
- *** 588,599 ****
- if (ops == FD_WRITE || ops == FD_NONE) {
- if (HTRequest_isDestination(request)) {