📄 lib_5.0_1.fix
字号:
} else {--- 209,215 ---- if (me->transparent) { if (me->put_fix) { HTNet * net = HTRequest_net(me->request);! HTEvent_unregister(net->sockfd, FD_READ | FD_WRITE); me->put_fix = NO; } } else {Index: Library/Repository/src/HTMethod.htmldiff -c Library/Repository/src/HTMethod.html:2.13 Library/Repository/src/HTMethod.html:2.14*** Library/Repository/src/HTMethod.html:2.13 Tue Jul 2 18:54:52 1996--- Library/Repository/src/HTMethod.html Thu Sep 12 22:05:27 1996****************** 1,7 **** <HTML> <HEAD> <TITLE>W3C Reference Library libwww Request Access Methods</TITLE>- <!-- Changed by: Henrik Frystyk Nielsen, 1-Jul-1996 --> </HEAD> <BODY> <H1>--- 1,7 ---- <HTML> <HEAD>+ <!-- Changed by: Henrik Frystyk Nielsen, 1-Jul-1996 --> <TITLE>W3C Reference Library libwww Request Access Methods</TITLE> </HEAD> <BODY> <H1>****************** 65,75 **** Is Method "Safe"? </H3> <P>! If a method a safe, it doesn't produce any side effects on the server <PRE> #define HTMethod_isSafe(me) ((me) & (METHOD_GET|METHOD_HEAD)) </PRE> <H3> Does a Method include Entity? </H3> <P>--- 65,85 ---- Is Method "Safe"? </H3> <P>! If a method is safe, it doesn't produce any side effects on the server <PRE> #define HTMethod_isSafe(me) ((me) & (METHOD_GET|METHOD_HEAD)) </PRE> <H3>+ Does the Method Replace or Add to Metainformation+ </H3>+ <P>+ Most methods override the current set of metainformation stored in an+ <A HREF="HTAnchor.html">anchor</A>. However, a few methods actually only+ add to the anchor metainformation. We have a small macro to make the distinction.+ <PRE>+ #define HTMethod_addMeta(me) ((me) & (METHOD_TRACE | METHOD_OPTIONS))+ </PRE>+ <H3> Does a Method include Entity? </H3> <P>****************** 83,88 **** <P> <HR> <ADDRESS>! @(#) $Id: lib_5.0_1.fix,v 1.1 1996/10/06 15:19:42 frystyk Exp $ </ADDRESS> </BODY></HTML>--- 93,98 ---- <P> <HR> <ADDRESS>! @(#) $Id: lib_5.0_1.fix,v 1.1 1996/10/06 15:19:42 frystyk Exp $ </ADDRESS> </BODY></HTML>Index: Library/Repository/src/HTReqMan.cdiff -c Library/Repository/src/HTReqMan.c:2.57 Library/Repository/src/HTReqMan.c:2.58*** Library/Repository/src/HTReqMan.c:2.57 Sun Sep 8 18:08:42 1996--- Library/Repository/src/HTReqMan.c Thu Sep 12 22:05:29 1996****************** 3,9 **** ** ** (c) COPYRIGHT MIT 1995. ** Please first read the full copyright statement in the file COPYRIGH.! ** @(#) $Id: lib_5.0_1.fix,v 1.1 1996/10/06 15:19:42 frystyk Exp $ ** ** Authors ** TBL Tim Berners-Lee timbl@w3.org--- 3,9 ---- ** ** (c) COPYRIGHT MIT 1995. ** Please first read the full copyright statement in the file COPYRIGH.! ** @(#) $Id: lib_5.0_1.fix,v 1.1 1996/10/06 15:19:42 frystyk Exp $ ** ** Authors ** TBL Tim Berners-Lee timbl@w3.org****************** 1187,1193 **** { if (request) { if (!request->cache_control) request->cache_control=HTAssocList_new();! return HTAssocList_addObject(request->cache_control, token, value); } return NO; }--- 1187,1193 ---- { if (request) { if (!request->cache_control) request->cache_control=HTAssocList_new();! return HTAssocList_replaceObject(request->cache_control, token, value); } return NO; }****************** 1247,1253 **** if (request) { if (!request->client_connection) request->client_connection=HTAssocList_new();! return HTAssocList_addObject(request->client_connection, token, value); } return NO; }--- 1247,1254 ---- if (request) { if (!request->client_connection) request->client_connection=HTAssocList_new();! return HTAssocList_replaceObject(request->client_connection,! token, value); } return NO; }****************** 1273,1279 **** if (request) { if (!request->server_connection) request->server_connection=HTAssocList_new();! return HTAssocList_addObject(request->server_connection, token, value); } return NO; }--- 1274,1281 ---- if (request) { if (!request->server_connection) request->server_connection=HTAssocList_new();! return HTAssocList_replaceObject(request->server_connection,! token, value); } return NO; }Index: Library/Repository/src/HTTP.cdiff -c Library/Repository/src/HTTP.c:1.138 Library/Repository/src/HTTP.c:1.139*** Library/Repository/src/HTTP.c:1.138 Mon Sep 9 20:22:02 1996--- Library/Repository/src/HTTP.c Thu Sep 12 22:05:32 1996****************** 3,9 **** ** ** (c) COPYRIGHT MIT 1995. ** Please first read the full copyright statement in the file COPYRIGH.! ** @(#) $Id: lib_5.0_1.fix,v 1.1 1996/10/06 15:19:42 frystyk Exp $ ** ** This module implments the HTTP protocol as a state machine **--- 3,9 ---- ** ** (c) COPYRIGHT MIT 1995. ** Please first read the full copyright statement in the file COPYRIGH.! ** @(#) $Id: lib_5.0_1.fix,v 1.1 1996/10/06 15:19:42 frystyk Exp $ ** ** This module implments the HTTP protocol as a state machine ******************** 40,45 ****--- 40,47 ---- #define FREE_TARGET (*me->target->isa->_free)(me->target) #define ABORT_TARGET (*me->target->isa->abort)(me->target, e) + #define HTTP_OUTPUT "w3chttp.out"+ /* Type definitions and global variables etc. local to this module */ /* Final states have negative value */****************** 56,61 ****--- 58,64 ---- HTTPState state; /* Current State of the connection */ HTTPState next; /* Next state */ int result; /* Result to report to the after filter */+ BOOL lock; /* Block for writing */ } http_info; #define MAX_STATUS_LEN 100 /* Max nb of chars to check StatusLine */****************** 531,546 **** ** As we are getting fresh metainformation in the HTTP response, ** we clear the old metainfomation in order not to mix it with the new ** one. This is particularly important for the content-length and the! ** like. */ if (me->status==200 || me->status==203 || me->status==300) {! HTAnchor_clearHeader(anchor); HTAnchor_setCachable(anchor, YES); me->target = HTStreamStack(WWW_MIME, HTRequest_outputFormat(request), HTRequest_outputStream(request), request, NO);! } else if (me->status==304) { HTAnchor_setCachable(anchor, YES); me->target = HTStreamStack(WWW_MIME_HEAD, HTRequest_debugFormat(request),--- 534,551 ---- ** As we are getting fresh metainformation in the HTTP response, ** we clear the old metainfomation in order not to mix it with the new ** one. This is particularly important for the content-length and the! ** like. The TRACE and OPTIONS method just adds to the current ! ** metainformation so in that case we don't clear the anchor. */ if (me->status==200 || me->status==203 || me->status==300) {! HTMethod method = HTRequest_method(request);! if (!HTMethod_addMeta(method)) HTAnchor_clearHeader(anchor); HTAnchor_setCachable(anchor, YES); me->target = HTStreamStack(WWW_MIME, HTRequest_outputFormat(request), HTRequest_outputStream(request), request, NO);! } else if (me->status==204 || me->status==304) { HTAnchor_setCachable(anchor, YES); me->target = HTStreamStack(WWW_MIME_HEAD, HTRequest_debugFormat(request),****************** 553,559 **** HTRequest_debugStream(request), request, NO); } else {! /* We still need to parser the MIME part */ HTAnchor_clearHeader(anchor); me->target = HTStreamStack(WWW_MIME, HTRequest_debugFormat(request),--- 558,564 ---- HTRequest_debugStream(request), request, NO); } else {! /* We still need to parse the MIME part */ HTAnchor_clearHeader(anchor); me->target = HTStreamStack(WWW_MIME, HTRequest_debugFormat(request),****************** 775,785 **** */ { HTOutputStream * output = HTNet_getOutput(net, NULL, 0);! HTStream * app =! HTMethod_hasEntity(HTRequest_method(request)) ?! HTMIMERequest_new(request,! HTTPRequest_new(request,(HTStream*) output,NO),YES) :! HTTPRequest_new(request, (HTStream*) output, YES); HTRequest_setInputStream(request, app); } --- 780,802 ---- */ { HTOutputStream * output = HTNet_getOutput(net, NULL, 0);! HTStream * app = NULL;! #ifdef HTTP_DUMP! if (PROT_TRACE) {! FILE * fp = NULL;! if ((fp = fopen(HTTP_OUTPUT, "wb"))) {! output = HTTee(output,! HTFWriter_new(request,fp,YES),NULL);! HTTrace("HTTP........ Dumping request to `%s\'\n",! HTTP_OUTPUT);! }! } ! #endif /* HTTP_DUMP */! app = HTMethod_hasEntity(HTRequest_method(request)) ?! HTMIMERequest_new(request,! HTTPRequest_new(request,(HTStream *)! output,NO),YES) :! HTTPRequest_new(request, (HTStream*) output, YES); HTRequest_setInputStream(request, app); } ****************** 825,833 **** HTStream * input = HTRequest_inputStream(request); HTPostCallback * pcbf = HTRequest_postCallback(request); if (pcbf) {! status = pcbf(request, input);! if (status == HT_PAUSE || status == HT_LOADED)! ops = FD_READ; } else { status = (*input->isa->flush)(input); ops = FD_READ; /* Trick to ensure that we do READ */--- 842,862 ---- HTStream * input = HTRequest_inputStream(request); HTPostCallback * pcbf = HTRequest_postCallback(request); if (pcbf) {! if (http->lock)! return HT_OK;! else {! status = pcbf(request, input);! if (status == HT_PAUSE) {! ops = FD_READ;! http->lock = YES;! } else if (status == HT_LOADED)! ops = FD_READ;! else if (status == HT_ERROR) {! http->result = HT_INTERRUPTED;! http->state = HTTP_ERROR;! break;! }! } } else { status = (*input->isa->flush)(input); ops = FD_READ; /* Trick to ensure that we do READ */****************** 840,845 ****--- 869,875 ---- return HT_OK; else if (status == HT_CONTINUE) { if (PROT_TRACE) HTTrace("HTTP........ Continuing\n");+ http->lock = NO; ops = FD_WRITE; continue; } else if (status==HT_LOADED)Index: Library/Repository/src/HTTPReq.cdiff -c Library/Repository/src/HTTPReq.c:2.43 Library/Repository/src/HTTPReq.c:2.44*** Library/Repository/src/HTTPReq.c:2.43 Sun Sep 8 18:08:49 1996--- Library/Repository/src/HTTPReq.c Thu Sep 12 22:05:35 1996****************** 3,9 **** ** ** (c) COPYRIGHT MIT 1995. ** Please first read the full copyright statement in the file COPYRIGH.! ** @(#) $Id: lib_5.0_1.fix,v 1.1 1996/10/06 15:19:42 frystyk Exp $ ** ** This module implements the output stream for HTTP used for sending ** requests with or without a entity body.--- 3,9 ---- ** ** (c) COPYRIGHT MIT 1995. ** Please first read the full copyright statement in the file COPYRIGH.! ** @(#) $Id: lib_5.0_1.fix,v 1.1 1996/10/06 15:19:42 frystyk Exp $ ** ** This module implements the output stream for HTTP used for sending ** requests with or without a entity body.****************** 103,112 **** /* ** We don't preserve the final slash or lack of same through ** out the code. This is mainly for optimization reasons! ** but it gives a problem OPTIONS */! if (!me->url) me->url = HTParse(addr, "", PARSE_PATH);! if (!*me->url) StrAllocCopy(me->url, "*"); status = PUTS(me->url); } else { if (!me->url)--- 103,115 ---- /* ** We don't preserve the final slash or lack of same through ** out the code. This is mainly for optimization reasons! ** but it gives a problem OPTIONS. We can either send a "*"! ** or a "/" but not both. For now we send a "*". */! if (!me->url) {! me->url = HTParse(addr, "", PARSE_PATH|PARSE_PUNCTUATION);! if (!strcmp(me->url, "/")) *me->url = '*';! } status = PUTS(me->url); } else { if (!me->url)Index: LineMode/Repository/src/HTBrowse.cdiff -c LineMode/Repository/src/HTBrowse.c:1.157 LineMode/Repository/src/HTBrowse.c:1.158*** LineMode/Repository/src/HTBrowse.c:1.157 Mon Sep 9 14:54:42 1996--- LineMode/Repository/src/HTBrowse.c Thu Sep 12 22:05:44 1996****************** 3,9 **** ** ** (c) COPRIGHT MIT 1995. ** Please first read the full copyright statement in the file COPYRIGH.! ** @(#) $Id: lib_5.0_1.fix,v 1.1 1996/10/06 15:19:42 frystyk Exp $ ** ** Authors: ** NP: Nicola Pellow Tech.Student CERN 1990-91--- 3,9 ---- ** ** (c) COPRIGHT MIT 1995. ** Please first read the full copyright statement in the file COPYRIGH.! ** @(#) $Id: lib_5.0_1.fix,v 1.1 1996/10/06 15:19:42 frystyk Exp $ ** ** Authors: ** NP: Nicola Pellow Tech.Student CERN 1990-91****************** 575,581 **** */ PRIVATE int PutAnchor (LineMode * lm, HTRequest * request) {- int status = HT_INTERNAL; char * dest = AskUser(request, "Destination: ", NULL); /*--- 575,580 ----****************** 585,594 **** */ if (dest) { HTRequest * new_request = Thread_new(lm, YES, LM_UPDATE);! status = HTPutRelative(HTMainAnchor, dest, HTMainAnchor, new_request); HT_FREE(dest); }! return status; } /*--- 584,593 ---- */ if (dest) { HTRequest * new_request = Thread_new(lm, YES, LM_UPDATE);! HTPutDocumentRelative(HTMainAnchor, dest, HTMainAnchor, new_request); HT_FREE(dest); }! return YES; } /******************* 934,939 ****--- 933,942 ---- (HTAnchor *) HTMainAnchor, req); } }+ } else if (CHECK_INPUT("FLUSH", token)) { /* Flush file cache */+ if (confirm(req, "Flush Persistent Cache?") == YES)+ HTCache_flushAll();+ } else if (CHECK_INPUT("FORWARD", token)) { if (HTHistory_canForward(lm->history)) { req = Thread_new(lm, YES, LM_NO_UPDATE);****************** 1020,1025 ****--- 1023,1038 ---- case 'M': if (CHECK_INPUT("MANUAL", token)) { /* Read User manual */ status = LineMode_load(lm, HTMainAnchor, MANUAL, YES, &req);+ } else+ found = NO;+ break;+ + case 'O':+ if (CHECK_INPUT("OPTIONS", token)) { /* OPTIONS method */+ req = Thread_new(lm, YES, LM_NO_UPDATE);+ status = HTOptionsAnchor((HTAnchor*)+ (HTMainAnchor ? HTMainAnchor:lm->anchor),+ req); } else found = NO; break;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -