HTTP bug
#1

Hello,

Today I discovered something which looks like a SA-MP bug to the HTTP function. If I specify an "url" which has a redirect (in my case it was a "Moved Permanently" redirect) the "callback" will be called with response_code 301 ("Moved Permanently") and then the server will hang and then crash (I guess this happens also for the "temporary moved" address redirection, maybe others too). I specified a main domain address ("http://www.example.com") which had a redirect, not something like a subdomain with a redirect ("http://subdomain.example.com").

Can somebody confirm this ? I know that this is not an important bug, but still, it's a bug. It can be simply fixed by users by specifying another "url", but it should send a message in console that the "url" is not ok, or having it simply not crashing, or something like that.
Reply
#2

Bump, HTTP issue here too:

If you send data to a website (*.php) using HTTP_POST and the website is down the server will crash.
Reply
#3

Quote:
Originally Posted by Kar
Посмотреть сообщение
Bump, HTTP issue here too:

If you send data to a website (*.php) using HTTP_POST and the website is down the server will crash.
The http function seems very unstable to me.
It randomly crashes the server for me, tho doing the same thing over and over again (getting a simple html page from my local apache), the content does not change at all, like 1 out of 10 times it crashes though...

I think the OP and Kar do not have the same exact error there, since my website does not redirect and is online all the time.
Reply
#4

Quote:
Originally Posted by NaS
Посмотреть сообщение
The http function seems very unstable to me.
It randomly crashes the server for me, tho doing the same thing over and over again (getting a simple html page from my local apache), the content does not change at all, like 1 out of 10 times it crashes though...

I think the OP and Kar do not have the same exact error there, since my website does not redirect and is online all the time.
I haven't had this issue, however. I currently have a filterscript performing an HTTP Request (HTTP_POST) to a distant website as a quick fix for something, and it's performed every time a player connects. With about three weeks of running this I haven't had an issue with it in this manner, however, I have had an issue where if the server restarts (in the middle of a HTTP request, as in it was sent just hasn't gotten back) the server will crash. (This is an additional problem)

But in this manner, I haven't had an issue. (In regards to Kar's problem, due to the fact that I haven't experienced this in practice)

In regards to the main problem, with the error code 301, I'm unable to replicate. The server did not crash but did respond with error code 6, HTTP_ERROR_MALFORMED_RESPONSE as defined by a_http.inc. (This is IstuntmanI's problem)
Reply
#5

I, aswell, haven't noticed anything wrong with the HTTP function. Can you provide crashdetect logs of the crash?
Reply
#6

No we don't have the same issue.

@Karagon, I did mention that when the website is DOWN, did you try that?

To be specific, slice's mailer include... www.***/mailer.php. Or idk query an unknown website. I'm not sure but it was happening for me.
Reply
#7

@Puppy:

pawn Код:
#define MAILER_URL "site.com/Folder/mailsender.php" // site.com redirects to forum.site.com, and site.com/Forum/ is not existing.
#include "mailer" // Mailer by Slice

public OnFilterScriptInit( )
{
    SendMail( "<my email>", "<sender email>", "<sender email name>", "Crash", "Crash message" );
    return 1;
}
After that, the returning callback is printing (printing code added by me, the default one from the include is not showing anything, szData[ ] is simply empty, or something like that) "53261, 301" (the first is the index, 0xD00D, and the second one is response code, 301), the server hangs (nothing can be written in console) when the function ends and then after few seconds of waiting it simply crashes.

I tried to debug the crash with Microsoft Visual Studio 2013 Professional - Debugger:
Quote:

Unhandled exception at 0x222F3538 in samp-server.exe: 0xC00001A5: An invalid exception handler routine has been detected (parameters: 0x00000003).

(I don't know if it helps at all, I don't really know how to use it, but it was an option to debug that crash)

There are no crashdetect debugs when it crashes.
Reply
#8

Quote:
Originally Posted by IstuntmanI
Посмотреть сообщение
@Puppy:

pawn Код:
#define MAILER_URL "site.com/Folder/mailsender.php" // site.com redirects to forum.site.com, and site.com/Forum/ is not existing.
#include "mailer" // Mailer by Slice

public OnFilterScriptInit( )
{
    SendMail( "<my email>", "<sender email>", "<sender email name>", "Crash", "Crash message" );
    return 1;
}
After that, the returning callback is printing (printing code added by me, the default one from the include is not showing anything, szData[ ] is simply empty, or something like that) "53261, 301" (the first is the index, 0xD00D, and the second one is response code, 301), the server hangs (nothing can be written in console) when the function ends and then after few seconds of waiting it simply crashes.

I tried to debug the crash with Microsoft Visual Studio 2013 Professional - Debugger:

(I don't know if it helps at all, I don't really know how to use it, but it was an option to debug that crash)

There are no crashdetect debugs when it crashes.
^ Exactly.

For me, my site uses cloudflare and the entire site was being DDoSed, the server did return a value in szData then instantly crashed (linux AND windows, no crashinfo or crashdetect log)

