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

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

?? httpdav.c

?? 站點映像程序
?? C
?? 第 1 頁 / 共 5 頁
字號:
    }}/* Deal with the body size */int http_req_bodysize( http_req_t *req ) {    struct stat bodyst;    /* Do extra stuff if we have a body */    switch( req->body ) {    case http_body_file:	/* Get file length */	if( fstat( fileno(req->body_file), &bodyst ) < 0 ) {	    /* Stat failed */	    DEBUG( DEBUG_HTTP, "Stat failed: %s\n", strerror( errno ) );	    return PROTO_ERROR;	}	req->body_size = bodyst.st_size;	break;    case http_body_buffer:	req->body_size = strlen( req->body_buffer );	break;    default:	/* No body, so no size. */	return PROTO_OK;    }    if( req->body != http_body_none ) {	char tmp[BUFSIZ];	/* Add the body length header */	snprintf( tmp, BUFSIZ, "Content-Length: %d" EOL, req->body_size );	strcat( req->headers, tmp );    }    return PROTO_OK;}void http_strcat_hostname( struct proto_host_t *host, char *str ) {    strcat( str, host->hostname );    /* Only add the port if it isn't 80 */    if( host->port != HTTP_PORT ) {	static char buffer[128];	snprintf( buffer, 128, ":%d", host->port );	strcat( str, buffer );    }}/* Lob the User-Agent, connection and host headers in to the request * headers */void http_req_fixedheaders( http_req_t *req ) {    strcat( req->headers, "User-Agent: " );    strcat( req->headers, http_useragent );    strcat( req->headers, EOL 	    "Connection: Keep-Alive" EOL 	    "Host: " );    http_strcat_hostname( &http_server_host, req->headers );    strcat( req->headers, EOL );}/* Decodes a URI */char *uri_decode( const char *uri ) {    const char *pnt;    char *ret, *retpos, buf[5] = { "0x00\0" };    retpos = ret = malloc( strlen( uri ) + 1 );    for( pnt = uri; *pnt != '\0'; pnt++ ) {	if( *pnt == '%' ) {	    if( !isxdigit((unsigned char) pnt[1]) || 		!isxdigit((unsigned char) pnt[2]) ) {		/* Invalid URI */		return NULL;	    }	    buf[2] = *++pnt; buf[3] = *++pnt; /* bit faster than memcpy */	    *retpos++ = strtol( buf, NULL, 16 );	} else {	    *retpos++ = *pnt;	}    }    *retpos = '\0';    return ret;}/* RFC2396 spake: * "Data must be escaped if it does not have a representation  * using an unreserved character". * ...where... *  unreserved  = alphanum | mark *  mark = "-" | "_" | "." | "!" | "~" | "*" | "'" | "(" | ")" *  * We need also to skip reserved characters * reserved    = ";" | "/" | "?" | ":" | "@" | "&" | *               "=" | "+" | "$" | "," *//* Lookup table: * 1 marks an RESERVED character. 2 marks a UNRESERVED character. * 0 marks everything else.  */#define RE 1#define UN 2 const short uri_chars[128] = {/* 0 */  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* 16 */  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* 32 */  0, UN, 0, 0, RE, 0, RE, UN, UN, UN, UN, RE, RE, UN, UN, RE,/* 48 */ UN, UN, UN, UN, UN, UN, UN, UN, UN, UN, RE, RE, 0, RE, 0, RE,/* 64 */ RE, UN, UN, UN, UN, UN, UN, UN, UN, UN, UN, UN, UN, UN, UN, UN,/* 80 */ UN, UN, UN, UN, UN, UN, UN, UN, UN, UN, UN, 0, 0, 0, 0, UN,/* 96 */ 0, UN, UN, UN, UN, UN, UN, UN, UN, UN, UN, UN, UN, UN, UN, UN,/* 112 */ UN, UN, UN, UN, UN, UN, UN, UN, UN, UN, UN, 0, 0, 0, UN, 0 };#undef RE#undef UN/* Encodes the abspath segment of a URI. * TODO: Make this parse a complete URI */char *uri_abspath_encode( const char *abs_path ) {    const char *pnt;    char *ret, *retpos;    /* Rather than mess about growing the buffer, allocate as much as     * the URI could possibly need, i.e. every character gets %XX     * escaped. Hence 3 times input size.      */    retpos = ret = malloc( strlen( abs_path ) * 3 + 1 );    for( pnt = abs_path; *pnt != '\0'; pnt++ ) {	/* Escape it:	 *  - if it isn't 7-bit	 *  - if it is a reserved character (but ignore '/')	 *  - otherwise, if it is not an unreserved character	 * (note, there are many characters that are neither reserved	 * nor unreserved)	 */	if( *pnt<0 || (uri_chars[(int) *pnt] < 2 && *pnt!='/' )) {	    /* Escape it - %<hex><hex> */	    sprintf( retpos, "%%%02x", (unsigned char) *pnt );	    retpos += 3;	} else {	    /* It's cool */	    *retpos++ = *pnt;	}    }    *retpos = '\0';    return ret;}#ifdef URITESTvoid fe_transfer_progress( size_t progress, size_t total ) {}int main( int argc, char *argv[] ) {    char *tmp;    if( argc!=2 ) {	printf( "doh. usage:\nuritest a_uri_abspath_segment\n"		"e.g. uritest \"/this/is/a silly<filename>/but/hey\"\n" );	exit(-1);    }    printf( "Input URI: %s\n", argv[1] );    tmp = uri_abspath_encode( argv[1] );    printf( "Encoded: %s\n", tmp );    printf( "Decoded: %s\n", uri_decode( tmp ) );    return 0;}#endif /* URITEST *//* Initializes the request with given method and URI. * URI must be abs_path - i.e., NO scheme+hostname. It will BREAK  * otherwise. */void http_request_init( http_req_t *req, 			const char *method, const char *uri ) {    /* Clear it out */    memset( req, 0, sizeof( http_req_t ) );    DEBUG( DEBUG_HTTP, "Request starts.\n" );    /* Add in the fixed headers */    http_req_fixedheaders( req );    /* Set the standard stuff */    req->method = method;    req->uri = uri_abspath_encode( uri );        req->body_callback = NULL;    req->body = http_body_none;    }void http_request_end( http_req_t *req ) {    if( req->uri != NULL ) {	free( req->uri );    }    DEBUG( DEBUG_HTTP, "Request ends.\n" );}/* Reads a block of the response into buffer, which is of size buflen. * Returns number of bytes read, 0 on end-of-response, or -1 on error. */int http_response_read( http_req_t *req, char *buffer, size_t buflen ) {    int willread, readlen;    if( req->resp_te==http_te_chunked ) {	/* We are doing a chunked transfer-encoding.	 * It goes:  `SIZE CRLF CHUNK CRLF SIZE CRLF CHUNK CRLF ...'	 * ended by a `CHUNK CRLF 0 CRLF', a 0-sized chunk.	 * The slight complication is that we have to cope with	 * partial reads of chunks.	 * For this reason, resp_chunk_left contains the number of	 * bytes left to read in the current chunk.	 */	if( req->resp_chunk_left == 0 ) {	    /* We are at the start of a new chunk. */	    DEBUG( DEBUG_HTTP, "New chunk.\n" );	    if( read_line( http_sock, buffer, buflen ) < 0 ) {		DEBUG( DEBUG_HTTP, "Could not read chunk size.\n" );		return -1;	    }	    DEBUG( DEBUG_HTTP, "[Chunk Size] < %s", buffer );	    if( sscanf( buffer, "%x", &req->resp_chunk_left ) != 1 ) {		DEBUG( DEBUG_HTTP, "Couldn't read chunk size.\n" );		return -1;	    }	    DEBUG( DEBUG_HTTP, "Got chunk size: %d\n", req->resp_chunk_left );	    if( req->resp_chunk_left == 0 ) {		/* Zero-size chunk */		DEBUG( DEBUG_HTTP, "Zero-size chunk.\n" );		return 0;	    }	}	willread = min( buflen - 1, req->resp_chunk_left );    } else if( req->resp_length > 0 ) {	/* Have we finished reading the body? */	if( req->resp_left == 0 )	    return 0;	willread = min( buflen - 1, req->resp_left );    } else {	/* Read until socket-close */	willread = buflen - 1;    }    DEBUG( DEBUG_HTTP, "Reading %d bytes of response body.\n", willread );    readlen = sock_read( http_sock, buffer, willread );    DEBUG( DEBUG_HTTP, "Got %d bytes.\n", readlen );    if( readlen < 0 ) {	/* It broke */	DEBUG( DEBUG_HTTP, "Could not read block.\n" );	return -1;    } else if( (readlen == 0) && 	       ( (req->resp_length > 0) ||		 (req->resp_te==http_te_chunked) )) {	/* Premature close before read all of body, or during chunk read. */	DEBUG( DEBUG_HTTP, "Socket closed before end of body.\n" );	return -1;    }    buffer[readlen] = '\0';    DEBUG( DEBUG_HTTP, "Read block:\n%s\n", buffer );    if( req->resp_te==http_te_chunked ) {	req->resp_chunk_left -= readlen;	if( req->resp_chunk_left == 0 ) {	    char crlfbuf[2];	    /* If we've read a whole chunk, read a CRLF */	    if( read_data( http_sock, crlfbuf, 2 ) == 0 ) {		DEBUG( DEBUG_HTTP, "Read CRLF bytes.\n" );		if( strncmp( crlfbuf, EOL, 2 ) != 0 ) {		    DEBUG( DEBUG_HTTP, "CRLF bytes didn't contain CRLF!\n" );		    return -1;		}	    } else {		return -1;	    }	}		    } else if( req->resp_length > 0 ) {	req->resp_left -= readlen;    }    return readlen;}/* The HTTP/1.x request/response mechanism  * * Returns: *   PROTO_OK if the request was made (not related to status code) *   PROTO_ERROR if the request could not be made * The STATUS CODE is placed in req->status. The error string is * placed in http_error. *  * TODO: This should be chopped up into smaller chunks, and get rid of * the horrid goto's.   */int http_request( http_req_t *req ) {    char buffer[BUFSIZ]; /* For reading from the socket */    int ret, attempt, con_attempt;    bool using_expect, /* whether we have sent a Expect: 100 header */	close_connection,	dead_connection,	wants_body; /* whether the caller wants the response body		     * callbacks */#ifdef USE_BROKEN_PROPFIND    bool is_propfind = (strcmp( req->method, "PROPFIND" ) == 0);#endif#define HTTP_FATAL_ERROR(a) {				\	DEBUG( DEBUG_HTTP, a );					\	ret = PROTO_ERROR;					\	close_connection = true;				\	goto http_request_finish_proc;				\    }    /* Initialization... */    DEBUG( DEBUG_HTTP, "Request started...\n" );    strcpy( http_error, "Unknown error." );    ret = PROTO_OK;    if( http_req_bodysize( req ) != PROTO_OK )	return PROTO_ERROR;    /* I shall try this only twice...     * First time, with default authentication stuff (either, what we     * did last time, or none at all), then with up-to-the-minute     * what-the-server-requested authentication stuff. */    attempt = con_attempt = 1;    http_auth_new_request( &http_server_auth, req->method, req->uri,			   req->body_buffer, req->body_file );    do {	char request[REQSIZ], *authinfo = NULL;	/* Add in the Request-Line */	strcpy( request, req->method );	if( http_use_proxy ) {	    strcat( request, " http://" );	    http_strcat_hostname( &http_server_host, request );	} else {	    strcat( request, " " );	}	strcat( request, req->uri );	strcat( request, " HTTP/1.1" EOL );	/* The caller-supplied headers */	strcat( request, req->headers );	if( http_can_authenticate ) {	    /* Add the authorization headers in */	    char *val = http_auth_request( &http_server_auth );	    if( val != NULL ) {		strcat( request, "Authorization: " );		strcat( request, val );		free( val );	    } else {		DEBUG( DEBUG_HTTP, "auth_request returned NULL.\n" );	    }	}	/* Now handle the body. */	using_expect = false;	if( req->body!=http_body_none ) {	    if( (http_expect_works > -1) &&		(req->body_size > HTTP_EXPECT_MINSIZE) #ifdef USE_BROKEN_PROPFIND		/* ... definitely NOT if we're doing PROPFIND */		&& (!is_propfind)#endif /* USE_BROKEN_PROPFIND */		) {		/* Add Expect: 100-continue. */		strcat( request, "Expect: 100-continue" EOL );		using_expect = true;	    }	}	/* Final CRLF */	strcat( request, EOL );		/* Now send the request */	/* Open the connection if necessary */	if( !http_connected ) {	    if( (ret = http_open()) != PROTO_OK )		return ret;	}	dead_connection = false;#ifdef USE_BROKEN_PROPFIND	if( !is_propfind ) {#endif	/* Send the headers */#ifdef DEBUGGING	if( (256&debug_mask) == 256 ) { 	    /* Display everything mode */	    DEBUG( DEBUG_HTTP, "Sending request headers:\n%s", request );	} else {	    /* Blank out the Authorization paramaters */	    char reqdebug[REQSIZ], *pnt;	    strcpy( reqdebug, request );	    pnt = strstr( reqdebug, "Authorization: " );	    if( pnt != NULL ) {		for( pnt += 15; *pnt != '\r' && *pnt != '\0'; pnt++ ) {		    *pnt = 'x';		}	    }	    DEBUG( DEBUG_HTTP, "Sending request headers:\n%s", reqdebug );	}#endif DBEUGGING	if( send_string( http_sock, request ) < 0 ) {	    dead_connection = true;	    HTTP_FATAL_ERROR( "Could not send request!\n" );	}	DEBUG( DEBUG_HTTP, "Request sent.\n" );	#ifdef USE_BROKEN_PROPFIND	}#endif /* USE_BROKEN_PROPFIND */	/* Now, if we are doing a Expect: 100, hang around for a short	 * amount of time, to see if the server actually cares about the 	 * Expect and sends us a 100 Continue response if the request	 * is valid, else an error code if it's not. This saves sending	 * big files to the server when they will be rejected.	 */		if( using_expect ) {	    DEBUG( DEBUG_HTTP, "Waiting for response...\n" );	    ret = sock_block( http_sock, HTTP_EXPECT_TIMEOUT );	    switch( ret ) {	    case -1: /* error */		HTTP_FATAL_ERROR( "Wait (select) failed.\n" );

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品国产a级| 亚洲国产美女搞黄色| 一卡二卡欧美日韩| 国产美女av一区二区三区| 在线观看日韩国产| 国产精品三级电影| 久久99九九99精品| 欧美日本在线视频| 一区二区三区四区中文字幕| 国产一区二区三区| 欧美va亚洲va| 免费成人小视频| 欧美二区三区的天堂| 亚洲黄色av一区| 99视频一区二区| 中文字幕国产一区二区| 国产乱码精品一区二区三| 欧美电影免费观看完整版| 日韩中文欧美在线| 91精品一区二区三区久久久久久| 一区二区三区国产精华| 91丨九色porny丨蝌蚪| 国产精品私房写真福利视频| 国产一区二区福利视频| 久久久一区二区| 国产精品538一区二区在线| 久久综合久久鬼色中文字| 久久精品国产999大香线蕉| 日韩美一区二区三区| 麻豆精品久久精品色综合| 日韩一级完整毛片| 久久精品噜噜噜成人av农村| 日韩午夜在线影院| 国产一区二区影院| 久久精品夜色噜噜亚洲aⅴ| 国产99精品国产| 国产精品妹子av| 91天堂素人约啪| 亚洲综合一区二区| 欧美伦理电影网| 蜜臀91精品一区二区三区| www久久精品| 风间由美性色一区二区三区| 亚洲欧美中日韩| 欧美最猛黑人xxxxx猛交| 天天色 色综合| 精品电影一区二区三区| 国产69精品久久777的优势| 一区在线观看免费| 欧美日韩成人一区| 国产曰批免费观看久久久| 国产日本欧洲亚洲| 色婷婷av一区二区| 日韩电影免费在线| 亚洲国产精品精华液2区45| 91国偷自产一区二区开放时间 | 国产成人午夜精品影院观看视频| 久久精品一区二区三区不卡牛牛 | 日韩午夜三级在线| 国产suv精品一区二区883| 国产精品免费av| 在线电影一区二区三区| 成人免费毛片嘿嘿连载视频| 一区二区在线电影| 欧美刺激脚交jootjob| 99精品视频一区| 美女视频一区在线观看| 中文字幕在线不卡视频| 91麻豆精品久久久久蜜臀| 成人免费看视频| 日韩黄色免费电影| 成人免费在线观看入口| 日韩一级高清毛片| 色综合天天在线| 国产成人亚洲综合色影视| 婷婷开心久久网| 亚洲三级小视频| 久久久www成人免费无遮挡大片| 欧美午夜精品久久久久久孕妇 | 亚洲欧美日韩国产一区二区三区| 日韩欧美专区在线| 色婷婷香蕉在线一区二区| 国产999精品久久| 男男成人高潮片免费网站| 亚洲蜜臀av乱码久久精品| 久久丝袜美腿综合| 91精品婷婷国产综合久久性色 | 亚洲乱码国产乱码精品精小说| 精品久久一区二区三区| 欧美日韩国产区一| 色综合天天综合色综合av| 国产不卡视频一区二区三区| 麻豆精品一区二区三区| 首页亚洲欧美制服丝腿| 一区二区在线观看av| 成人免费在线播放视频| 国产午夜精品一区二区三区嫩草 | 7777女厕盗摄久久久| 一本久久精品一区二区| 成人综合在线网站| 成人综合在线观看| 国产精品综合二区| 久久国产精品99久久久久久老狼 | 欧美v日韩v国产v| 91麻豆精品国产91| 欧美日韩国产免费| 欧美日本在线播放| 911精品产国品一二三产区| 欧美在线你懂的| 欧美午夜电影一区| 欧美日韩一区二区三区四区五区 | 国产亚洲一区二区三区四区| 欧美一级黄色大片| 日韩女优av电影在线观看| 4438成人网| 日韩三区在线观看| wwww国产精品欧美| 久久综合一区二区| 国产偷国产偷精品高清尤物| 久久精品亚洲国产奇米99| 欧美激情一区二区三区不卡| 国产日韩欧美一区二区三区综合| 欧美激情中文字幕| 亚洲欧美日韩一区二区三区在线观看| 国产精品伦理在线| 亚洲另类一区二区| 亚洲高清免费观看高清完整版在线观看| 亚洲午夜久久久久中文字幕久| 午夜亚洲国产au精品一区二区 | 亚洲综合色婷婷| 亚洲午夜精品久久久久久久久| 亚瑟在线精品视频| 极品少妇一区二区三区精品视频| 久久99精品久久久久久动态图| 韩国视频一区二区| 91在线高清观看| 欧美视频中文字幕| 日韩欧美国产wwwww| 国产精品人成在线观看免费| 亚洲精品自拍动漫在线| 蜜桃在线一区二区三区| 成人在线视频首页| 欧美日韩精品三区| 久久精品日韩一区二区三区| 亚洲激情图片小说视频| 蜜桃一区二区三区在线| bt7086福利一区国产| 欧美日韩国产一级| 欧美激情综合五月色丁香| 一区二区三区在线观看动漫| 久久超碰97人人做人人爱| 91最新地址在线播放| 欧美一区中文字幕| 亚洲欧美一区二区三区久本道91 | 日本三级韩国三级欧美三级| 国产乱码精品一区二区三区忘忧草| 91在线小视频| 久久综合久久久久88| 亚洲午夜三级在线| 国产91在线看| 日韩欧美黄色影院| 亚洲免费视频成人| 国产成人精品免费网站| 欧美日韩精品一区二区在线播放| 国产日产欧产精品推荐色| 日韩精品国产精品| 色妞www精品视频| 久久久精品国产免费观看同学| 亚洲国产视频直播| 不卡在线观看av| 久久久久久亚洲综合影院红桃| 亚洲一区二区三区视频在线| 国产麻豆成人精品| 7777精品伊人久久久大香线蕉最新版| 中文字幕一区二区三区在线不卡| 国产在线看一区| 欧美蜜桃一区二区三区| 亚洲靠逼com| 成人精品一区二区三区中文字幕| 精品久久国产字幕高潮| 婷婷国产v国产偷v亚洲高清| 99久久精品99国产精品| 国产亚洲精品资源在线26u| 免费久久99精品国产| 欧美日韩成人在线| 亚洲成人动漫一区| 欧美中文字幕一区二区三区 | 中文字幕在线不卡| 成人精品一区二区三区中文字幕| 久久九九影视网| 国产成人综合网站| 久久九九久久九九| 国产麻豆精品theporn| 精品福利一二区| 国产麻豆成人精品| 久久精品人人做人人综合| 国产精品香蕉一区二区三区| 久久久电影一区二区三区| 国产成人综合视频| 国产女人水真多18毛片18精品视频|