version 1.108, 2013/03/30 10:11:35 |
version 1.109, 2013/04/09 08:58:46 |
|
|
switch (status) { |
switch (status) { |
case 200: /* OK */ |
case 200: /* OK */ |
#ifndef SMALL |
#ifndef SMALL |
/* |
/* |
* When we request a partial file, and we receive an HTTP 200 |
* When we request a partial file, and we receive an HTTP 200 |
* it is a good indication that the server doesn't support |
* it is a good indication that the server doesn't support |
* range requests, and is about to send us the entire file. |
* range requests, and is about to send us the entire file. |
|
|
{ |
{ |
size_t i, len; |
size_t i, len; |
char *buf, *q, c; |
char *buf, *q, c; |
|
int ret; |
|
|
len = 128; |
len = 128; |
if ((buf = malloc(len)) == NULL) |
if ((buf = malloc(len)) == NULL) |
|
|
buf = q; |
buf = q; |
len *= 2; |
len *= 2; |
} |
} |
if (SSL_read(ssl, &c, 1) <= 0) |
again: |
break; |
ret = SSL_read(ssl, &c, 1); |
|
if (ret <= 0) { |
|
if (SSL_get_error(ssl, ret) == SSL_ERROR_WANT_READ) |
|
goto again; |
|
else |
|
errx(1, "SSL_read error: %u", |
|
SSL_get_error(ssl, ret)); |
|
} |
buf[i] = c; |
buf[i] = c; |
if (c == '\n') |
if (c == '\n') |
break; |
break; |