From 9203dd001f1e03fae48b9a8a35c18e7cc8a115ab Mon Sep 17 00:00:00 2001 From: Fish <> Date: Wed, 5 Mar 2008 08:12:49 +0000 Subject: [PATCH] Win32 fixes... Fix Curl Transfers Fix USE_PERL not being defined for modules.c Make the Console show on this version as I'm not convinced how stable NeoStats on Win32 is atm the moment. --- include/configwin32.h | 2 +- src/commands.c | 6 +++--- src/modules.c | 2 +- src/neostats.vcproj | 6 +++--- src/transfer.c | 14 ++++++++++++++ src/win32/winmain.c | 2 +- 6 files changed, 23 insertions(+), 9 deletions(-) diff --git a/include/configwin32.h b/include/configwin32.h index 27255f93..c469b6a7 100644 --- a/include/configwin32.h +++ b/include/configwin32.h @@ -12,7 +12,7 @@ /* 'Enable Debugging' */ /* #undef DEBUG */ #define DEBUG - +#define USE_PERL /* Set to explicitly specify we don't want to use thread-safe functions in curl */ /* #undef DISABLED_THREADSAFE */ diff --git a/src/commands.c b/src/commands.c index 0f05f35b..2b89cd1a 100644 --- a/src/commands.c +++ b/src/commands.c @@ -339,7 +339,7 @@ void del_bot_cmd( hash_t *cmd_hash, const bot_cmd *cmd_ptr ) { dlog( DEBUG3, "deleting command %s from services bot", ( ( bot_cmd* )hnode_get( cmdnode ) )->cmd ); hash_delete_destroy_node( cmd_hash, cmdnode ); -#if USE_PERL +#ifdef USE_PERL if (IS_PERL_MOD(cmd_ptr->modptr)) { ns_free(cmd_ptr->cmd); @@ -865,7 +865,7 @@ static int bot_cmd_about( const CmdParams *cmdparams ) if( IS_STANDARD_MOD( cmdparams->bot->moduleptr ) ) { irc_prefmsg_list( cmdparams->bot, cmdparams->source, cmdparams->bot->moduleptr->info->about_text ); -#if USE_PERL +#ifdef USE_PERL } else { @@ -901,7 +901,7 @@ static int bot_cmd_credits( const CmdParams *cmdparams ) { irc_prefmsg_list( cmdparams->bot, cmdparams->source, cmdparams->bot->moduleptr->info->copyright ); -#if USE_PERL +#ifdef USE_PERL } else { diff --git a/src/modules.c b/src/modules.c index 0595c81f..0c353487 100644 --- a/src/modules.c +++ b/src/modules.c @@ -620,7 +620,7 @@ int unload_module( const char *modname, Client * u ) RESET_RUN_LEVEL(); SET_SEGV_LOCATION(); } -#if USE_PERL +#ifdef USE_PERL } else { SET_RUN_LEVEL( mod_ptr ); PerlModFini( mod_ptr ); diff --git a/src/neostats.vcproj b/src/neostats.vcproj index cb3131d7..f066a40e 100644 --- a/src/neostats.vcproj +++ b/src/neostats.vcproj @@ -395,7 +395,7 @@ Name="VCCLCompilerTool" ExecutionBucket="6" AdditionalIncludeDirectories="C:\Perl\lib\CORE;..\include;..\lib\curl;..\lib\pcre;win32;..\lib\event" - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;NEOSTATSCORE;DLL_EXPORT;HAVE_CONFIG_H;CURL_STATICLIB;USE_PERL" + PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;NEOSTATSCORE;DLL_EXPORT;HAVE_CONFIG_H;CURL_STATICLIB" RuntimeLibrary="0" UsePrecompiledHeader="0" WarningLevel="3" @@ -975,11 +975,11 @@ > curleasyhandle, CURLOPT_FORBID_REUSE, 1)) != 0) { + nlog(LOG_WARNING, "Curl Set forbid reuse failed. Returned %d for url %s", ret, url); + nlog(LOG_WARNING, "Error Was: %s", newtrans->curlerror); + curl_easy_cleanup(newtrans->curleasyhandle); + ns_free(newtrans); + return NS_FAILURE; + } + /* setup no signals... */ if ((ret = curl_easy_setopt(newtrans->curleasyhandle, CURLOPT_NOSIGNAL, 1)) != 0) { nlog(LOG_WARNING, "Curl Set nosignal failed. Returned %d for url %s", ret, url); @@ -526,15 +536,19 @@ int curl_socket_event_callback(CURL *easy, curl_socket_t s, int action, void *us case CURL_POLL_NONE: case CURL_POLL_IN: UpdateSock(sock, EV_READ|EV_PERSIST, 1, NULL); + dlog(DEBUG2, "CurlSock READ %d %d", EV_READ|EV_PERSIST, action); break; case CURL_POLL_OUT: UpdateSock(sock, EV_WRITE|EV_PERSIST, 1, NULL); + dlog(DEBUG2, "CurlSock write %d %d", EV_WRITE|EV_PERSIST, action); break; case CURL_POLL_INOUT: UpdateSock(sock, EV_READ|EV_WRITE|EV_PERSIST, 1, NULL); + dlog(DEBUG2, "CurlSock INOUT %d %d", EV_READ|EV_WRITE|EV_PERSIST, action); break; case CURL_POLL_REMOVE: UpdateSock(sock, 0, 1, NULL); + dlog(DEBUG2, "CurlSock RM %d %d", 0, action); break; } diff --git a/src/win32/winmain.c b/src/win32/winmain.c index eac02980..acf1db63 100755 --- a/src/win32/winmain.c +++ b/src/win32/winmain.c @@ -46,7 +46,7 @@ static HMENU hTrayPopMenu; static POINT TrayPoint; static char szConfigFileName[ MAX_PATH ]; - +#undef NDEBUG #ifndef NDEBUG static void InitDebugConsole( void ) {