Overview
Comment: | utils/ofhttp: Better error output and small bugfix |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
06b8800f20ca7d1148a9d0ce1ffc27e7 |
User & Date: | js on 2015-04-26 16:06:48 |
Other Links: | manifest | tags |
Context
2015-04-26
| ||
20:48 | utils/ofhttp: Allow specifying headers and proxy check-in: ac6dadc698 user: js tags: trunk | |
16:06 | utils/ofhttp: Better error output and small bugfix check-in: 06b8800f20 user: js tags: trunk | |
14:57 | utils/ofhttp: Support for continuing downloads check-in: 336a6e129b user: js tags: trunk | |
Changes
Modified utils/ofhttp/OFHTTP.m from [157aaf05ca] to [4f8bf24b84].
︙ | |||
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | + + | #import "OFAddressTranslationFailedException.h" #import "OFConnectionFailedException.h" #import "OFHTTPRequestFailedException.h" #import "OFInvalidFormatException.h" #import "OFInvalidServerReplyException.h" #import "OFOpenItemFailedException.h" #import "OFOutOfRangeException.h" #import "OFReadFailedException.h" #import "OFStatItemFailedException.h" #import "OFUnsupportedProtocolException.h" #import "OFWriteFailedException.h" #import "ProgressBar.h" #define GIBIBYTE (1024 * 1024 * 1024) #define MEBIBYTE (1024 * 1024) #define KIBIBYTE (1024) |
︙ | |||
288 289 290 291 292 293 294 | 290 291 292 293 294 295 296 297 298 299 300 301 302 303 | - - - - - - - - - - - | } request = [OFHTTPRequest requestWithURL: URL]; [request setHeaders: clientHeaders]; @try { response = [_HTTPClient performRequest: request]; |
︙ | |||
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 | 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + | @" In order to download via https, " @"you need to preload an SSL library " @"for ObjFW\n such as ObjOpenSSL!\n", [OFApplication programName]]; _errorCode = 1; goto next; } @catch (OFReadOrWriteFailedException *e) { OFString *action = @"Read or write"; if (!_quiet) [of_stdout writeString: @"\n"]; if ([e isKindOfClass: [OFReadFailedException class]]) action = @"Read"; else if ([e isKindOfClass: [OFWriteFailedException class]]) action = @"Write"; [of_stderr writeFormat: @"%@: Failed to download <%@>!\n" @" %@ failed: %@\n", [OFApplication programName], [URL string], action, e]; _errorCode = 1; goto next; } @catch (OFHTTPRequestFailedException *e) { if (!_quiet) [of_stdout writeFormat: @" ➜ %d\n", [[e response] statusCode]]; [of_stderr writeFormat: @"%@: Failed to download <%@>!\n", [OFApplication programName], [URL string]]; _errorCode = 1; goto next; } if (!_quiet) [of_stdout writeFormat: @" ➜ %d\n", [response statusCode]]; headers = [response headers]; lengthString = [headers objectForKey: @"Content-Length"]; type = [headers objectForKey: @"Content-Type"]; if (lengthString != nil) _length = [lengthString decimalValue]; if (!_quiet) { if (type == nil) type = @"unknown"; if (lengthString != nil) { |
︙ |
Modified utils/ofhttp/ProgressBar.m from [15aadddba2] to [5e42a1538e].
︙ | |||
130 131 132 133 134 135 136 | 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | - + - + - + | _lastReceived = _received; } - (void)_drawReceived { float bps; |
︙ |