-const char parsers_rcs[] = "$Id: parsers.c,v 1.108 2007/08/28 18:21:03 fabiankeil Exp $";
+const char parsers_rcs[] = "$Id: parsers.c,v 1.109 2007/09/08 14:25:48 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/parsers.c,v $
*
* Revisions :
* $Log: parsers.c,v $
+ * Revision 1.109 2007/09/08 14:25:48 fabiankeil
+ * Refactor client_referrer() and add conditional-forge parameter.
+ *
* Revision 1.108 2007/08/28 18:21:03 fabiankeil
* A bunch of whitespace fixes, pointy hat to me.
*
NULL
};
-
const add_header_func_ptr add_server_headers[] = {
connection_close_adder,
NULL
* The number of bytes to skip should be positive
* and we'd like to stay in the buffer.
*/
- if((skip_bytes < 0) || (skip_bytes >= (csp->iob->eod - cur)))
+ if ((skip_bytes < 0) || (skip_bytes >= (csp->iob->eod - cur)))
{
log_error(LOG_LEVEL_ERROR,
"Unreasonable amount of bytes to skip (%d). Stopping decompression",
struct list_entry *h; /* Header */
jb_err err = JB_ERR_OK;
- log_error(LOG_LEVEL_HEADER, "scanning headers for: %s", csp->http->url);
-
for (h = csp->headers->first; (err == JB_ERR_OK) && (h != NULL) ; h = h->next)
{
/* Header crunch()ed in previous run? -> ignore */
* As a side effect it frees the space used by the original
* header lines.
*
+ * XXX: should be split to remove the first_run hack.
+ *
* Parameters :
* 1 : pats = list of patterns to match against headers
* 2 : more_headers = list of functions to add more
/* RegEx failure */
log_error(LOG_LEVEL_ERROR, "Filtering \'%s\' with \'%s\' didn't work out: %s",
*header, b->name, pcrs_strerror(matches));
- if( newheader != NULL)
+ if (newheader != NULL)
{
log_error(LOG_LEVEL_ERROR, "Freeing what's left: %s", newheader);
freez(newheader);
return JB_ERR_OK;
}
+
/*********************************************************************
*
* Function : crunch_server_header
return JB_ERR_OK;
}
+
/*********************************************************************
*
* Function : server_content_disposition
return (*header == NULL) ? JB_ERR_MEMORY : JB_ERR_OK;
}
+
/*********************************************************************
*
* Function : server_last_modified
return JB_ERR_MEMORY;
}
- if(LOG_LEVEL_HEADER & debug) /* Save cycles if the user isn't interested. */
+ if (LOG_LEVEL_HEADER & debug) /* Save cycles if the user isn't interested. */
{
days = rtime / (3600 * 24);
hours = rtime / 3600 % 24;
return (*header == NULL) ? JB_ERR_MEMORY : JB_ERR_OK;
}
+
/*********************************************************************
*
* Function : client_ua
return JB_ERR_OK;
}
+
/*********************************************************************
*
* Function : client_if_modified_since
else
{
rtime = strtol(newval, &endptr, 0);
- if(rtime)
+ if (rtime)
{
log_error(LOG_LEVEL_HEADER, "Randomizing: %s (random range: %d minut%s)",
*header, rtime, (rtime == 1 || rtime == -1) ? "e": "es");
- if(rtime < 0)
+ if (rtime < 0)
{
rtime *= -1;
negative = 1;
return JB_ERR_MEMORY;
}
- if(LOG_LEVEL_HEADER & debug) /* Save cycles if the user isn't interested. */
+ if (LOG_LEVEL_HEADER & debug) /* Save cycles if the user isn't interested. */
{
hours = rtime / 3600;
minutes = rtime / 60 % 60;
return JB_ERR_OK;
}
+
/*********************************************************************
*
* Function : client_if_none_match
return JB_ERR_OK;
}
+
/*********************************************************************
*
* Function : client_x_filter
}
#endif /* def FEATURE_FORCE_LOAD */
+
/*********************************************************************
*
* Function : parse_header_time
}
+
/*********************************************************************
*
* Function : get_destination_from_headers