evhttp_add_header(struct evkeyvalq *headers,
const char *key, const char *value)
{
- struct evkeyval *header;
+ struct evkeyval *header = NULL;
+
+ event_debug(("%s: key: %s val: %s\n", __func__, key, value));
- if (strchr(value, "\r") != NULL || strchr(value, "\n") != NULL) {
+ if (strchr(value, '\r') != NULL || strchr(value, '\n') != NULL) {
/* drop illegal headers */
+ event_debug(("%s: dropping illegal header\n"));
return (-1);
}
{
const char *what = "This is funny";
+ if (req == NULL) {
+ fprintf(stderr, "FAILED (timeout)\n");
+ exit(1);
+ }
+
if (req->response_code != HTTP_OK) {
fprintf(stderr, "FAILED (response code)\n");