Commit Graph

100 Commits

Author SHA1 Message Date
gardners
0d85d60566 relocate point of action for debug.rhizome_nohttptx so that it
performs correctly, and can be genuinely used to test failover from
http to mdp.
this has been confirmed by running the resulting rhizomeprotocol test
before and after application of the fix for the regression that stopped
the failover from working in certain circumstances.
2013-08-25 16:53:26 +09:30
gardners
9b09021605 add test for falling over to MDP when HTTP rhizome fetching fails. 2013-08-25 16:37:44 +09:30
Jeremy Lakeman
f9b828c3dd Remove payload if hash doesn't match when reading back 2013-08-21 15:45:18 +09:30
Jeremy Lakeman
771cb4151b Fetch journal range via HTTP 2013-08-15 17:00:43 +09:30
Jeremy Lakeman
21132466f1 Serve a range of a file payload via HTTP 2013-08-15 16:31:26 +09:30
gardners
8968d5cf05 report RFD900 packets received as well as link margin estimate.
(non-zero packets received implies radio link).
2013-07-19 20:04:15 +09:30
Jeremy Lakeman
3855ff35c4 Clean up string formatting for 64bit compilation 2013-07-15 09:59:24 +09:30
Jeremy Lakeman
8ac359e550 Use consistent integer types for 64bit compilation 2013-07-13 14:47:06 +09:30
Jeremy Lakeman
a1ac7febe2 Add rhizome fetch status html page 2013-07-11 12:32:06 +09:30
Jeremy Lakeman
3e57add9ca Fix, initialise read / write handles so we don't close fd=0 2013-06-19 12:05:56 +09:30
Jeremy Lakeman
40364be92f Fix and improve rhizome stress test
- reduce dependance on routing
- fail immediately if a servald instance crashes
2013-06-18 16:33:41 +09:30
gardners
0898981807 add time stamp to rssi.csv 2013-05-07 13:40:38 +09:30
gardners
3692a959d5 add rssi.csv http request 2013-05-07 13:40:07 +09:30
Jeremy Lakeman
73786bcb5d Refactor all rhizome reading and writing
- The API in rhizome_store.c is used for all reading and writing
- external storage is now usable for all transport options
2013-02-20 16:18:59 +10:30
gardners
3301a51883 fix behaviour when rhizome http service is disabled so that
rhizomeprotocol test 3 can detect when rhizome http is disabled,
even though the http server itself runs for providing informational
services.
2013-02-20 16:18:56 +10:30
gardners
2252fdcaa7 created tool for automatically finding IN()s without matching
OUT()s or where return() is used instead of RETURN().
Added OUT() to end of all functions using IN() that lacked it to
make it easier to statically analyse this invariant.
Fixed several return instead of RETURNs detected through use of
this tool. #49
2013-02-20 16:18:56 +10:30
gardners
f681356f52 reformat /rssi web page to better fit on phone screens. 2013-02-20 15:36:31 +10:30
gardners
e551017896 push profiling down deeper into rhizome_fetch_poll()'s children. 2013-02-20 15:36:29 +10:30
gardners
60015a1aee keep HTTP server running when rhizome over http is disabled, but
don't serve and rhizome requests.
2013-02-20 15:36:29 +10:30
gardners
f114e6d19e add progress data for each rhizome transfer. 2013-02-20 15:36:28 +10:30
gardners
d49649ed96 add stored bundle count to /rssi web page display. 2013-02-20 15:36:28 +10:30
gardners
3bd4c49af5 add more info to /rssi http page. 2013-02-20 15:36:27 +10:30
gardners
d251f46638 add SID to rssi display 2013-02-20 15:36:27 +10:30
gardners
b9c924c5fe make rssi web page text really big for small phone screens. 2013-02-20 15:36:27 +10:30
gardners
66956d84ce add /rssi page to rhizome web server to allow easy querying of
radio link budget.
2013-02-20 15:36:27 +10:30
Jeremy Lakeman
340003ed99 Don't keep sql blob open from http server 2013-01-30 11:46:10 +11:00
Andrew Bettison
5985df751d Overhaul debug flags
Replace debugflags_t and DEBUG_XXX bit masks with config schema "debug.xxx"
entries.

No more support for "debug.all".
2012-12-11 15:59:46 +10:30
gardners
f827c7c1c8 fixed various problems following split of files into fileblobs 2012-12-04 16:47:45 +10:30
gardners
b91e832ad7 added improved control of rhizome http and mdp servers via
separate config options with their own predicate functions.
2012-11-30 14:47:27 +10:30
Andrew Bettison
c84b7e5db4 Improve str.h functions
Add strn_startswith() and strncase_startswith().

