64,651
社区成员
发帖
与我相关
我的任务
分享
sprintf(send_str, "GET %s HTTP/1.1\r\nAccept:*/*\r\n"
"Accept-Language:zh-cn\r\n"
"User-Agent:Mozilla/4.0 (compatible;MSIE 7.0;Windows XP)\r\n"
"Host:%s\r\n\r\n",//这里加了\r\n\r\n
web_domain.url,web_domain.host);
send(sock_id,send_str,strlen(send_str),0);
memset(resc_str, '\0',sizeof(resc_str));
sprintf(send_str, "GET %s HTTP/1.1\r\nAccept:*/*\r\n"
"Accept-Language:zh-cn\r\n"
"User-Agent:Mozilla/4.0 (compatible;MSIE 7.0;Windows XP)\r\n"
"Host:%s\r\n\r\n",//这里加了\r\n\r\n
web_domain.url,web_domain.host);
send(sock_id,send_str,strlen(send_str),0);
memset(resc_str, '\0',sizeof(resc_str));
HTTP/1.0 403 Forbidden
Server: cache/2.001+logs
Mime-Version: 1.0
Date: Thu, 15 Nov 2007 18:15:26 GMT
Content-Type: text/html
Content-Length: 1167
Expires: Thu, 15 Nov 2007 18:15:26 GMT
X-Squid-Error: ERR_ACCESS_DENIED 0
X-Cache: MISS from www.163.com
Proxy-Connection: close
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
<TITLE>错误:您所请求的网址(URL)无法获取</TITLE>
<STYLE type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></STYLE>
</HEAD><BODY>
<H1>错误</H1>
<H2>您所请求的网址(URL)无法获取</H2>
<HR noshade size="1px">
<P>
当尝试读取以下网址(URL)时:
<A HREF="http://war.163.com/07/1107/15/3SN323DC00011232.html">http://war.163.com/07/1107/15/3SN323DC00011232.html</A>
<P>
发生了下列的错误:
<UL>
<LI>
<STRONG>
Access Denied.
<BR>拒绝访问
</STRONG>
<P>
Access control configuration prevents your request from
being allowed at this time. Please contact your service provider if
you feel this is incorrect.
<BR>
当前的存取控制设定禁止您的请求被接受,
如果您觉得这是错误的,请与您网路服务的提供者联系。
</UL>
</P>
<P>本缓存服务器管理员:<A HREF="mailto:webmaster">webmaster</A>
<BR clear="all">
<HR noshade size="1px">
<ADDRESS>
Generated Thu, 15 Nov 2007 18:15:26 GMT by www.163.com (cache/2.001+logs)
</ADDRESS>
</BODY></HTML>
sprintf(send_str, "GET %s HTTP/1.1\r\nAccept: */*\r\nAccept-Language:zh-cn\r\nUser-Agent:Mozilla/4.0 (compatible;MSIE 7.0;Windows XP)\r\nHost:%s ",web_domain.url,web_domain.host);
memset(resc_str, '\0 ',sizeof(resc_str)); ///这句应该在send之后吧.
send(sock_id,send_str,strlen(send_str),0);