Index: htdig/htdig.cc =================================================================== RCS file: /cvsroot/htdig/htdig/htdig/htdig.cc,v retrieving revision 1.28 diff -3 -u -p -r1.28 htdig.cc --- htdig/htdig.cc 1 Feb 2002 22:49:29 -0000 1.28 +++ htdig/htdig.cc 1 Feb 2003 13:04:48 -0000 @@ -32,6 +32,7 @@ //////////////////////////// #include "HtCookieJar.h" #include "HtCookieMemJar.h" +#include "HtCookieInFileJar.h" #include "HtHTTP.h" //////////////////////////// @@ -216,6 +217,29 @@ int main(int ac, char **av) } } + // Imports the cookies file + const String CookiesInputFile = config->Find("cookies_input_file"); + if (CookiesInputFile.length()) + { + if (debug>0) + cout << "Importing Cookies input file " + << CookiesInputFile << endl; + + int result; + HtCookieInFileJar* cookie_file = new HtCookieInFileJar(CookiesInputFile, result); + if (!result) + { + if (debug>0) + cookie_file->ShowSummary(); + delete _cookie_jar; // Deletes previous cookie jar + _cookie_jar = new HtCookieMemJar(*cookie_file); // copies the imported one + HtHTTP::SetCookieJar((HtCookieJar *)_cookie_jar); // and set the new HTTP jar + delete cookie_file; + } + else + cout << "Warning: Import failed! (" << CookiesInputFile << ")" << endl; + } + // // If needed, we will create a list of every URL we come across. //