Raised This Month: $51 Target: $400
 12% 

[EXTENSION] cURL & Hash


Post New Thread Reply   
 
Thread Tools Display Modes
Penetal
Junior Member
Join Date: May 2006
Old 06-30-2016 , 15:11   Re: [EXTENSION] cURL & Hash
Reply With Quote #181

I got the same crap when I tried some of them. I don't remember who it was that uploaded this (got it from somewhere in this thread), but it works for me when I get this error

Code:
 [SM] Unable to load extension "curl.ext": /path/to/csgo/addons/sourcemod/extensions/curl.ext.so: undefined symbol: _ZNSs9_M_mutateEjjj
Just download the extension and replace the one you currently have, hope it works for you too.
Attached Files
File Type: so curl.ext.so (2.66 MB, 941 views)
__________________
Yo, was up?
Penetal is offline
Send a message via MSN to Penetal
Bara
AlliedModders Donor
Join Date: Apr 2012
Location: Germany
Old 07-09-2016 , 12:26   Re: [EXTENSION] cURL & Hash
Reply With Quote #182

For all who are too lazy:
https://forums.alliedmods.net/showpo...&postcount=101
__________________
Discord (Bara#5006) | My Plugins (GitHub)
You like my work? Support is not a crime.
Bara is offline
dubbeh
Senior Member
Join Date: Jul 2007
Old 08-29-2016 , 19:32   Re: [EXTENSION] cURL & Hash
Reply With Quote #183

Made a small update to the include files and example plugin for new decals, that I thought others might find useful (even if the plugin is kind of abandoned).

Know that this plugin has bugs/exploits which are easy to utilise and avoid doing anything SSL/TLS related (At least on the windows compile. Think bara used the latest OpenSSL library? which should be a bit safer but not 100%).
Attached Files
File Type: zip curl_updated_inc.zip (25.3 KB, 732 views)
__________________
SM Plugins - dubbeh.net - Plugin requests are welcome
dubbeh is offline
AbraCadabra
Member
Join Date: Aug 2013
Old 09-02-2016 , 04:06   Re: [EXTENSION] cURL & Hash
Reply With Quote #184

I've got error:
Quote:
[SM] Unable to load extension "curl.ext": error code 000036b1
Anybody can help? Logs says plugin not installed but it installed! It work before but after recent updates it doesn't work anymore. Compile new build for windows please.
AbraCadabra is offline
dubbeh
Senior Member
Join Date: Jul 2007
Old 09-03-2016 , 03:07   Re: [EXTENSION] cURL & Hash
Reply With Quote #185

I had something similiar then launched ok the second time, which was strange.

This is under windows 10 using CS:GO with SourceMod 1.8.

Quick bit of advice too. Is this an ok method to update local files from a server? First initial attempt using CURL, based around a few examples.
Code:
/*
 * SourceMod Radio
 *
 * Adds a radio player to SourceMod that supports direct station links or streaming audio
 *
 * Coded by dubbeh - www.dubbeh.net
 *
 * Licensed under the GPLv3
 *
*/


void UpdateShoutcastStationsList ()
{
    if (g_iUpdaterTypeAvail == UPDATER_TYPE_CURL)
    {
        UpdateUsingCURL();
    }
}

/* Updater using CURL API functions */
void UpdateUsingCURL ()
{
    Handle hConnection = INVALID_HANDLE;
    char szLocalPath[PLATFORM_MAX_PATH+1];
    Handle hUpdateCheckTempFile = INVALID_HANDLE;
    
    hConnection = curl_easy_init();
    if (hConnection != INVALID_HANDLE)
    {
        BuildPath(Path_SM, szLocalPath, sizeof(szLocalPath), "configs/%s", g_szPlayListVersionTempFile);
        hUpdateCheckTempFile = curl_OpenFile(szLocalPath, "w");
        CURL_DEFAULT_OPT(hConnection);
        curl_easy_setopt_handle(hConnection, CURLOPT_WRITEDATA, hUpdateCheckTempFile);
        curl_easy_setopt_string(hConnection, CURLOPT_URL, g_szShoutCastVersionURL);
        curl_easy_perform_thread(hConnection, OnVersionCheckComplete, hUpdateCheckTempFile);
    }
}

public void OnVersionCheckComplete(Handle hndl, CURLcode code, any hUpdateCheckTempFile)
{
    char szLocalPath[PLATFORM_MAX_PATH + 1];
    File hFile = null;
    Handle hConnection = INVALID_HANDLE;
    int iFileSize = 0;
    char szTempBuffer[64];
    
    // Free up the connection and file handle(s)
    if (hndl != INVALID_HANDLE)
        CloseHandle(hndl);
    if (hUpdateCheckTempFile != INVALID_HANDLE)
        CloseHandle(hUpdateCheckTempFile);
    
    if (code == CURLE_OK)
    {
        // Lets open the temp version file
        BuildPath(Path_SM, szLocalPath, sizeof(szLocalPath), "configs/%s", g_szPlayListVersionTempFile);
        iFileSize = FileSize(szLocalPath);
        if (iFileSize != -1 && iFileSize > 0)
        {
            hFile = OpenFile(szLocalPath, "r");
            if (hFile != INVALID_HANDLE)
            {
                hFile.ReadLine(szTempBuffer, sizeof (szTempBuffer));
                hFile.Close();
                DeleteFile(szLocalPath);
                
                // Check current playlist against web playlist version
                if (StringToInt(szTempBuffer) > g_iShoutCastPlaylistVersion)
                {
                    // Assume we need to update the playlist
                    hConnection = curl_easy_init();
                    if (hConnection != INVALID_HANDLE)
                    {
                        BuildPath(Path_SM, szLocalPath, sizeof(szLocalPath), "configs/%s", g_szPlayListTempFile);
                        hUpdateCheckTempFile = curl_OpenFile(szLocalPath, "w");
                        CURL_DEFAULT_OPT(hConnection);
                        curl_easy_setopt_handle(hConnection, CURLOPT_WRITEDATA, hUpdateCheckTempFile);
                        curl_easy_setopt_string(hConnection, CURLOPT_URL, g_szPlayListTempFile);
                        curl_easy_perform_thread(hConnection, OnPlaylistDownloadComplete, hUpdateCheckTempFile);
                    }
                }
            }
        } else {
            LogMessage("[SM-RADIO] Unable to find the temp playlist version file or corrupted.");
        }
    } else {
        LogMessage("[SM-RADIO] Error checking the online ShoutCast playlist version. Maybe the website is down?");
    }
}

public void OnPlaylistDownloadComplete (Handle hndl, CURLcode code, any hPlaylistFile)
{
    char szTempPlaylist[PLATFORM_MAX_PATH + 1];
    char szPlaylist[PLATFORM_MAX_PATH + 1];
    
    // Free up the connection and file handle(s)
    if (hndl != INVALID_HANDLE)
        CloseHandle(hndl);
    if (hPlaylistFile != INVALID_HANDLE)
        CloseHandle(hPlaylistFile);
    
    if (code == CURLE_OK)
    {
        // Overwrite the old playlist file with the new one
        BuildPath(Path_SM, szPlaylist, sizeof(szPlaylist), "configs/%s", g_szRadioStationsShoutCastBaseFile);
        DeleteFile(szPlaylist);
        
        BuildPath(Path_SM, szTempPlaylist, sizeof(szTempPlaylist), "configs/%s", g_szPlayListTempFile);
        RenameFile(szPlaylist, szTempPlaylist);
        
        CPrintToChatAll("[SM-RADIO] ShoutCast station list updated. Please reload the map to apply changes.");
        LogMessage("[SM-RADIO] ShoutCast station list updated. Please reload the map to apply changes.");
    } else {
        LogMessage("[SM-RADIO] Error downloading the latest ShoutCast playlist. Maybe the website is down?");
    }
}

/* TODO: Updater using SteamWorks API Functions */

/* TODO: Updater using Sockets API Functions */


CURL default options:
Code:
int CURL_Default_opt[][2] = {
#if USE_THREAD
    {view_as<int>(CURLOPT_NOSIGNAL),1},
#endif
    {view_as<int>(CURLOPT_NOPROGRESS),1},
    {view_as<int>(CURLOPT_TIMEOUT),30},
    {view_as<int>(CURLOPT_CONNECTTIMEOUT),60},
    {view_as<int>(CURLOPT_VERBOSE),0}
};


Any recommendations to improve or potential bugs?
__________________
SM Plugins - dubbeh.net - Plugin requests are welcome

Last edited by dubbeh; 09-03-2016 at 03:25.
dubbeh is offline
simste
New Member
Join Date: Sep 2016
Old 09-06-2016 , 12:42   Re: [EXTENSION] cURL & Hash
Reply With Quote #186

I have an issue with this extension. When I try to perform threaded HTTP POST request, it never returns a callback (or should I call it forward). Even though my server definitely sends a response. I guess, that's the reason why self tests (except very first one) don't pass. And can't really do anything else with it.
Have tried both on Ubuntu 14.04 and Windows 10 using CS:GO with SM 1.7 and 1.8 - the outcome is the very same.
Maybe someone have come across this issues and was able to solve it? Thank you in advance.

One more weird thing, I've wrote simple script using this cURL extension. If there was PrintToServer method called before dispatching a request, requests get sent (but with the very same message I wrote to server). If I remove PrintToServer, requests aren't sent anymore. Seems like it's leaking. It might be my programming mistake - haven't done anything with SourcePawn before.\

Maybe someone could recommend any working up-to-date alternative for making HTTP Post requests? Haven't gotten to much luck neither with cURL nor with Sockets.
simste is offline
dubbeh
Senior Member
Join Date: Jul 2007
Old 09-07-2016 , 00:38   Re: [EXTENSION] cURL & Hash
Reply With Quote #187

I've switched over to SteamWorks - https://forums.alliedmods.net/showthread.php?t=229556 - Only potential downside is that the updater by GoD-Tony seems to break using it.

For documentation on the API functions check out the hl2sdk depot, specifically the isteamhttp.h - https://github.com/alliedmodders/hl2...m/isteamhttp.h
__________________
SM Plugins - dubbeh.net - Plugin requests are welcome
dubbeh is offline
exc4libur
Member
Join Date: Oct 2015
Old 10-17-2016 , 10:46   Re: [EXTENSION] cURL & Hash
Reply With Quote #188

Hello,

i have tried to run cURL for teasyftp, but i don't get it working. I use SM1.8 and the version of BARA and get following error when i want to compile curl_self_test.

Code:
//SourceMod Batch Compiler
// by the SourceMod Dev Team


//// curl_self_test.sp
//
// C:\Users\Christian\Desktop\WORKING DIR\SourceMod\SourceMod Scripting\PUG Setup Comiler\addons\sourcemod\scripting\curl_self_test.sp(349) : error 178: cannot coerce char[] to any[]; storage classes differ
// C:\Users\Christian\Desktop\WORKING DIR\SourceMod\SourceMod Scripting\PUG Setup Comiler\addons\sourcemod\scripting\curl_self_test.sp(366) : error 178: cannot coerce char[] to any[]; storage classes differ
// C:\Users\Christian\Desktop\WORKING DIR\SourceMod\SourceMod Scripting\PUG Setup Comiler\addons\sourcemod\scripting\curl_self_test.sp(382) : error 178: cannot coerce char[] to any[]; storage classes differ
// C:\Users\Christian\Desktop\WORKING DIR\SourceMod\SourceMod Scripting\PUG Setup Comiler\addons\sourcemod\scripting\curl_self_test.sp(385) : error 178: cannot coerce char[] to any[]; storage classes differ
// C:\Users\Christian\Desktop\WORKING DIR\SourceMod\SourceMod Scripting\PUG Setup Comiler\addons\sourcemod\scripting\curl_self_test.sp(404) : error 178: cannot coerce char[] to any[]; storage classes differ
// C:\Users\Christian\Desktop\WORKING DIR\SourceMod\SourceMod Scripting\PUG Setup Comiler\addons\sourcemod\scripting\curl_self_test.sp(421) : error 178: cannot coerce char[] to any[]; storage classes differ
// C:\Users\Christian\Desktop\WORKING DIR\SourceMod\SourceMod Scripting\PUG Setup Comiler\addons\sourcemod\scripting\curl_self_test.sp(446) : error 178: cannot coerce char[] to any[]; storage classes differ
// C:\Users\Christian\Desktop\WORKING DIR\SourceMod\SourceMod Scripting\PUG Setup Comiler\addons\sourcemod\scripting\curl_self_test.sp(467) : error 178: cannot coerce char[] to any[]; storage classes differ
// C:\Users\Christian\Desktop\WORKING DIR\SourceMod\SourceMod Scripting\PUG Setup Comiler\addons\sourcemod\scripting\curl_self_test.sp(468) : error 178: cannot coerce char[] to any[]; storage classes differ
//
// 9 Errors.
//
// Compilation Time: 0,2 sec
// ----------------------------------------

// File not found.

Press enter to exit ...
There are a lot of post here with the same error, but no real solution. I wanted to test this because teasyftp quits with following error.

Code:
L 10/17/2016 - 15:26:43: [tEasyFTP.smx] Failed uploading myrisk_9005_de_dust2_2016-10-17_15_hans_vs_wurst.dem (Upload failed (at start/before it took off)).
Perhaps someone has a solution for this. I tried different ftp logins, but error is always the same.

Best regards
Christian
exc4libur is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 10-17-2016 , 10:51   Re: [EXTENSION] cURL & Hash
Reply With Quote #189

You need an updated include file for SM 1.7+, there is one 5 posts up...
__________________
asherkin is offline
binekoto
New Member
Join Date: Oct 2016
Location: Türkiye
Old 10-20-2016 , 07:10   Re: [EXTENSION] cURL & Hash
Reply With Quote #190

Hi guys,
Do you suggest the best method of data extraction which one? except curl?
__________________
binekoto is offline
Send a message via Skype™ to binekoto
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 09:21.


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