{"action":"created","issue":{"url":"https://api.github.com/repos/Southclaws/pawn-requests/issues/6","repository_url":"https://api.github.com/repos/Southclaws/pawn-requests","labels_url":"https://api.github.com/repos/Southclaws/pawn-requests/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/Southclaws/pawn-requests/issues/6/comments","events_url":"https://api.github.com/repos/Southclaws/pawn-requests/issues/6/events","html_url":"https://github.com/Southclaws/pawn-requests/issues/6","id":327365654,"number":6,"title":"Server Crash on error occured - OnRequestFailure callback issue","user":{"login":"JohnMagdy","id":19735243,"avatar_url":"https://avatars1.githubusercontent.com/u/19735243?v=4","gravatar_id":"","url":"https://api.github.com/users/JohnMagdy","html_url":"https://github.com/JohnMagdy","followers_url":"https://api.github.com/users/JohnMagdy/followers","following_url":"https://api.github.com/users/JohnMagdy/following{/other_user}","gists_url":"https://api.github.com/users/JohnMagdy/gists{/gist_id}","starred_url":"https://api.github.com/users/JohnMagdy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JohnMagdy/subscriptions","organizations_url":"https://api.github.com/users/JohnMagdy/orgs","repos_url":"https://api.github.com/users/JohnMagdy/repos","events_url":"https://api.github.com/users/JohnMagdy/events{/privacy}","received_events_url":"https://api.github.com/users/JohnMagdy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-05-29T15:11:56Z","updated_at":"2018-05-29T23:51:17Z","closed_at":null,"author_association":"NONE","body":"Hello everybody, so i was trying to Send some kind of JSON Data to my website but unfortunatly it was facing some techincal issues so that it resulted in 500 ERROR and then my server crashed with the following Crash logs: \r\n```\r\n[29/05/2018 | 17:02:33] [debug] Server crashed due to an unknown error\r\n[29/05/2018 | 17:02:34] [debug] Native backtrace:\r\n[29/05/2018 | 17:02:34] [debug] #0 6c89d48c in ?? () from cpprest_2_10.dll\r\n[29/05/2018 | 17:02:34] [debug] #1 6ca09ee0 in ?? () from plugins\\requests.DLL\r\n[29/05/2018 | 17:02:34] [debug] #2 6ca0a1d9 in ?? () from plugins\\requests.DLL\r\n[29/05/2018 | 17:02:34] [debug] #3 6ca06d15 in ?? () from plugins\\requests.DLL\r\n[29/05/2018 | 17:02:34] [debug] #4 6ca05416 in ?? () from plugins\\requests.DLL\r\n[29/05/2018 | 17:02:34] [debug] #5 6ccb62e4 in ?? () from C:\\Windows\\system32\\ucrtbase.DLL\r\n[29/05/2018 | 17:02:34] [debug] #6 76baefac in ?? () from C:\\Windows\\system32\\kernel32.dll\r\n[29/05/2018 | 17:02:34] [debug] #7 76fb3628 in ?? () from C:\\Windows\\SYSTEM32\\ntdll.dll\r\n[29/05/2018 | 17:02:34] [debug] #8 76fb35fb in ?? () from C:\\Windows\\SYSTEM32\\ntdll.dll\r\n[29/05/2018 | 17:02:34] [debug] Registers:\r\n[29/05/2018 | 17:02:34] [debug] EAX: 00000000 EBX: 0863c4d0 ECX: a30e6070 EDX: 083ae728\r\n[29/05/2018 | 17:02:34] [debug] ESI: 0863c4d0 EDI: 002d73e8 EBP: 09d2ffec ESP: 09d2ffdc\r\n[29/05/2018 | 17:02:34] [debug] EIP: 76fb35fb EFLAGS: 00010206\r\n[29/05/2018 | 17:02:34] [debug] Stack:\r\n[29/05/2018 | 17:02:34] [debug] ESP+00000000: 6ccb6290 086bccd8 00000000 00000000\r\n```\r\nand i have already used the `OnRequestFailure` Callback and the callback of the `RequestJSON` Function (the 4th argument)\r\n```\r\nforward OnFinishDSRequest(Request:id, E_HTTP_STATUS:status, Node:node); // the the 4th argument of the RequestJSON Function...\r\npublic OnFinishDSRequest(Request:id, E_HTTP_STATUS:status, Node:node) {\r\n    if(id == DS_JSON && _:node != -1)\r\n    {\r\n       new logs[650], Contentlen[600]; JsonStringify(node, Contentlen);\r\n       switch(status)\r\n       {\r\n          case 200,201,202,204: {\r\n             format(logs, sizeof(logs), \"TCP Request sent successfully, sent JSON Node Preview: %s\\r\\n\", Contentlen);\r\n          }\r\n          default: {\r\n             format(logs, sizeof(logs), \"The server returned an error while fetching the requested data: ERROR %d\", _:status);\r\n          }\r\n\t   }\r\n         // some action\r\n    }\r\n    return 1;\r\n}\r\npublic OnRequestFailure(Request:id, errorCode, errorMessage[], len)\r\n{\r\n   new logs[350];\r\n   if(id == DS_JSON)\r\n   {\r\n      format(logs, sizeof(logs), \"The server returned an error while fetching the requested data: %s(ERROR %d)\", errorMessage, errorCode);\r\n      // some action\r\n   }\r\n   return 1;\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/Southclaws/pawn-requests/issues/comments/392984809","html_url":"https://github.com/Southclaws/pawn-requests/issues/6#issuecomment-392984809","issue_url":"https://api.github.com/repos/Southclaws/pawn-requests/issues/6","id":392984809,"user":{"login":"JohnMagdy","id":19735243,"avatar_url":"https://avatars1.githubusercontent.com/u/19735243?v=4","gravatar_id":"","url":"https://api.github.com/users/JohnMagdy","html_url":"https://github.com/JohnMagdy","followers_url":"https://api.github.com/users/JohnMagdy/followers","following_url":"https://api.github.com/users/JohnMagdy/following{/other_user}","gists_url":"https://api.github.com/users/JohnMagdy/gists{/gist_id}","starred_url":"https://api.github.com/users/JohnMagdy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JohnMagdy/subscriptions","organizations_url":"https://api.github.com/users/JohnMagdy/orgs","repos_url":"https://api.github.com/users/JohnMagdy/repos","events_url":"https://api.github.com/users/JohnMagdy/events{/privacy}","received_events_url":"https://api.github.com/users/JohnMagdy/received_events","type":"User","site_admin":false},"created_at":"2018-05-29T23:51:17Z","updated_at":"2018-05-29T23:51:17Z","author_association":"NONE","body":"the ds_client isn't valid....  and the DS_JSON var is valid.... huh ??\r\n```\r\nDS_SendWebhooksData(receiver[], Node:JSON_DATA = Node:-1)\r\n{\r\n   new Contentlen[600]; JsonStringify(JSON_DATA, Contentlen);\r\n   new RequestsClient:ds_client = RequestsClient(receiver,\r\n      RequestHeaders(\r\n         \"Content-Type\", \"application/json\",\r\n         \"Content-Length\", strlen(Contentlen)\r\n      )\r\n   );\r\n   printf(_:ds_client == -1 ? (\"ds_client: INVALID VAR.\") : (\"ds_client: VALID VAR.\"));\r\n   DS_JSON = RequestJSON(ds_client, \"messanger.php\", HTTP_METHOD_POST, \"OnFinishDSRequest\", JSON_DATA,\r\n      .headers = RequestHeaders(\r\n         \"Content-Type\", \"application/json\",\r\n         \"Content-Length\", strlen(Contentlen)\r\n      )\r\n   );\r\n   printf(_:DS_JSON == -1 ? (\"DS_JSON: INVALID VAR.\") : (\"DS_JSON: VALID VAR.\"));\r\n   return 1;\r\n}\r\n```\r\nOutput: \r\n```\r\n[30/05/2018 | 01:49:08] ERROR: Failed to create new HTTP client: URI must contain a hostname.\r\n[30/05/2018 | 01:49:08] ds_client: INVALID VAR.\r\n[30/05/2018 | 01:49:08] DS_JSON: VALID VAR.\r\n[30/05/2018 | 01:49:08] [debug] Server crashed due to an unknown error\r\n[30/05/2018 | 01:49:08] [debug] Native backtrace:\r\n[30/05/2018 | 01:49:08] [debug] #0 56ccb421 in ?? () from cpprest_2_10d.dll\r\n[30/05/2018 | 01:49:08] [debug] #1 56c9e716 in ?? () from cpprest_2_10d.dll\r\n[30/05/2018 | 01:49:08] [debug] #2 56c997a6 in ?? () from cpprest_2_10d.dll\r\n[30/05/2018 | 01:49:08] [debug] #3 56c99993 in ?? () from cpprest_2_10d.dll\r\n[30/05/2018 | 01:49:08] [debug] #4 5e1395c0 in ?? () from plugins\\requests.DLL\r\n[30/05/2018 | 01:49:08] [debug] #5 5e138f53 in ?? () from plugins\\requests.DLL\r\n[30/05/2018 | 01:49:08] [debug] #6 5e1457bd in ?? () from plugins\\requests.DLL\r\n[30/05/2018 | 01:49:08] [debug] #7 5e1618bf in ?? () from plugins\\requests.DLL\r\n[30/05/2018 | 01:49:08] [debug] #8 5e1488ea in ?? () from plugins\\requests.DLL\r\n[30/05/2018 | 01:49:08] [debug] #9 5e1a7489 in ?? () from plugins\\requests.DLL\r\n[30/05/2018 | 01:49:08] [debug] #10 5e19c2c7 in ?? () from plugins\\requests.DLL\r\n[30/05/2018 | 01:49:08] [debug] #11 5e1880e2 in ?? () from plugins\\requests.DLL\r\n[30/05/2018 | 01:49:08] [debug] #12 57597e48 in ?? () from ucrtbased.dll\r\n[30/05/2018 | 01:49:08] [debug] #13 57597b8b in ?? () from ucrtbased.dll\r\n[30/05/2018 | 01:49:08] [debug] #14 7724efac in ?? () from C:\\Windows\\system32\\kernel32.dll\r\n[30/05/2018 | 01:49:08] [debug] #15 770f3628 in ?? () from C:\\Windows\\SYSTEM32\\ntdll.dll\r\n[30/05/2018 | 01:49:08] [debug] #16 770f35fb in ?? () from C:\\Windows\\SYSTEM32\\ntdll.dll\r\n[30/05/2018 | 01:49:08] [debug] Registers:\r\n[30/05/2018 | 01:49:08] [debug] EAX: 00000000 EBX: 02a2f3a0 ECX: 00000000 EDX: 003f37c4\r\n[30/05/2018 | 01:49:08] [debug] ESI: 09b1fe2c EDI: 09b1fca0 EBP: 09b1ffec ESP: 09b1ffdc\r\n[30/05/2018 | 01:49:08] [debug] EIP: 770f35fb EFLAGS: 00010246\r\n[30/05/2018 | 01:49:08] [debug] Stack:\r\n[30/05/2018 | 01:49:08] [debug] ESP+00000000: 57597ae0 02a2f3a0 00000000 00000000\r\n```"}}
{"actor":{"display_login":"JohnMagdy"}}