Avoid generating content-location header if no valid URIs

The oBIX server segfaults with following request:

	curl localhost//obix

The root cause lies in that when an error occurs there is a chance
that both response_uri and request_decoded_uri are NULL which will
result in passing a NULL parameter to FCGX_FPrintF and triggers
coredumps.

The content-location HTTP header should be skipped over in such case
Impose further control on requested URI

Aside from leading double slashes, no double slashes or any dot in
any position or leading whitespace characters are allowed in the
requested URI.
Enforce sanity checks on href in provided XML document on client side

If the root node of the provided XML document from oBIX client has a
href attribute, it must be a valid one.
Rename xml_href_is_valid to xml_is_valid_href

So as to confrom with with naming convention of other functions such
as xml_is_valid_doc
Merge pull request #74 from Qingtao-Cao/devel

Impose stricter control on requested URI on both server and client side
Postpone imposing stringent control on requested URI from clients

Revert to previous behaviour to only check if the requested URI
does not start with a slash at all, or started with double slashes
(possibly as a result of websever configuration error), until an
agreement can be reached regarding what kinds of requested URIs
are allowable.
Fixup a logic error in assembling MSBs' kWh readings in bms_adaptor

Now that we have avoided pointer casting in get_mtr_reading() such as

	*(uint16_t *)val += mtr->value.u16;

and replaced it with memcpy as below:

	memcpy(val, (void *)&mtr->value.u16, sizeof(uint16_t));

So as to avoid GCC strict-aliasing warning. This is a good thing to do,
however, there is a logic inconsistency that in the original approach
the *val would be an accumulation of any existing values plus the new
value read, however, in the latest approach it is simply replaced with
the latter.

To cope with this, the user should store any existing value and do
addition by themselves.

Lastly fix up whitespace errors in the lines of "break;", 2 tabs are
preferred to 8 consecutive white spaces.
Merge pull request #75 from Qingtao-Cao/devel

One step back on whether to impose stringent control on requested URIs
Fix the start boundary of a history record

"<obj " used to be regarded as the start of a history record. However,
unfortunately, with the presence of complex device contract and relevant
history record that contains sub nodes, this will simply break in that
parse_log() will mistakenly regard the beginning of a sub node in the
previous record of the desirable one as the starting point of it, resulting
segment of previous history record fetched as part of response as well.

To fix it, simply be stringent on the starting point of a history record
to be "<obj is=\"obix:HistoryRecord\">"

Signed-off-by: Qingtao Cao <harry.cao@nextdc.com>
Merge pull request #77 from Qingtao-Cao/devel

Fix the start boundary of a history record - fix for Issue#76
Header information for all unit tests
Watch tests: watch add, and watch short poll
test_watch_poll_long.test - tests the obix:Watch long-poll mechanism
include adaptors in this spec file