Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1454809
  • 博文数量: 704
  • 博客积分: 10140
  • 博客等级: 上将
  • 技术积分: 6230
  • 用 户 组: 普通用户
  • 注册时间: 2010-07-15 20:41
文章分类

全部博文(704)

文章存档

2013年(1)

2012年(16)

2011年(536)

2010年(151)

分类: 嵌入式

2010-10-13 15:00:27

今天在测试人员反馈的消息之中,有些很离奇的错误,说来还得感谢咱们公司的网络相当的不稳定,才得以让这种现象被我们catch到了,并从中收获了一些宝贵的经验。
 
下面是http error 302 有关错误的解释:

Introduction

Your Web server thinks that your URL has been temporarily redirected to another URL. The client system is expected to immediately retry the alternate URL.

302 errors in the HTTP cycle

Any client (e.g. your Web browser or our CheckUpDown robot) goes through the following cycle when it communicates with the Web server:

  • Obtain an IP address from the IP name of the site (the site URL without the leading 'http://'). This lookup (conversion of IP name to IP address) is provided by domain name servers (DNSs).
  • Open an IP socket connection to that IP address.
  • Write an HTTP data stream through that socket.
  • Receive an HTTP data stream back from the Web server in response. This data stream contains status codes whose values are determined by the HTTP protocol. Parse this data stream for status codes and other useful information.

This error occurs in the final step above when the client receives an HTTP status code that it recognises as '302'.

Resolving 302 errors - general

The 302 response from the Web server should always include an alternative URL to which redirection should occur. If it does, a Web browser will immediately retry the alternative URL. So you never actually see a 302 error in a Web browser, unless perhaps you have a corrupt redirection chain e.g. URL A redirects to URL B which in turn redirects back to URL A. If your client is not a Web browser, it should behave in the same way as a Web browser i.e. immediately retry the alternative URL.

If the Web server does not return an alternative URL with the 302 response, then either the Web server sofware itself is defective or the Webmaster has not set up the URL redirection correctly.

Resolving 302 errors - CheckUpDown

Redirection of URLs may occur for low-level URLs (specific URLs within the Web site such as ) when you reorganise the web site, but is relatively uncommon for the top-level URLs (such as ) which most CheckUpDown users ask us to check. So this error should be fairly infrequent.

The 302 response from the Web server should always include an alternative URL to which redirection should occur. If it does, CheckUpDown automatically tries the alternative URL. This in turn may possibly lead to another redirection which CheckUpDown then tries. This continues for a maximum of 5 redirections. As soon as 5 redirections have occurred, CheckUpDown gives up and reports the 302 error for your account. So you should only ever see the 302 error if 1) the Web server gives no alternative URL on the 302 response or 2) the number of redirections exceeds 5. This second condition should be fairly unlikely - and may indicate a recursive pattern e.g. URL A redirects to URL B which in turn redirects back to URL A.

You first need to check that the IP name we use to check for your account is accurate. If you or your ISP have configured something so that any access using this name should now be redirected to another name, then you need to update your CheckUpDown account to start using the new name.

If you believe that the IP name we use is exact (should not be redirected), please try accessing the current URL using a Web browser. Note carefully which URL actually gets displayed, because your browser may silently switch to a substitute URL if it receives an 302 message from the Web server. If you see any evidence of a new URL, try accessing that directly from your browser. If this works (you see the Web site as expected), then this new URL is what you may need to update on your CheckUpDwon account. If this is a temporary redirection, then you may also need to reinstate the original IP name at a later date when the redirection is no longer effective.

If none of the above help, we can analyse the underlying HTTP data streams we receive from the Web server. These can provide additional information about the new URL(s) which the Web server thinks we should be accessing. Before doing this, we prefer you to identify any deliberate changes on your side, liaising with your ISP if needs be.

302 errors should occur infrequently, because top-level URLs do not change often. If they do change, then this is typically because a redirection URL is being suggested. This pervasive change is unlikely to occur by accident, so most often we can resolve this error by updating our system records for your account following a deliberate change of URL on your part, whether this change is temporary or permanent.

来处:

 

另外一个小故事,tcpdump 是一种静态固定抓包的方式,意思是说,当你用url来抓包时,第一次会利用dns解释出其ip之后,tcpdump 这个程序在以后就再也不会自动解释url了,如果其中你的url映射变动之后,也就得再重新dns一次才可以了。不过你可以只对端口来抓包。呵呵……这只是其中发现的一个小收获。

 

 

阅读(2616) | 评论(0) | 转发(0) |
0

上一篇:vim 设置代码折叠

下一篇:很烦很烦。

给主人留下些什么吧!~~