📄 lib_4.0c_1.fix
字号:
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 %p\n",- 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 %p\n",- 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 %p\n",! dest, src); }! if (src->destRequests <= 0) { if (WWWTRACE)! TTYPrint(TDEST, "POSTWeb..... terminated\n");! 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 %p\n",! dest, src); }! if (!src->destRequests) { if (WWWTRACE)! TTYPrint(TDEST, "Destination. PostWeb terminated\n");! 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 %p\n",! 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 %p\n",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 %p\n",! dest, src); return YES; } }--- 753,761 ---- } if (found) { src->destStreams--;! if (STREAM_TRACE)! TTYPrint(TDEST, "Destination. Unlinked %p from source %p\n",! 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..... Killing\n"); ! /*! ** 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);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -