-const char cgi_rcs[] = "$Id: cgi.c,v 1.127 2010/04/12 16:48:45 fabiankeil Exp $";
+const char cgi_rcs[] = "$Id: cgi.c,v 1.128 2010/04/21 20:48:06 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/cgi.c,v $
if (!err)
{
/* It worked */
- rsp->reason = RSP_REASON_CGI_CALL;
+ rsp->crunch_reason = CGI_CALL;
return finish_http_response(csp, rsp);
}
else
if (!strcmp(templatename, "no-such-domain"))
{
rsp->status = strdup("404 No such domain");
- rsp->reason = RSP_REASON_NO_SUCH_DOMAIN;
+ rsp->crunch_reason = NO_SUCH_DOMAIN;
}
else if (!strcmp(templatename, "forwarding-failed"))
{
}
rsp->status = strdup("503 Forwarding failure");
- rsp->reason = RSP_REASON_FORWARDING_FAILED;
+ rsp->crunch_reason = FORWARDING_FAILED;
}
else if (!strcmp(templatename, "connect-failed"))
{
rsp->status = strdup("503 Connect failed");
- rsp->reason = RSP_REASON_CONNECT_FAILED;
+ rsp->crunch_reason = CONNECT_FAILED;
}
else if (!strcmp(templatename, "connection-timeout"))
{
rsp->status = strdup("504 Connection timeout");
- rsp->reason = RSP_REASON_CONNECTION_TIMEOUT;
+ rsp->crunch_reason = CONNECTION_TIMEOUT;
}
else if (!strcmp(templatename, "no-server-data"))
{
rsp->status = strdup("502 No data received from server or forwarder");
- rsp->reason = RSP_REASON_NO_SERVER_DATA;
+ rsp->crunch_reason = NO_SERVER_DATA;
}
if (rsp->status == NULL)
strlen(cgi_error_memory_response->head);
cgi_error_memory_response->content_length =
strlen(cgi_error_memory_response->body);
- cgi_error_memory_response->reason = RSP_REASON_OUT_OF_MEMORY;
+ cgi_error_memory_response->crunch_reason = OUT_OF_MEMORY;
}
rsp->content_length = 0;
rsp->head_length = 0;
rsp->is_static = 0;
- rsp->reason = RSP_REASON_INTERNAL_ERROR;
+ rsp->crunch_reason = INTERNAL_ERROR;
snprintf(errnumbuf, sizeof(errnumbuf), "%d", error_to_report);
-const char filters_rcs[] = "$Id: filters.c,v 1.128 2010/04/03 13:23:28 fabiankeil Exp $";
+const char filters_rcs[] = "$Id: filters.c,v 1.129 2010/05/01 18:20:50 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/filters.c,v $
return cgi_error_memory();
}
}
- rsp->reason = RSP_REASON_BLOCKED;
+ rsp->crunch_reason = BLOCKED;
return finish_http_response(csp, rsp);
free_http_response(rsp);
return cgi_error_memory();
}
- rsp->reason = RSP_REASON_UNTRUSTED;
+ rsp->crunch_reason = UNTRUSTED;
return finish_http_response(csp, rsp);
}
free_http_response(rsp);
return cgi_error_memory();
}
- rsp->reason = RSP_REASON_REDIRECTED;
+ rsp->crunch_reason = REDIRECTED;
freez(new_url);
return finish_http_response(csp, rsp);
}
rsp->is_static = 1;
- rsp->reason = RSP_REASON_UNSUPPORTED;
+ rsp->crunch_reason = UNSUPPORTED;
return(finish_http_response(csp, rsp));
}
-const char jcc_rcs[] = "$Id: jcc.c,v 1.316 2010/04/23 11:53:48 fabiankeil Exp $";
+const char jcc_rcs[] = "$Id: jcc.c,v 1.317 2010/05/01 18:19:56 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/jcc.c,v $
return "Internal error while searching for crunch reason";
}
- switch (rsp->reason)
+ switch (rsp->crunch_reason)
{
- case RSP_REASON_UNSUPPORTED:
+ case UNSUPPORTED:
reason = "Unsupported HTTP feature";
break;
- case RSP_REASON_BLOCKED:
+ case BLOCKED:
reason = "Blocked";
break;
- case RSP_REASON_UNTRUSTED:
+ case UNTRUSTED:
reason = "Untrusted";
break;
- case RSP_REASON_REDIRECTED:
+ case REDIRECTED:
reason = "Redirected";
break;
- case RSP_REASON_CGI_CALL:
+ case CGI_CALL:
reason = "CGI Call";
break;
- case RSP_REASON_NO_SUCH_DOMAIN:
+ case NO_SUCH_DOMAIN:
reason = "DNS failure";
break;
- case RSP_REASON_FORWARDING_FAILED:
+ case FORWARDING_FAILED:
reason = "Forwarding failed";
break;
- case RSP_REASON_CONNECT_FAILED:
+ case CONNECT_FAILED:
reason = "Connection failure";
break;
- case RSP_REASON_OUT_OF_MEMORY:
+ case OUT_OF_MEMORY:
reason = "Out of memory (may mask other reasons)";
break;
- case RSP_REASON_CONNECTION_TIMEOUT:
+ case CONNECTION_TIMEOUT:
reason = "Connection timeout";
break;
- case RSP_REASON_NO_SERVER_DATA:
+ case NO_SERVER_DATA:
reason = "No server data received";
break;
default:
* Not supposed to happen. If it does
* anyway, treat it as an unknown error.
*/
- cgi_error_unknown(csp, rsp, RSP_REASON_INTERNAL_ERROR);
+ cgi_error_unknown(csp, rsp, INTERNAL_ERROR);
/* return code doesn't matter */
}
#ifndef PROJECT_H_INCLUDED
#define PROJECT_H_INCLUDED
/** Version string. */
-#define PROJECT_H_VERSION "$Id: project.h,v 1.154 2010/01/10 13:53:48 ler762 Exp $"
+#define PROJECT_H_VERSION "$Id: project.h,v 1.155 2010/04/12 16:51:31 fabiankeil Exp $"
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/project.h,v $
* the requested resource. Mostly ordered the way they are checked
* for in chat().
*/
-#define RSP_REASON_UNSUPPORTED 1
-#define RSP_REASON_BLOCKED 2
-#define RSP_REASON_UNTRUSTED 3
-#define RSP_REASON_REDIRECTED 4
-#define RSP_REASON_CGI_CALL 5
-#define RSP_REASON_NO_SUCH_DOMAIN 6
-#define RSP_REASON_FORWARDING_FAILED 7
-#define RSP_REASON_CONNECT_FAILED 8
-#define RSP_REASON_OUT_OF_MEMORY 9
-#define RSP_REASON_INTERNAL_ERROR 10
-#define RSP_REASON_CONNECTION_TIMEOUT 11
-#define RSP_REASON_NO_SERVER_DATA 12
+enum crunch_reason
+{
+ UNSUPPORTED,
+ BLOCKED,
+ UNTRUSTED,
+ REDIRECTED,
+ CGI_CALL,
+ NO_SUCH_DOMAIN,
+ FORWARDING_FAILED,
+ CONNECT_FAILED,
+ OUT_OF_MEMORY,
+ INTERNAL_ERROR,
+ CONNECTION_TIMEOUT,
+ NO_SERVER_DATA
+};
/**
* Response generated by CGI, blocker, or error handler
size_t content_length; /**< Length of body, REQUIRED if binary body. */
int is_static; /**< Nonzero if the content will never change and
should be cached by the browser (e.g. images). */
- int reason; /**< Why the response was generated in the first place. */
+ enum crunch_reason crunch_reason; /**< Why the response was generated in the first place. */
};
/**