This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

[EXTENSION] cURL & Hash


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
LaMuerteInHell
Junior Member
Join Date: Apr 2011
Old 10-03-2014 , 10:40   Re: [EXTENSION] cURL & Hash
Reply With Quote #1

Hehe, I'm running on Windows7 and I couldn't get cURL to work even though I thought I had installed Microsoft Visual C++ 2005 Service Pack 1 Redistributable Package MFC Security Update. Turns out I hadn't even installed Microsoft Visual C++ 2005 itself. After installing that I ran the MFC Security Update listed on the first post and now it works. *facepalm*
LaMuerteInHell is offline
unrealized
New Member
Join Date: Jun 2012
Old 10-05-2014 , 20:06   Re: [EXTENSION] cURL & Hash
Reply With Quote #2

Source: https://bara.in/curl_src.tar

Binary compiled and confirmed working on debian7 wheezy x64: https://www.dropbox.com/s/53fsww10du...rl.ext.so?dl=0
unrealized is offline
deadlyruler
Member
Join Date: Dec 2008
Old 11-04-2014 , 20:08   Re: [EXTENSION] cURL & Hash
Reply With Quote #3

Hello,

I have a small issue. I am using curl_hash_file to check the md5 hash of files in a directory. After about 462 (+/- 1, but pretty consistent at 462) calls to curl_hash_file, the callback not come back after that.

After that when I attempt to reload the plugin to run curl_hash_file again, only 1 call will come back, and the second will hang. If reloading the plugin again, even the first call will not come back.

The calls to curl_hash_file are made 1 by 1, after the callback returns, the next curl_hash_file is run.

Unfortunately reloading the curl extension is not possible due to this error upon reloading:
[SM] Extension curl.ext.so failed to reload: Could not create CURL Slist type (err: 10)

I'm running the server on Ubuntu 14.04

Any help would be appreciated

Edit: It seems after running 300+ curl_hash_file calls and then letting the server run for a few minutes, the server will crash with
Quote:
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
./srcds_run: line 324: 17051 Aborted (core dumped) $HL_CMD
I'm going to assume it is not my plugin causing this because it simply runs curl_hash_file function on a loop.

This occurred on one of my servers that is running on CentOS 64bit VPS. When this plugin was tested on servers that were being run from a dedicated server, they didn't seem to crash.

I will be staying away from it for now since it seems to be causing adverse effects.

Last edited by deadlyruler; 11-04-2014 at 21:06.
deadlyruler is offline
pTu
Senior Member
Join Date: Nov 2010
Location: Poland
Old 01-05-2015 , 20:10   Re: [EXTENSION] cURL & Hash
Reply With Quote #4

I have a problem with code

PHP Code:
curl curl_easy_init();
    if(
curl != INVALID_HANDLE)
    {
        
CURL_DEFAULT_OPT(curl);
        
curl_easy_setopt_string(curlCURLOPT_URL"http://domain.com/curl.php");
        
curl_easy_send_recv(curlsend_callbackmyFunctionsend_recv_complete_callbackSendRecv_Act_GOTO_SEND20001000AUTH_RESPONSE_BUFFER_SIZE);

        
PrintToServer("curl_easy_init");
    } 
In console command is printed curl_easy_init so Curl works good I think. But Why are not invoked methods send_callback, myFunction and send_recv_complete_callback?
pTu is offline
raydan
Senior Member
Join Date: Aug 2006
Old 12-12-2014 , 05:26   Re: [EXTENSION] cURL & Hash
Reply With Quote #5

people create many threads in linux by using "curl_hash_file" or "curl_easy_perform_thread"
may be "ulimit" problem
try increase "ulimit" value
raydan is offline
Yuera
SourceMod Donor
Join Date: Jan 2013
Old 01-03-2015 , 13:27   Re: [EXTENSION] cURL & Hash
Reply With Quote #6

SourcePawn Compiler 1.7.0-dev+5112
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2014 AlliedModders LLC

curl_self_test.sp(349) : error 178: cannot coerce char[] to any[]; storage classes differ
curl_self_test.sp(366) : error 178: cannot coerce char[] to any[]; storage classes differ
curl_self_test.sp(382) : error 178: cannot coerce char[] to any[]; storage classes differ
curl_self_test.sp(385) : error 178: cannot coerce char[] to any[]; storage classes differ
curl_self_test.sp(404) : error 178: cannot coerce char[] to any[]; storage classes differ
curl_self_test.sp(421) : error 178: cannot coerce char[] to any[]; storage classes differ
curl_self_test.sp(446) : error 178: cannot coerce char[] to any[]; storage classes differ
curl_self_test.sp(467) : error 178: cannot coerce char[] to any[]; storage classes differ
curl_self_test.sp(468) : error 178: cannot coerce char[] to any[]; storage classes differ

9 Errors.

Last edited by Yuera; 01-03-2015 at 13:28.
Yuera is offline
enHanced
Junior Member
Join Date: Mar 2015
Old 04-01-2015 , 12:59   Re: [EXTENSION] cURL & Hash
Reply With Quote #7

Quote:
Originally Posted by Yuera View Post
SourcePawn Compiler 1.7.0-dev+5112
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2014 AlliedModders LLC

curl_self_test.sp(349) : error 178: cannot coerce char[] to any[]; storage classes differ
curl_self_test.sp(366) : error 178: cannot coerce char[] to any[]; storage classes differ
curl_self_test.sp(382) : error 178: cannot coerce char[] to any[]; storage classes differ
curl_self_test.sp(385) : error 178: cannot coerce char[] to any[]; storage classes differ
curl_self_test.sp(404) : error 178: cannot coerce char[] to any[]; storage classes differ
curl_self_test.sp(421) : error 178: cannot coerce char[] to any[]; storage classes differ
curl_self_test.sp(446) : error 178: cannot coerce char[] to any[]; storage classes differ
curl_self_test.sp(467) : error 178: cannot coerce char[] to any[]; storage classes differ
curl_self_test.sp(46 : error 178: cannot coerce char[] to any[]; storage classes differ

9 Errors.
Same here - how to fix this ?
enHanced is offline
Bara
AlliedModders Donor
Join Date: Apr 2012
Location: Germany
Old 04-01-2015 , 13:10   Re: [EXTENSION] cURL & Hash
Reply With Quote #8

Quote:
Originally Posted by enHanced View Post
Same here - how to fix this ?
https://forums.alliedmods.net/showpo...&postcount=129
__________________
Discord (Bara#5006) | My Plugins (GitHub)
You like my work? Support is not a crime.
Bara is offline
painkiller
Senior Member
Join Date: Jun 2011
Old 05-15-2015 , 16:37   Re: [EXTENSION] cURL & Hash
Reply With Quote #9

hi, i have this problem in Black Mesa Source

SM] Unable to load extension "curl.ext": /home/gameserver/server/bms/bms/addons/sourcemod/extensions/curl.ext.so: undefined symbol: _ZNSs9_M_mutateEjjj
painkiller is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 01-07-2015 , 22:42   Re: [EXTENSION] cURL & Hash
Reply With Quote #10

If you're using this extension on Linux, please consider testing SourceMod 1.6.4-dev+4620, 1.7.0-dev+5125, 1.8.0-dev+5143 or newer. It hopefully fixes a nasty bug with leaking threads that this extension triggers.
__________________
asherkin is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 13:21.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode