Sorroko / cclite

A cc emulator written in lua
33 stars 17 forks source link

HTTP #55

Closed TYKUHN2 closed 10 years ago

TYKUHN2 commented 10 years ago

Someone screwed up. Can only TSerial.unpack Strings lib/http/HttpRequest:133 etc etc.

Sorroko commented 10 years ago

Thanks for the report. But I need some more info, can you paste the code you ran please? Also as it seems like an http request gone wrong, the exact same link that was requested would be useful.

Thanks.

TYKUHN2 commented 10 years ago

Alright stand by for a very long URL example.com And very long code http.request("http:\www.example.com") And to double check nothing in my code is screwing it up, I shale run that line by itself. Oh and before I do that, as a side note, it doesn't always crash, sometimes the CC program hangs because of what I assume is no HTTP request occuring at all. CCLite still works in such a case. After running that single line of code, no crashing occurs on CCLite's end, however (and I have confirmed I can connect to said website, and double checked spelling) everytime I run it along with a very short os.pullEvent, it returns http_failure every single time.

On further inspection, if I run the original code it only hangs, no problem. However if I run it as a startup the crash occurs, so it is an interesting one I must say.

--Original Code for i = 1, 4 do http.request("http:\www.example.com") requesting = true while requesting do local event = os.pullEvent() if event == "http_success" then requesting = false i = 4 --WIP, will add code here-- end end end

TYKUHN2 commented 10 years ago

Not certain but it may be a lua issue, it seems to hang (http.request) or return nil (http.get) instead of returning failure or success in CC using Minecraft. Further investigation pending?

Sorroko commented 10 years ago

Sorry, I'm away right now and won't be able to do any testing for a week or so. It sounds like you might be blocking http requests. Can you double check firewalls etc.? The error seems to be that the httprequest isn't returning anything, which would explain some of your observations.

TYKUHN2 commented 10 years ago

I have no clue what could be blocking them, I will get all my tools ready to tackle this threat.

TYKUHN2 commented 10 years ago

After making firewall excptions for the following: lua.exe luac.exe wlua.exe bin2c.exe love.exe cclite.exe It continues. CommWire and Fiddler cannot detect it, likely not leaving the program.

ZudoB commented 10 years ago

Try changing the URL to http://www.example.com. This fixed the issue.

TYKUHN2 commented 10 years ago

No change in error

TYKUHN2 commented 10 years ago

Well something changed.

Sorroko commented 10 years ago

So it's now working without an issue? I guess it's closed for now unless someone else has the same problem.

TYKUHN2 commented 10 years ago

Interesting, starting it up a couple months later makes me want to reopen the issue, I will look deeper before doing such.

TYKUHN2 commented 10 years ago

Yeah no clue what is occuring, it appears to work when a SLEEP is placed, at that point it hangs and seems not to understand that http_failure doesn't mean click. I am utterly scared I will have to abandon the project. Nonetheless I have more knowledge coming out of this.