ErikMinekus / sm-ripext

SourceMod REST in Pawn Extension
https://forums.alliedmods.net/showthread.php?t=298024
GNU General Public License v3.0
133 stars 38 forks source link

PUT Request Error: `necessary data rewind wasn't possible` #72

Open martindines opened 2 years ago

martindines commented 2 years ago

Hi guys

I am using REST In Pawn to relay game data to a HTTP Server and while it works flawlessly 99% of the time, I have recorded an error that I have been struggling to diagnose: necessary data rewind wasn't possible

The error occurs infrequently and I have not been able to recreate. I believe it is connection related as the same data can be successfully sent at a later time. The PUT request is not received by the HTTP Server.

I am creating a standard PUT request using the following pseudo code:

HTTPRequest request = new HTTPRequest(url);

JSONObject payload = new JSONObject();
payload.SetInt("state", 1);

DataPack pack = new DataPack();

request.Put(payload, Api_GenericResponseHandler, pack);

...

public void Api_GenericResponseHandler(HTTPResponse response, DataPack pack, const char[] sError)
{
    if(!StrEqual(sError, "")) {
        Log(sError);
    }
}

Corresponding log entry

L 06/10/2022 - 11:08:28: necessary data rewind wasn't possible

I've dug through the curl-library archives and found a thread describing this error but it is beyond my level of expertise.

Is this an error you have come across before? Let me know if you require any more information, or have any tips for how I can further debug the issue, thanks!

Martin