📄 lib_4.0c_1.fix
字号:
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 %d\n", net->sockfd); } else { if (WWWTRACE) TTYPrint(TDEST, "HTNet_delete keeping %d\n", 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 %d\n", net->sockfd);+ HTEvent_UnRegister(net->sockfd, (SockOps) FD_ALL); } else { if (WWWTRACE) TTYPrint(TDEST, "HTNet_delete keeping %d\n", 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) {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -