|
Lines 146-156
Link Here
|
| 146 |
if (fetchDebug) { |
146 |
if (fetchDebug) { |
| 147 |
c->total += c->chunksize; |
147 |
c->total += c->chunksize; |
| 148 |
if (c->chunksize == 0) |
148 |
if (c->chunksize == 0) |
| 149 |
fprintf(stderr, "\033[1m_http_fillbuf(): " |
149 |
fprintf(stderr, "_http_fillbuf(): " |
| 150 |
"end of last chunk\033[m\n"); |
150 |
"end of last chunk\n"); |
| 151 |
else |
151 |
else |
| 152 |
fprintf(stderr, "\033[1m_http_fillbuf(): " |
152 |
fprintf(stderr, "_http_fillbuf(): " |
| 153 |
"new chunk: %lu (%lu)\033[m\n", |
153 |
"new chunk: %lu (%lu)\n", |
| 154 |
(unsigned long)c->chunksize, (unsigned long)c->total); |
154 |
(unsigned long)c->chunksize, (unsigned long)c->total); |
| 155 |
} |
155 |
} |
| 156 |
#endif |
156 |
#endif |
|
Lines 447-454
Link Here
|
| 447 |
setlocale(LC_TIME, locale); |
447 |
setlocale(LC_TIME, locale); |
| 448 |
if (r == NULL) |
448 |
if (r == NULL) |
| 449 |
return -1; |
449 |
return -1; |
| 450 |
DEBUG(fprintf(stderr, "last modified: [\033[1m%04d-%02d-%02d " |
450 |
DEBUG(fprintf(stderr, "last modified: [%04d-%02d-%02d " |
| 451 |
"%02d:%02d:%02d\033[m]\n", |
451 |
"%02d:%02d:%02d]\n", |
| 452 |
tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, |
452 |
tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, |
| 453 |
tm.tm_hour, tm.tm_min, tm.tm_sec)); |
453 |
tm.tm_hour, tm.tm_min, tm.tm_sec)); |
| 454 |
*mtime = timegm(&tm); |
454 |
*mtime = timegm(&tm); |
|
Lines 467-473
Link Here
|
| 467 |
len = len * 10 + (*p - '0'); |
467 |
len = len * 10 + (*p - '0'); |
| 468 |
if (*p) |
468 |
if (*p) |
| 469 |
return -1; |
469 |
return -1; |
| 470 |
DEBUG(fprintf(stderr, "content length: [\033[1m%lld\033[m]\n", |
470 |
DEBUG(fprintf(stderr, "content length: [%lld]\n", |
| 471 |
(long long)len)); |
471 |
(long long)len)); |
| 472 |
*length = len; |
472 |
*length = len; |
| 473 |
return 0; |
473 |
return 0; |
|
Lines 495-501
Link Here
|
| 495 |
len = len * 10 + *p - '0'; |
495 |
len = len * 10 + *p - '0'; |
| 496 |
if (*p || len < last - first + 1) |
496 |
if (*p || len < last - first + 1) |
| 497 |
return -1; |
497 |
return -1; |
| 498 |
DEBUG(fprintf(stderr, "content range: [\033[1m%lld-%lld/%lld\033[m]\n", |
498 |
DEBUG(fprintf(stderr, "content range: [%lld-%lld/%lld]\n", |
| 499 |
(long long)first, (long long)last, (long long)len)); |
499 |
(long long)first, (long long)last, (long long)len)); |
| 500 |
*offset = first; |
500 |
*offset = first; |
| 501 |
*length = last - first + 1; |
501 |
*length = last - first + 1; |
|
Lines 573-580
Link Here
|
| 573 |
char *upw, *auth; |
573 |
char *upw, *auth; |
| 574 |
int r; |
574 |
int r; |
| 575 |
|
575 |
|
| 576 |
DEBUG(fprintf(stderr, "usr: [\033[1m%s\033[m]\n", usr)); |
576 |
DEBUG(fprintf(stderr, "usr: [%s]\n", usr)); |
| 577 |
DEBUG(fprintf(stderr, "pwd: [\033[1m%s\033[m]\n", pwd)); |
577 |
DEBUG(fprintf(stderr, "pwd: [%s]\n", pwd)); |
| 578 |
if (asprintf(&upw, "%s:%s", usr, pwd) == -1) |
578 |
if (asprintf(&upw, "%s:%s", usr, pwd) == -1) |
| 579 |
return -1; |
579 |
return -1; |
| 580 |
auth = _http_base64(upw); |
580 |
auth = _http_base64(upw); |