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.
This commit is contained in:
Fish 2008-03-05 08:12:49 +00:00
parent 74965c2d6d
commit 9203dd001f
6 changed files with 23 additions and 9 deletions

View file

@ -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 */

View file

@ -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
{

View file

@ -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 );

View file

@ -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 @@
>
</File>
<File
RelativePath="..\..\src\win32\resource.h"
RelativePath=".\win32\resource.h"
>
</File>
<File
RelativePath=".\win32\resource.h"
RelativePath="..\..\src\win32\resource.h"
>
</File>
<File

View file

@ -248,6 +248,16 @@ int new_transfer(char *url, char *params, NS_TRANSFER savetofileormemory, char *
return NS_FAILURE;
}
#endif
/* dont reuse any connections to the server. This causes havoc with out socket code */
if ((ret = curl_easy_setopt(newtrans->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;
}

View file

@ -46,7 +46,7 @@ static HMENU hTrayPopMenu;
static POINT TrayPoint;
static char szConfigFileName[ MAX_PATH ];
#undef NDEBUG
#ifndef NDEBUG
static void InitDebugConsole( void )
{