Am 21.09.2015 um 23:29 schrieb Jan Kandziora:
>
> Still, the tcl language binding seem to have its own crash culprit. Have
> to investigate further.
>
Owlib and all the language bindings depending on it (that is: all that
are not ownet) had another set of bugs which made the client crash when
accessing external sensors and no config file is given.
See the attached patch. I have also fixed it in the git archive.
There is still one intentional(!) crash in ow_parsename.c:(318)
remaining for a specific corner case. It happens only when you are
trying to list the contents of an external sensor directory supplied by
an owserver. I don't know what's wrong with that mutex so it doesn't
unlock at this place, maybe someone could help me?
So you can now have external sensors attached to any owlib-driven
program and language interface by supplying a external configuration
file to it. What won't work yet is accessing external sensors supplied
by owservers through owlib. They show up but you cannot access their
properties. I'm working on this.
Kind regards
Jan
diff --git a/module/owlib/src/c/ow_parseinput.c b/module/owlib/src/c/ow_parseinput.c
index 2607716..220dacb 100644
--- a/module/owlib/src/c/ow_parseinput.c
+++ b/module/owlib/src/c/ow_parseinput.c
@@ -78,6 +78,12 @@ ZERO_OR_ERROR OWQ_parse_input(struct one_wire_query *owq)
return FS_input_array_with_commas(owq);
}
default:
+ // Sort out locally unknown filetype.
+ if (OWQ_pn(owq).selected_filetype == NO_FILETYPE) {
+ return -ENOENT;
+ }
+
+ // Switch by known filetype.
switch (OWQ_pn(owq).selected_filetype->format) {
case ft_integer:
return FS_input_integer(owq);
diff --git a/module/owlib/src/c/ow_server_message.c b/module/owlib/src/c/ow_server_message.c
index cb1789e..bb584e5 100644
--- a/module/owlib/src/c/ow_server_message.c
+++ b/module/owlib/src/c/ow_server_message.c
@@ -69,7 +69,7 @@ SIZE_OR_ERROR ServerRead(struct one_wire_query *owq)
sm.offset = OWQ_offset(owq);
// Alias should show local understanding except if bus.x specified
- if ( pn_file_entry->selected_filetype->format == ft_alias && ! SpecifiedRemoteBus(pn_file_entry) ) {
+ if ( (pn_file_entry->selected_filetype != NULL) && (pn_file_entry->selected_filetype->format == ft_alias && ! SpecifiedRemoteBus(pn_file_entry) )) {
ignore_result = FS_r_alias( owq ) ;
return OWQ_length(owq) ;
}
diff --git a/module/owlib/src/c/ow_write.c b/module/owlib/src/c/ow_write.c
index 3c447ce..2b5817a 100644
--- a/module/owlib/src/c/ow_write.c
+++ b/module/owlib/src/c/ow_write.c
@@ -193,7 +193,7 @@ static ZERO_OR_ERROR FS_write_real(int depth, struct one_wire_query *owq)
return -ENODEV ;
}
- if ( ft->write == FS_w_alias ) {
+ if ( (ft != NO_FILETYPE) && (ft->write == FS_w_alias) ) {
// Special check for alias
// it's ok for fake and tester and mock as well
// so do this before the fake test
------------------------------------------------------------------------------
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers