Cannot check right now, but if I didn’t do something terribly wrong I should be
at the latest commit on master, so below e85572.
It seems to me that actually e85572 introduced the bug:
http://sourceforge.net/p/owfs/code/ci/e855721f4e02fd93b5345ba8e89462043973ba28/tree/module/owlib/src/c/ow_read.c?diff=706f0c578a6f77daf9fb3dca0af7fd608d5e0ca4
In fact you cannot read a directory, so at the very beginning of
FS_read_postparse you should have at least
// ServerRead jumps in here, perhaps with non-file entry
if (pn->selected_filetype == NO_FILETYPE) {
return -EISDIR;
}
Expected behaviour is that reading a directory should return error 21 (EISDIR),
and this should happen early, not after trying to read the bus.,
When I have time I will try to write a python test suite to check owserver
semantics.
Stefano
PS:
Sorry, I’m relatively a newcomer on this list, but let me add a rant against
the owserver semantics implemented in module/owlib/src/c/ow_get.c which IMHO
should be deprecated.
It appears to me that ow_get tries to mimic what happens with HTTP without
understanding the underlying semantics. http://example.com/a
<http://example.com/a> and http://example.com/a/ <http://example.com/a/> are
different resources: if you "GET /a” and “/a” does not exists but there is an
“/a/“, the server usually replies with a “HTTP 301 Moved Permanently” status
code, NOT with the contents of “/a/“: it is the responsibility of the client to
repeat the request!
$ curl -I http://pyownet.readthedocs.org/en/latest
HTTP/1.1 301 Moved Permanently
Server: nginx/1.4.6 (Ubuntu)
X-Deity: web02
X-Served: Nginx
Content-Type: text/html
Date: Wed, 25 Nov 2015 08:36:52 GMT
Location: http://pyownet.readthedocs.org/en/latest/
Connection: keep-alive
X-Subdomain-TryFiles: True
Content-Length: 193
$ curl -I http://pyownet.readthedocs.org/en/latest/
HTTP/1.1 200 OK
Server: nginx/1.4.6 (Ubuntu)
Date: Wed, 25 Nov 2015 08:38:30 GMT
Content-Type: text/html
Content-Length: 10016
Last-Modified: Wed, 26 Aug 2015 13:37:24 GMT
Connection: keep-alive
Vary: Accept-Encoding
ETag: "55ddc114-2720"
X-Subdomain-TryFiles: True
X-Deity: web03
X-Served: Nginx
Accept-Ranges: bytes
BTW it is up to the server to decide whether it should return a “HTTP 301 Moved
Permanently” or a “HTTP 404 Not found” error for “GET /a”.
In owserver instead, ow_get returns either the content of a file or the listing
of a directory, which indeed is a terrible idea, since the client has no way to
know what it is returned (a value or a listing.). I understand that ow_get
cannot be scrapped right now, but it should at least be deprecated.
> On 25 Nov 2015, at 01:35, Jan Kandziora <j...@gmx.de> wrote:
>
> Am 25.11.2015 um 01:13 schrieb Stefano Miccoli:
>> I have a bug on my RPi: (no time to investigate right now, but reporting,
>> just in case it can be reproduced).
>>
>> start owserver as
>>
>> owserver --tester=DS18S20 —debug
>>
>> and run (in another terminal)
>>
>> owread /10.000010EF0000
>>
>> and owserver segfaults:
>>
>> CALL: data.c:(144) Read message
>> DEBUG: read.c:(55) ReadHandler start
>> DEBUG: read.c:(61) ReadHandler: From Client sm->payload=17 sm->size=65536
>> sm->offset=0
>> DEBUG: read.c:(79) ReadHandler: call FS_read_postparse on /10.000010EF0000
>> DEBUG: ow_read.c:(72) /10.000010EF0000
>> DEBUG: ow_read.c:(231) About to read </10.000010EF0000> extension=0 size=8
>> offset=0
>> Segmentation fault (core dumped)
>>
>> The error is triggered when you try to read (message type 2, read) a node
>> which is a directory. Expected behaviour in this case is failure with
>> errcode 21.
>>
> Stefano, this was a bug I tried to address for "external" with commit
> e855721f4e02fd93b5345ba8e89462043973ba28. Are you below that commit?
>
> Kind regards
>
> Jan
>
> ------------------------------------------------------------------------------
> Go from Idea to Many App Stores Faster with Intel(R) XDK
> Give your users amazing mobile app experiences with Intel(R) XDK.
> Use one codebase in this all-in-one HTML5 development environment.
> Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
> http://pubads.g.doubleclick.net/gampad/clk?id=254741551&iu=/4140
> _______________________________________________
> Owfs-developers mailing list
> Owfs-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/owfs-developers
------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741551&iu=/4140
_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers