Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007817opensim[REGION] OpenSim Corepublic2016-01-23 01:582017-04-14 12:24
Assigned Todjphil 
PlatformPCOperating SystemWindowsOperating System VersionSeven
Product Version 
Target VersionFixed in Versionmaster (dev code) 
Summary0007817: file_get_contents no longer works with 0.9.x on simstatus page
DescriptionThe php function "file_get_contents" no longer works correctly with OpenSim v0.9.x. You can test it with the script provided below.

If you try OpenSim v0.8.x everything works properly, normal speed
If you try OpenSim v0.9.x it does NOT works properly, very very slow speed

edit : work perfectly with curl
Steps To Reproduce<?php
    $url = "http://IP:PORT/simstatus/"; [^]
    $simstatus = file_get_contents($url);
    if ($simstatus == "OK") echo "Online";
    else echo "Offline";
TagsNo tags attached.
Git Revision or version number
Run Mode Grid (Multiple Regions per Sim)
Physics EngineBulletSim
Script Engine
Environment.NET / Windows32
Mono VersionNone
ViewerFirestorm, Singularity
Attached Files

- Relationships

-  Notes
JeffKelley (reporter)
2016-01-27 00:46

From [^]

Bear in mind that contrary to the behavior of web browsers, file_get_contents doesn't return the result when the web page is fully downloaded (i.e. HTTP payload length = value of the response HTTP "Content-Length" header) but when the TCP connection is closed.


tcpdump makes clear that file_get_contents is still waiting for [FIN, ACK] when the HTTP response has been received one minute ago.

Although OS HTTP server answers 'Connection: close' in all versions, it does not actually close the connection since commit bcb27d4 or over. Try: [^] /* 0.9 bcb27d4 2015-11-15 */ [^] /* 0.9 109723d 2016-01-26 */

Also note that this behaviour is the rule for LSL scripts in all versions, so file_get_contents will timeout for 0.8 scripts also.

Using Content-Length to detect end of conversation, curl is not subject to this issue.
djphil (reporter)
2016-01-27 01:33
edited on: 2016-01-27 01:34

I hope that we can find file_get_contents as it worked well in the past with 0.8.x
Quite simply ...

djphil (reporter)
2016-06-14 08:35

I re test the php function "file_get_contents" today with the Master Dev code to get simstats content but i see any changes for now.

Before, in OpenSim v0.8.x it was working fine but it does not work v0.9.x

Think you can make it work properly as it was before ?
Diva (administrator)
2016-06-21 09:40

If this is a regression, I'd like to fix it.
However, I will not be able to fix anything that involves PHP.

So, please restate this issue in a way that I can see what the problem is. I don't do PHP. Start with this:

- How do I enable simstatus?
- What's the expected return from calling http://IP:PORT/simstatus/? [^]
- What do you get that is erroneous in 0.9 but ok in 0.8.2?
djphil (reporter)
2016-06-21 10:20

simstatus is enable by default and i don't remember where disable it
(i know this is possible).

if enable it will return "OK"
( [^])

in OS v0.9.x the response time is huge and causes a timeout error.
Diva (administrator)
2016-06-21 10:24
edited on: 2016-06-21 10:36

Unable to reproduce. The response is immediate on my test grids, both localhost and on a university server.

I used a web browser. If that doesn't do it, please provide another way for me to reproduce the problem that is not PHP.

djphil (reporter)
2016-06-21 10:53
edited on: 2016-06-21 11:19

In the [Network] section i have this port for 0.9
http_listener_port = 12100
and this port for 0.8
http_listener_port = 12000

So I tested with the script provided above
with the urls http://mydomain:12000/simstatus/ [^]
and http://mydomain:12100/simstatus/ [^]

PS: i send to you a url url in IM on IRC

djphil (reporter)
2017-04-14 12:24

New test repport:
- Tested with opensim master (2017-04-14) in STANDALONE mode and in GRID mode [^] [^]
- OS : Windows 7 (32bits)
- .NET Framework : 4.6.2
- Tested with the PHP script provided above

It is working properly again :)

- Issue History
Date Modified Username Field Change
2016-01-23 01:58 djphil New Issue
2016-01-26 04:36 djphil Description Updated View Revisions
2016-01-27 00:46 JeffKelley Note Added: 0030027
2016-01-27 01:33 djphil Note Added: 0030028
2016-01-27 01:34 djphil Note Edited: 0030028 View Revisions
2016-06-14 08:35 djphil Note Added: 0030521
2016-06-21 09:40 Diva Note Added: 0030619
2016-06-21 10:20 djphil Note Added: 0030628
2016-06-21 10:24 Diva Note Added: 0030629
2016-06-21 10:36 Diva Note Edited: 0030629 View Revisions
2016-06-21 10:53 djphil Note Added: 0030630
2016-06-21 11:19 djphil Note Edited: 0030630 View Revisions
2017-04-14 12:24 djphil Note Added: 0031752
2017-04-14 12:24 djphil Status new => resolved
2017-04-14 12:24 djphil Fixed in Version => master (dev code)
2017-04-14 12:24 djphil Resolution open => fixed
2017-04-14 12:24 djphil Assigned To => djphil
2017-04-14 12:24 djphil Status resolved => closed

Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker