summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'util.c')
-rw-r--r--util.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/util.c b/util.c
index b7b7693..91cb060 100644
--- a/util.c
+++ b/util.c
@@ -146,8 +146,7 @@ int request(char *host, int ssl, char *request, char *savecookie, char **body, i
cur = pos + 2;
if(sscanf(headline, "HTTP/%d.%d %d", &i, &i, &p) == 3 && p != 200) {
- if(p == 403)
- fprintf(stderr, "403 forbidden: your IP address may be temporarily blocked\n");
+ fprintf(stderr, "HTTP code %d; your IP address may be temporarily blocked\n", p);
free(buf);
free(*body);
return 0;
@@ -178,7 +177,8 @@ int get(char *host, int ssl, char *path, char *sendcookie, char *savecookie, cha
if(sendcookie && sendcookie[0])
snprintf(c, COOKIEMAX, "\r\nCookie: %s", sendcookie);
snprintf(h, BUFSIZ, "GET %s HTTP/1.0\r\nUser-Agent: getxbook-"VERSION \
- " (not mozilla)\r\nHost: %s%s\r\n\r\n", path, host, c);
+ " (not mozilla)\r\nAccept-Encoding: gzip;q=0,deflate;q=0\r\n" \
+ "Host: %s%s\r\n\r\n", path, host, c);
return request(host, ssl, h, savecookie, body, istext);
}