分类: 嵌入式
2010-10-13 15:00:27
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一次才可以了。不过你可以只对端口来抓包。呵呵……这只是其中发现的一个小收获。