summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorNick White <git@njw.me.uk>2011-11-19 15:50:33 +0000
committerNick White <git@njw.me.uk>2011-11-19 15:50:33 +0000
commitd9e676c2bc3c4fc10b5dc1d951ee7ec66d440ae8 (patch)
tree6645687625ca4e1aeb9f757b71a87d348a5b2eee /util.c
parent9458d263dc8275b5d487a004166111f0775455e3 (diff)
Add error messages regarding 403 ip blocking
Diffstat (limited to 'util.c')
-rw-r--r--util.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/util.c b/util.c
index 0405640..207024a 100644
--- a/util.c
+++ b/util.c
@@ -70,8 +70,11 @@ int get(char *host, char *path, char *sendcookie, char *savecookie, char **buf)
l = 0;
snprintf(m, 256, "Set-Cookie: %%%ds;", COOKIEMAX-1);
while((res = recv(fd, t, BUFSIZ, 0)) > 0) {
- if(sscanf(t, "HTTP/%d.%d %d", &i, &i, &p) == 3 && p != 200)
+ if(sscanf(t, "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");
return 0;
+ }
t2 = t;
if(savecookie != NULL) {
while((t2 = strstr(t2, "Set-Cookie: ")) && sscanf(t2, m, c)) {