亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? htwais.c

?? www工具包. 這是W3C官方支持的www支撐庫. 其中提供通用目的的客戶端的WebAPI: complete HTTP/1.1 (with caching, pipelining, PUT, POS
?? C
?? 第 1 頁 / 共 3 頁
字號:
	/* Accept one or two */    if ((theWAISinfo->as_gate = (*server_name == '/'))) server_name++;    if ((theWAISinfo->www_database = strchr(server_name, '/')))      {       *(theWAISinfo->www_database)++ = 0;  /* Separate database name */       doctype = strchr(theWAISinfo->www_database, '/');       if (key)	 ok = YES;	/* Don't need doc details */        else	 if (doctype)	   {	/* If not search parse doc details */	    char* doclength;	    *doctype++ = 0;	/* Separate rest of doc address */	    doclength = strchr(doctype, '/');	    if (doclength)	      {	       *doclength++ = 0;	       document_length = atol(doclength);	       if (document_length)		 {		  docname = strchr(doclength, '/');		  if (docname)		    {		     *docname++ = 0;		     ok = YES;	/* To avoid a goto! */		    } /* if docname */		 } /* if document_length valid */	      } /* if doclength */	   }	  else	   { /* no doctype?  Assume index required */	    if (!key) key = "";	    ok = YES;	   } /* if doctype */      } /* if database */   }      if (!ok)   {    char *unescaped = NULL;    StrAllocCopy(unescaped, arg);    HTUnEscape(unescaped);    HTRequest_addError(request, ERR_FATAL, NO, HTERR_BAD_REQUEST,		       (void *) unescaped, (int) strlen(unescaped),		       "HTLoadWAIS");    HT_FREE(unescaped);    HT_FREE(theWAISinfo->names);    return -1;   }     HTTRACE(PROT_TRACE, "HTLoadWAIS.. URL Parsed OK\n"); theWAISinfo->state = HTWAIS_NEED_CONNECTION; if ((service = strchr(theWAISinfo->names, ':')))   *service++ = 0;  else   service = "210"; if ((server_name ? server_name[0] : 0))   {    boolean do_need_to_connect_to_server = true;    if (key) if ((*key) == 0) do_need_to_connect_to_server = false;    if (do_need_to_connect_to_server)      {       if ((theWAISinfo->connection = connect_to_server(server_name,							atoi(service)))	   == NULL)	 {	  char* host = HTParse(arg, "", PARSE_HOST);	  HTTRACE(PROT_TRACE, "HTLoadWAIS.."		    " Can't open connection to %s via service %s.\n" _ 		    server_name _ service);	  HTRequest_addError(request, ERR_FATAL, NO, HTERR_WAIS_NO_CONNECT,			     (void *) host, (int) strlen(host), "HTLoadWAIS");	  theWAISinfo->result = HT_ERROR;	  HTWAISCleanup(request, status);	  return status;	 }      }   }  else   theWAISinfo->connection = NULL; StrAllocCopy(theWAISinfo->wais_database, theWAISinfo->www_database); HTUnEscape(theWAISinfo->wais_database); /* Make title name without the .src */ {  char *srcstr;  StrAllocCopy(theWAISinfo->basetitle, theWAISinfo->wais_database);  if ((srcstr = strstr(theWAISinfo->basetitle, ".src")) != NULL)    *srcstr = '\0'; }     /* This below fixed size stuff is terrible */ if ((theWAISinfo->request_message =                       (char*)s_malloc((size_t)MAX_MESSAGE_LEN * sizeof(char)))     == NULL)   HT_OUTOFMEM("WAIS request message"); if ((theWAISinfo->response_message =                       (char*)s_malloc((size_t)MAX_MESSAGE_LEN * sizeof(char)))     == NULL)   HT_OUTOFMEM("WAIS response message"); /*	If keyword search is performed but there are no keywords, **	the user has followed a link to the index itself. **     It would be appropriate at this point to send him the .SRC file - how? */ if (key)   {    if (*key)      {      /*       *   S E A R C H   (nonempty key (*key != 0))       */       char *p;       HTStructured* target;       theWAISinfo->state = HTWAIS_NEED_RESPONSE;       strncpy(keywords, key, MAX_KEYWORDS_LENGTH);       while ((p = strchr(keywords,'+'))) *p = ' ';       /* Send advance title to get something fast to the other end */       target = HTMLGenerator(request, NULL, WWW_HTML, format_out, sink);       START(HTML_HTML);       START(HTML_HEAD);       START(HTML_TITLE);       PUTS(keywords);       PUTS(" in ");       PUTS(theWAISinfo->basetitle);       END(HTML_TITLE);       END(HTML_HEAD);       START(HTML_BODY);       START(HTML_H1);       PUTS("WAIS Search of \"");       PUTS(keywords);       PUTS("\" in ");       PUTS(theWAISinfo->basetitle);       END(HTML_H1);       START(HTML_ISINDEX);       request_buffer_length = MAX_MESSAGE_LEN; /* Amount left */       HTTRACE(PROT_TRACE, "HTLoadWAIS.. Search for `%s' in `%s'\n" _ 		 keywords _ theWAISinfo->wais_database);       if (generate_search_apdu(theWAISinfo->request_message + HEADER_LENGTH, 				&request_buffer_length, 				keywords, theWAISinfo->wais_database, NULL,				HTMaxWAISLines) == NULL)	 {	  HTTRACE(PROT_TRACE, "WAIS Search. Too many lines in response\n");	  HTRequest_addError(request, ERR_WARN, NO, HTERR_WAIS_OVERFLOW, 			     NULL, 0, "HTLoadWAIS");	 }       if (!interpret_message(theWAISinfo->request_message, 			      MAX_MESSAGE_LEN - request_buffer_length, 			      theWAISinfo->response_message,			      MAX_MESSAGE_LEN,			      theWAISinfo->connection,			      false	/* true verbose */			      ))	 {	  HTTRACE(PROT_TRACE, "WAIS Search. Too many lines in response\n");	  HTRequest_addError(request, ERR_WARN, NO, HTERR_WAIS_OVERFLOW, 			     NULL, 0, "HTLoadWAIS");	 }        else	 {	/* returned message ok */	  SearchResponseAPDU  *query_response = 0;	  readSearchResponseAPDU(&query_response,				theWAISinfo->response_message + HEADER_LENGTH);	  display_search_response(target, 				  query_response, theWAISinfo->wais_database,				  keywords);	  if (query_response->DatabaseDiagnosticRecords)	    freeWAISSearchResponse(query_response->DatabaseDiagnosticRecords);	  freeSearchResponseAPDU(query_response);	 }	/* returned message not too large */       END(HTML_BODY);       END(HTML_HTML);       FREE_TARGET;       HTAnchor_setFormat(anchor, WWW_HTML);       theWAISinfo->result = status = HT_LOADED;      }     else      {      /*       *   I N D E X   (key is empty (*key = 0))       */#ifdef CACHE_FILE_PREFIX       char filename[256];       FILE * fp;#endif       HTStructured* target = HTMLGenerator(request, NULL,					    WWW_HTML, format_out, sink);       theWAISinfo->state = HTWAIS_NEED_REQUEST;       {	START(HTML_HTML);	START(HTML_HEAD);	START(HTML_TITLE);	PUTS(theWAISinfo->basetitle);	PUTS(" Index");	END(HTML_TITLE);	END(HTML_HEAD);	START(HTML_BODY);	START(HTML_H1);	PUTS("WAIS Index: ");	PUTS(theWAISinfo->basetitle);	END(HTML_H1);       }       START(HTML_ISINDEX);       /* If we have seen a source file for this database, use that: */#ifdef CACHE_FILE_PREFIX       sprintf(filename,	       "%sWSRC-%s:%s:%.100s.txt",	       CACHE_FILE_PREFIX,	       server_name, service, theWAISinfo->www_database);       fp = fopen(filename, "r");	/* Have we found this already? */       HTTRACE(PROT_TRACE, "HTLoadWAIS.. Description of server %s %s.\n" _ 		 filename _ 		 fp ? "exists already" : "does NOT exist!");       if (fp)	 {	  int c;	  START(HTML_PRE);   /* Preformatted description */	  while((c=getc(fp)) != EOF) PUTC(c);   /* Transfer file */	  END(HTML_PRE);	  fclose(fp);	 }#endif       END(HTML_BODY);       END(HTML_HTML);       FREE_TARGET;      }    HTAnchor_setFormat(anchor, WWW_HTML);    theWAISinfo->result = status = HT_LOADED;   }  else   {/* document rather than search */   /*    *   D O C U M E N T    F E T C H   (no key (key == NULL))    */    boolean binary = true;     /* how to transfer stuff coming over */    HTStream* target;    HTAtom* document_type_atom = HTAtom_for("application/octet-stream");    long count;    any   doc_chunk;    any * docid = &doc_chunk;    theWAISinfo->state = HTWAIS_FETCH_DOCUMENT;    HTTRACE(PROT_TRACE, "HTLoadWAIS.. Retrieve document `%s'\n"	      "............ type `%s' length %ld\n" _ 	      (docname ? docname : "unknown") _ 	      (doctype ? doctype : "unknown") _ 	      document_length);    if (doctype)      {       if (strcmp(doctype, "WSRC") == 0)	 {	  document_type_atom = HTAtom_for("application/x-wais-source");	  binary = false;	 }        else	 if (strcmp(doctype, "TEXT") == 0)	   {	    document_type_atom = WWW_UNKNOWN;	    binary = false;	   }	  else	   if (strcmp(doctype, "HTML") == 0)	     {	      document_type_atom = WWW_HTML;	      binary = false;	     }	    else	     if (strcmp(doctype, "GIF") == 0) document_type_atom = WWW_GIF;      }    HTAnchor_setFormat(anchor, document_type_atom);    /* Guess on TEXT format as it might be HTML */    if ((target = HTStreamStack(HTAnchor_format(anchor),				HTRequest_outputFormat(request),				HTRequest_outputStream(request),				request, YES))	== NULL)      {       theWAISinfo->result = HT_ERROR;       status = -1;       HTWAISCleanup(request, status);       return status;      }    /* Decode hex or litteral format for document ID */    WAIS_from_WWW(docid, docname);    /* Loop over slices of the document */    for (count = 0; count * CHARS_PER_PAGE < document_length; count++)      {       char *type = s_strdup(doctype);       request_buffer_length = MAX_MESSAGE_LEN;	      /* Amount left */       HTTRACE(PROT_TRACE, "HTLoadWAIS.. Slice number %ld\n" _ count);       if (generate_retrieval_apdu(theWAISinfo->request_message + HEADER_LENGTH,				   &request_buffer_length, 				   docid, CT_byte,				   count * CHARS_PER_PAGE,				   HTMIN((count + 1) * CHARS_PER_PAGE,					 document_length),				     type,				   theWAISinfo->wais_database) == 0)	 {	  HTRequest_addError(request, ERR_WARN, NO, HTERR_WAIS_OVERFLOW, 			     NULL, 0, "HTLoadWAIS");	 }       HT_FREE(type);       /* Actually do the transaction given by request_message */          if (interpret_message(theWAISinfo->request_message, 			     MAX_MESSAGE_LEN - request_buffer_length, 			     theWAISinfo->response_message,			     MAX_MESSAGE_LEN,			     theWAISinfo->connection,			     false /* true verbose */				     )	   == 0)	 {	  HTRequest_addError(request, ERR_WARN, NO, HTERR_WAIS_OVERFLOW, 			     NULL, 0, "HTLoadWAIS");	 }       /* Parse the result which came back into memory. */       readSearchResponseAPDU(&retrieval_response, 			      theWAISinfo->response_message + HEADER_LENGTH);       {	WAISSearchResponse* searchres = (WAISSearchResponse*)retrieval_response->DatabaseDiagnosticRecords;	if (!searchres->Text)	  {	   if (searchres->Diagnostics &&	       *searchres->Diagnostics &&	       (*searchres->Diagnostics)->ADDINFO)	     {	      char *errmsg = (*searchres->Diagnostics)->ADDINFO;	      HTRequest_addError(request, ERR_WARN, NO, HTERR_WAIS_MODULE,				 (void *) errmsg, (int) strlen(errmsg),				 "HTLoadWAIS");	     }	    else	     {	      HTRequest_addError(request, ERR_WARN, NO, HTERR_WAIS_MODULE,				 NULL, 0, "HTLoadWAIS");	     }	   (*target->isa->_free)(target);	   HTRequest_setOutputStream(request, NULL);	   HT_FREE(docid->bytes);	   freeWAISSearchResponse(retrieval_response->DatabaseDiagnosticRecords); 	   freeSearchResponseAPDU(retrieval_response);	   theWAISinfo->result = HT_OK;	   HTWAISCleanup(request, status);	  }	 else	  {	   output_text_record(target, *searchres->Text,			      false, binary);	   freeWAISSearchResponse(retrieval_response->DatabaseDiagnosticRecords);	   freeSearchResponseAPDU(retrieval_response);	  } /* If text existed */       }      } /* Loop over slices */    (*target->isa->_free)(target);    HTRequest_setOutputStream(request, NULL);    HT_FREE(docid->bytes);    theWAISinfo->result = status = HT_LOADED;   } /* End ``if (key)'' */ HTWAISCleanup(request, status); return status;}PUBLIC int HTLoadWAIS (SOCKET soc, HTRequest* request){ wais_info* theWAISinfo;  /* Specific protocol information */ HTNet* net;              /* Generic protocol information */ HTParentAnchor* anchor; /*  * Initiate a new wais structure and bind to request structure.  * This is actually state HTWAIS_BEGIN,  * but it can't be in the state machine,  * as we need the structure first.  */ if (request)   {    if ((anchor = HTRequest_anchor(request)) == NULL) return HT_ERROR;    if ((net = HTRequest_net(request)) == NULL) return HT_ERROR;   }  else   return HT_ERROR; HTTRACE(PROT_TRACE, "HTWAIS...... Looking for `%s\'\n" _ HTAnchor_physical(anchor));                     /* Get existing copy */ if ((theWAISinfo = (wais_info*)HTNet_context(net)) == NULL)   {    if ((theWAISinfo = (wais_info*)HT_CALLOC(1, sizeof(wais_info))) == NULL)      HT_OUTOFMEM("HTLoadWAIS");    HTNet_setEventCallback(net, HTWAISEvent);    HTNet_setEventParam(net, theWAISinfo);  /* callbacks get theWAISinfo* */    HTNet_setContext(net, theWAISinfo);    theWAISinfo->state  = HTWAIS_BEGIN;    theWAISinfo->result = HT_ERROR;    theWAISinfo->net    = net;   } /* get it started - ops is ignored */ return HTWAISEvent(soc, theWAISinfo, HTEvent_BEGIN);}#endif /* HT_DIRECT_WAIS */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品一二三四| 91在线观看下载| 在线免费精品视频| 久久久久久久av麻豆果冻| 一区二区三区国产精品| 国产剧情一区在线| 91麻豆精品久久久久蜜臀| 亚洲日本成人在线观看| 亚洲精品欧美在线| 日韩一区精品字幕| 91一区二区在线观看| 国产亚洲综合性久久久影院| 午夜激情一区二区三区| 91原创在线视频| 国产精品人成在线观看免费 | 成人国产精品免费观看视频| 91精品国产色综合久久不卡蜜臀| 欧美va亚洲va| 日韩精品一区第一页| 国产精品中文欧美| 日韩欧美在线一区二区三区| 亚洲国产精品麻豆| 欧美中文字幕亚洲一区二区va在线| 在线观看日韩国产| 亚洲人成电影网站色mp4| 国产成+人+日韩+欧美+亚洲| 欧美精品一区二区精品网| 视频在线在亚洲| 欧美日韩免费一区二区三区视频| 久久亚洲捆绑美女| 久久精品久久99精品久久| 欧美肥胖老妇做爰| 日日夜夜免费精品| 欧美日韩dvd在线观看| 亚洲综合激情网| 日本韩国欧美在线| 亚洲欧美日韩一区| 色婷婷综合久久久久中文一区二区 | 亚洲mv在线观看| 色国产综合视频| 尤物在线观看一区| 在线影视一区二区三区| 一区二区三区四区在线| 国产尤物一区二区| 国产女人aaa级久久久级| 国产成人精品一区二区三区网站观看| 欧美性一区二区| 亚洲成人免费在线| 制服.丝袜.亚洲.中文.综合| 天堂av在线一区| 91视频国产资源| 亚洲另类春色国产| 在线精品视频一区二区三四| 国产日本欧美一区二区| 丁香网亚洲国际| 亚洲国产成人私人影院tom| 成人av电影在线网| 亚洲免费在线电影| 欧美视频一区在线| 男女男精品视频| 精品88久久久久88久久久| 日韩精品欧美精品| 欧美亚洲国产一区二区三区| 五月婷婷综合网| 欧美成人乱码一区二区三区| 国产精品自拍网站| 成人免费在线播放视频| 在线观看免费亚洲| 美女www一区二区| 国产亚洲综合在线| 日本道精品一区二区三区| 午夜久久久久久久久| 欧美变态tickling挠脚心| 高清不卡一区二区| 亚洲综合自拍偷拍| 欧美电影免费观看高清完整版在 | 久久久久久久久一| 99精品视频一区| 丝袜亚洲另类丝袜在线| 久久精品欧美日韩| 欧美综合欧美视频| 狠狠色狠狠色合久久伊人| 午夜免费欧美电影| 日韩免费高清av| www.亚洲人| 日韩和欧美一区二区三区| 久久精品免视看| 欧美吻胸吃奶大尺度电影| 精品一区二区三区在线视频| 国产精品国产三级国产普通话三级 | 久久久精品人体av艺术| 国产一区二区三区最好精华液| 日韩欧美三级在线| 亚洲私人影院在线观看| 欧美视频自拍偷拍| 日韩精品电影在线| 国产精品第一页第二页第三页| av成人动漫在线观看| 日韩中文欧美在线| 欧美不卡123| 日本国产一区二区| 国产酒店精品激情| 亚洲高清久久久| 亚洲国产精品传媒在线观看| 欧美日韩精品二区第二页| 免费视频一区二区| 亚洲天堂免费看| 久久久久一区二区三区四区| 在线区一区二视频| 国产成人高清视频| 麻豆成人久久精品二区三区小说| 精品久久久久久久久久久久久久久久久 | 蜜桃视频第一区免费观看| 精品国产一区二区亚洲人成毛片| 国产一区二区三区久久悠悠色av| 中文无字幕一区二区三区| 色综合一个色综合亚洲| 国内一区二区视频| 天天色天天操综合| 亚洲嫩草精品久久| 国产色综合久久| 欧美电影免费观看高清完整版在线 | 亚洲精品美国一| 久久九九久精品国产免费直播| 91丨porny丨最新| 国产麻豆精品在线| 久久国产精品色婷婷| 无码av中文一区二区三区桃花岛| 精品国产污污免费网站入口 | 日韩国产高清在线| 一区二区高清免费观看影视大全| 在线成人高清不卡| 在线观看国产一区二区| 成人中文字幕合集| 国产乱妇无码大片在线观看| 美女一区二区三区在线观看| 国产精品福利在线播放| 久久蜜桃av一区二区天堂| 日韩欧美一区中文| 91精品久久久久久久久99蜜臂| 成人美女视频在线看| 国产成人在线色| 国产一级精品在线| 国产自产高清不卡| 极品瑜伽女神91| 久久福利资源站| 蜜桃视频在线观看一区二区| 亚洲欧美在线高清| 日韩精品最新网址| 欧美一区午夜视频在线观看 | 久久精品理论片| 蜜桃av一区二区| 亚洲人快播电影网| 亚洲天堂精品视频| 一区二区三区不卡在线观看| 亚洲免费观看高清完整版在线| 精品成人一区二区三区四区| 日韩欧美一级在线播放| 91老师片黄在线观看| 久久99国产精品久久99| 精品一区二区三区影院在线午夜| 一区二区三区**美女毛片| 亚洲精品欧美激情| 亚洲午夜免费电影| 午夜精品一区在线观看| 亚洲日本电影在线| 亚洲国产精品人人做人人爽| 天堂一区二区在线| 亚洲猫色日本管| 国产日韩欧美精品一区| 国产精品女上位| wwwwww.欧美系列| 日本一区二区三区国色天香 | 成人sese在线| 激情综合亚洲精品| 国产风韵犹存在线视精品| 成人av网站大全| 色综合视频一区二区三区高清| 美国精品在线观看| 国产精品中文有码| 色综合亚洲欧洲| 欧美老人xxxx18| 精品国产欧美一区二区| 中文字幕av一区二区三区免费看| 91精品国产美女浴室洗澡无遮挡| 欧美综合色免费| 欧美一区二区三区免费观看视频 | 99re视频精品| 欧美影视一区在线| 一本在线高清不卡dvd| 欧美在线视频你懂得| 欧美一级高清片| 日本一二三不卡| 日本一区二区三级电影在线观看| www国产精品av| 2022国产精品视频| 亚洲三级在线观看| 日韩电影在线一区二区| 国产精品1区2区| 高清不卡一二三区|