diff options
author | Nick White <git@njw.me.uk> | 2011-11-19 15:50:33 +0000 |
---|---|---|
committer | Nick White <git@njw.me.uk> | 2011-11-19 15:50:33 +0000 |
commit | d9e676c2bc3c4fc10b5dc1d951ee7ec66d440ae8 (patch) | |
tree | 6645687625ca4e1aeb9f757b71a87d348a5b2eee /util.c | |
parent | 9458d263dc8275b5d487a004166111f0775455e3 (diff) |
Add error messages regarding 403 ip blocking
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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)) { |