Make all str*_startswith() functions take const char * arguments, to make it
possible to do safe programming with consts.
2012-11-20 18:10:08 +10:30
Jeremy Lakeman
8b9505670d Fix handling of socket closure on OSX 2012-10-08 16:53:52 +10:30
Andrew Bettison
89343c69cd Merge branch 'rhizomedirect' into 'master' 2012-10-05 17:45:30 +09:30
Andrew Bettison
2e7d19a3f7 Issue #9, fix rhizome direct push and sync tests
The "rhizome direct push" command (and also sync) was not waiting for the
server's HTTP response, so it was exiting before the server had finished
storing the bundle, which led to a race with the subsequent "assert
bundle_received_by" test.  Fixed by adding the missing code to receive the HTTP
response.

Refactored the code used for parsing HTTP responses in rhizome_fetch.c, and
used it in rhizome_direct_http.c.
2012-10-04 17:38:33 +09:30
Andrew Bettison
3040d2b665 Add Rhizome DB retries on SQL statement preparation
It turns out that if the DB is locked, sqlite_prepare_v2() call can return
SQLITE_BUSY.  The retry logic (implemented for issue #2) only provided for
sqlite_step() to return SQLITE_BUSY.  It was a fairly straightforward matter to
extend the retry logic to cover statement preparation in an equally general
fashion.

The problem was observed while diagnosing failures in the rhizomeprotocol
DirectPush test case: the "servald rhizome list" command was failing due to a
locked database.  See issue #9.
2012-10-04 14:30:20 +09:30
gardners
33107e795f Reduced debug output. #9 2012-10-03 16:26:41 +02:00
gardners
636cba8363 rhizome direct http manifest-less file import now uses the name
supplied in the HTTP POST form. #9
2012-10-03 16:13:41 +02:00
gardners
dc3137707f rhizome import bundle from file sans-manifest via http now works.
Must be enabled by using rhizome.api.addfile.*
Certainly polishing to be done, including using filename supplied
during HTTP POST.  Now to fix that, and make it all work with
final rhizomeprotocol test case.
rhizomeprotocol test cases 8 and 9 currently fail post-merge. #9
2012-10-03 16:13:06 +02:00
gardners
e9136ec7ee first cut at code to lookup manifest by prefix and deliver the
manifest in full. #9
2012-10-03 15:50:43 +02:00
gardners
c356ead09c fixed bug in rhizome direct http push code.
Rhizome direct push via HTTP now works. #9
2012-10-03 12:22:52 +02:00
Andrew Bettison
e51745e39d Issue #9, fix HTTP server "POST /rhizome/bundle"
Handle failure cases properly.  The HttpImport test now fails because the
"servald" executable is not found by the system(3) call -- need to give the
full path name, or avoid the use of system(3) altogether.
2012-09-28 17:53:20 +09:30
Andrew Bettison
14721fab19 Merge branch 'solaris' into rhizomedirect
All test cases pass on Solaris (see issue #16) except the 'jni' tests because
there is no Java compiler available on Solaris, and the new 'rhizomeprotocol'
tests from the rhizomedirect branch, which have always failed.
2012-09-27 17:38:16 +09:30
gardners
9a5dbbd14f rhizome direct http transport now asks for response to enquiry when
enquiry received by server.  Generating responses to enquiries not
yet implemented. #9
2012-09-11 13:09:40 +09:30
gardners
d3f5c6e598 Merged rhizome direct httpd back into main rhizome httpd server.
bundles can be imported via HTTP POST multi-part form. #9
2012-09-06 13:21:13 +09:30
gardners
dc15ac5a34 Make simple http response clear request type so that it always
works. #9
2012-09-06 06:09:16 +09:30
Paul Gardner-Stephen
bba6839656 Initial stab at porting to Solaris.
It compiles without warning (with CC=gcc) but doesn't link
because NaCL doesn't build yet.
2012-09-05 20:42:50 +09:30
gardners
ecbe8e4f8c improve HTTP server response code handling, including fixing
iching calculator bug - unknown response codes not more than four
no longer result in "a suffusion of yellow".
Also stopped dropping HTTP requests on empty reads when parsing
a multi-part POST.
2012-09-05 16:35:08 +09:30
gardners
4cab16598c added code to rhizome http request client poll routine to call
multi-part form data parser.
2012-09-05 15:53:16 +09:30
Jeremy Lakeman
df0e20408c Close sockets on poll errors 2012-08-31 15:04:06 +09:30
gardners
9d2aa61792 Refactoring of Rhizome http server code so that we can supply a
different request parser, but otherwise share code between
rhizome transfers and rhizome direct. #9
2012-08-31 13:01:28 +09:30
gardners
bde9d1c56a Rhizome http server now allows specification of client socket callback
when starting, so that same server code can be shared for rhizome transfers
and rhizome direct. #9
2012-08-31 13:01:28 +09:30