Copyright (c) 2009 Robert Millan
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
| 56 | 56 | /* Advanced QHttp errors */ |
| 57 | 57 | TimeoutError, /* MaxWaitTime time passed with no response */ |
| 58 | 58 | PageNotFoundError, /* Corresponds to 404 == not found header */ |
| | 59 | MovedPermanentlyError, /* Corresponds to 301 == moved permanently response */ |
| 59 | 60 | MovedTemporarilyError /* Corresponds to 302 == moved temporarily response */ |
| 60 | 61 | }; |
| 61 | 62 | |
| … |
… |
|
| 92 | 93 | return tr ("Could not locate the file on " |
| 93 | 94 | "the server (response: %1)").arg (mStatusCode); |
| 94 | 95 | case MovedTemporarilyError: |
| | 96 | case MovedPermanentlyError: |
| 95 | 97 | return QString::null; /* should be redirected anyway */ |
| 96 | 98 | default: |
| 97 | 99 | return QHttp::errorString(); |
| … |
… |
|
| 133 | 135 | mStatusCode = aResponse.statusCode(); |
| 134 | 136 | switch (mStatusCode) |
| 135 | 137 | { |
| | 138 | case 301: |
| | 139 | mErrorCode = MovedPermanentlyError; |
| | 140 | return abort(); |
| 136 | 141 | case 302: |
| 137 | 142 | mErrorCode = MovedTemporarilyError; |
| 138 | 143 | return abort(); |