pawn Код:
[00:19:21] [SYSTEM:: OnMailScriptResponse] - szData: <!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en-US"> <![endif]-->
<!--[if IE 7]>    <html class="no-js ie7 oldie" lang="en-US"> <![endif]-->
<!--[if IE 8]>    <html class="no-js ie8 oldie" lang="en-US"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en-US"> <!--<![endif]-->
<head>
<meta http-equiv="refresh" content="0">
<meta http-equiv="set-cookie" content="cf_use_ob=80; expires=Mon, 04-May-15 22:13:26 GMT; path=/">
<meta http-equiv="set-cookie" content="cf_ob_info=522:1e178c70c18e14fd:CDG; expires=Mon, 04-May-15 22:13:26 GMT; path=/">
<title>lvcnr.net | 522: Connection timed out</title>
<meta charset="UTF-8"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"/>
<meta name="robots" content="noindex, nofollow"/>
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1"/>
<script type="text/javascript">
//<![CDATA[
try{if (!window.CloudFlare) {var CloudFlare=[{verbose:0,p:0,byc:0,owlid:"cf",bag2:1,mirage2:0,oracle:0,paths:{cloudflare:"/cdn-cgi/nexp/dok3v=1613a3a185/"},atok:"fddf22e09f644fc5ae39ac15571b22db",petok:"e1927086e5aea22b9d91af4f02f4a3e387ec6d24-1430777576-1800",zone:"lvcnr.net",rocket:"0",apps:{"ga_key":{"ua":"UA-51237611-1","ga_bs":"2"}}}];CloudFlare.push({"apps":{"ape":"b14c63b4b02e2d4a196e492aa6828f75"}});!function(a,b){a=document.createElement("script"),b=document.getElementsByTagName("script")[0],a.async=!0,a.src="//ajax.cloudflare.com/cdn-cgi/nexp/dok3v=7e13c32551/cloudflare.min.js",b.parentNode.insertBefore(a,b)}()}}catch(e){};
//]]>
</script>
<link rel="stylesheet" id="cf_styles-css" href="/cdn-cgi/styles/cf.errors.css" type="text/css" media="screen,projection"/>
<!--[if lt IE 9]><link rel="stylesheet" id='cf_styles-ie-css' href="/cdn-cgi/styles/cf.errors.ie.css" type="text/css" media="screen,projection" /><![endif]-->
<style type="text/css">body{margin:0;padding:0}</style>
<!--[if lte IE 9]><script type="text/javascript" src="/cdn-cgi/scripts/jquery.min.js"></script><![endif]-->
<!--[if gte IE 10]><!--><script type="text/javascript" src="/cdn-cgi/scripts/zepto.min.js"></script><!--<![endif]-->
<script type="text/javascript" src="/cdn-cgi/scripts/cf.common.js"></script>
<script type="text/javascript">
/* <![CDATA[ */
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-51237611-1']);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.******-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

(function(b){(function(a){"__CF"in b&&"DJS"in b.__CF?b.__CF.DJS.push(a):"addEventListener"in b?b.addEventListener("load",a,!1):b.attachEvent("onload",a)})(function(){"FB"in b&&"Event"in FB&&"subscribe"in FB.Event&&(FB.Event.subscribe("edge.create",function(a){_gaq.push(["_trackSocial","********","like",a])}),FB.Event.subscribe("edge.remove",function(a){_gaq.push(["_trackSocial","********","unlike",a])}),FB.Event.subscribe("message.send",function(a){_gaq.push(["_trackSocial","********","send",a])}));"twttr"in b&&"events"in twttr&&"bind"in twttr.events&&twttr.events.bind("tweet",function(a){if(a){var b;if(a.target&&a.target.nodeName=="IFRAME")a:{if(a=a.target.src){a=a.split("#")[0].match(/[^?=&]+=([^&]*)?/g);b=0;for(var c;c=a[b];++b)if(c.indexOf("url")===0){b=unescape(c.split("=")[1]);break a}}b=void 0}_gaq.push(["_trackSocial","*******","tweet",b])}})})})(window);
/* ]]> */
</script>
</head>
<body><script type="text/javascript">
//<![CDATA[
try{(function(a){var b="http://",c="lvcnr.net",d="/cdn-cgi/cl/",e="img.gif",f=new a;f.src=[b,c,d,e].join("")})(Image)}catch(e){}
//]]>
</script>
<div id="cf-wrapper">
<div id="cf-error-details" class="cf-error-details-wrapper">
<div class="cf-wrapper cf-error-overview">
<h1>
<span class="cf-error-type" data-translate="error">Error</span>
<span class="cf-error-code">522
After that.. CRASH.


As you can see we've reported about 3 different bugs with the HTTP function here. Please guys if you have nothing worthy of saying, don't say it. If you guys have different recreations or more HTTP bugs feel free to report them.
Reply
#9

Quote:
Originally Posted by Kar
Посмотреть сообщение
No we don't have the same issue.

@Karagon, I did mention that when the website is DOWN, did you try that?

To be specific, slice's mailer include... www.***/mailer.php. Or idk query an unknown website. I'm not sure but it was happening for me.
What I was discussing was the problem I was having, I'm not sure if that was clear. It was more of an addition to your problem, and I was unable to replicate IstuntmanI's problem.
Reply


Forum Jump:


Users browsing this thread: