/*
 * $Log: http,v $
 * Revision 1.5  1998/07/01 21:10:59  joseph
 * Added status window
 * Fixed persistent connections
 * Fixed magtags to only count processed url references
 * Fixed proxy_forunqualified, again.
 * Fixed leading/trailing spaces in urls...
 *
 * Revision 1.4  1998/06/16 18:29:40  joseph
 * Added recalculation of fetch portion for base href & redirections
 * Added processing of base href in fetch and rewrite
 * Moved file_truncate from rewrite to file
 * Logging of urls with unknown schemes
 * Errorlog file kept open across whole fetch
 * Log routines may handle effects of *close better.
 * Invalid chars in urls and hostnames replaced with ~'s on filesystem
 * Rewrite recovers from zero length log file
 * Removed permfail, softfail states as not used
 * Removed some unused bits from url structures
 * Changed proxy code to handle dotless hostnames okay.
 * Version to 0.06a.
 *
 * Revision 1.3  1998/06/05 22:55:27  joseph
 * URLs now moved to 'FETCHED' once they are fetched
 * Front end made proper
 * Added multiple fetch files + a menu in frontend
 * Fixed bugs with links containing url with spaces before them
 * Combined both makefilenames into one in misc.c
 * Added readtag and openfetch to http.
 * Keep FetchLog open for duration of fetch
 * Logfile now contains links to the orignal pages too
 * Added url_handled, returns true if the url is one we know how to fetch
 * Added shift to fetch without rewriting, and adjust to dump all flex
 * lists to files. (#define URLDUMP)
 * Frontend animation now updates every 0.5 secs, and has new rewrite icon
 * Added stopping / aborting of fetch / rewrite
 *
 * Revision 1.2  1998/05/27 22:41:04  joseph
 * Added *httpfetch[]
 *
 * Revision 1.1.1.1  1997/12/29 14:37:55  jogu
 * WebGet Initial CMS Ver
 *
 */

#ifndef HTTP_H
#define HTTP_H

#include "config.h" /* conf_followlinks */
int http_init(int no, int retry);
int http_pollsess(int no, int error);
int http_recalcfetchportion( const char *newurl, const char *oldurl, int oldp );
int http_calcfetchportion( const char *url, conf_followlinks links );

int http_openlog( void );
void http_abort( int /*no*/ );
void http_closelog( void );
void http_zerocounts( void );

#ifdef STRUCT_H
/* hacky. pah */
extern httpfetch_t *httpfetch[];
#endif

extern int http_bytesrxed; /* updated in here */
extern int http_waiting; /* updated in url.c */
extern int http_fetched; /* update in url.c */
extern int http_fetching; /* update in fetch.c, (mainly?) */

#endif
