Commit Graph

3127 Commits

Author SHA1 Message Date
Andrew Bettison
5c1ebc71a9 Refactor MeshMS conversation list
Use an iterator structure, not recursion, to traverse the binary tree of
conversations
2014-01-21 18:24:53 +10:30
Jeremy Lakeman
04955f1ddd Fix interface name comparison for detecting real interfaces 2014-01-20 16:01:29 +10:30
Andrew Bettison
6a1c8bcf5a All HTTP RESTful responses are JSON, not HTTP
Even error responses (typically code 403)
2014-01-20 15:44:21 +10:30
Andrew Bettison
de46223cc4 strbuf_json_boolean() 2014-01-20 15:43:37 +10:30
Andrew Bettison
a3010d3632 STRBUF_ALLOCA_FIT() macro 2014-01-20 15:37:14 +10:30
Jeremy Lakeman
e0c2d59ab5 Shutdown local tcp connection when remote msp connection has shutdown 2014-01-10 15:37:00 +10:30
Jeremy Lakeman
65f1157e1e Drop acked packets sent via unicast links 2014-01-10 14:54:30 +10:30
Jeremy Lakeman
d7206e10d7 Ensure MSP sockets are processed for incoming tcp connections 2014-01-10 12:56:41 +10:30
Jeremy Lakeman
31ab78fdf2 Merge branch 'msp' into development 2014-01-09 15:08:00 +10:30
Jeremy Lakeman
68421db114 Add msp debug flag 2014-01-09 15:06:35 +10:30
Jeremy Lakeman
f085ffec50 Add SIGINT handler to cleanup mdp sockets 2014-01-09 15:06:35 +10:30
Jeremy Lakeman
57b7d74822 Fix comparisons for removing mdp port bindings 2014-01-09 15:06:35 +10:30
Jeremy Lakeman
8d9447ba6b Ensure connection is initiated with no input 2014-01-09 15:06:35 +10:30
Jeremy Lakeman
dbb65228e6 Deal with errors when binding sockets 2014-01-09 15:06:35 +10:30
Jeremy Lakeman
48dce9a575 Add tcp forwarding on the listen end of an MSP connection 2014-01-09 15:06:35 +10:30
Jeremy Lakeman
99e08d1516 Add command to support forwarding TCP connections to an MSP service 2014-01-09 15:06:35 +10:30
Jeremy Lakeman
e09387b27d Refactor stdio handling 2014-01-09 15:06:34 +10:30
Jeremy Lakeman
6045eb10e8 Reduce spam of link state packets 2014-01-09 15:06:34 +10:30
Jeremy Lakeman
6d942f8d4f Improve tests 2014-01-09 15:01:38 +10:30
Jeremy Lakeman
4bb3336b33 Generalise method for defining multiple interfaces 2014-01-09 15:01:38 +10:30
Jeremy Lakeman
60a2aaa547 Ensure only interfaces that are UP are closed 2014-01-09 15:01:38 +10:30
Jeremy Lakeman
506518ad06 Allow interfaces to use local unix addresses
- broadcast packets are sent to all sockets in the same folder
- switched most tests to use local sockets
2014-01-09 15:01:38 +10:30
Jeremy Lakeman
5f2c6e364a Refactor interface addresses to use new socket_address struct 2014-01-09 15:01:38 +10:30
Jeremy Lakeman
64fe96ebfa Only drop BAR's from the sync if they are no longer interesting 2014-01-09 15:01:37 +10:30
Jeremy Lakeman
df6af96455 Test connection keep alive and timeouts 2014-01-09 15:01:37 +10:30
Jeremy Lakeman
1d88df594b Fix unsigned warning 2014-01-09 15:01:37 +10:30
Jeremy Lakeman
741442c54c Pipe file contents across msp connection 2014-01-09 15:01:37 +10:30
Jeremy Lakeman
3a533187b7 Improve msp failure handling 2014-01-09 15:01:37 +10:30
Jeremy Lakeman
db7f68afd7 Initial msp library implementation with connection state tracking 2014-01-09 15:01:37 +10:30
Jeremy Lakeman
3a87656032 Add explicit list of test framework dependencies 2014-01-06 13:11:54 +10:30
Jeremy Lakeman
cc51edd39d Fix compiler warnings 2014-01-06 12:36:00 +10:30
Andrew Bettison
d4320f20da Merge branch 'naf4' into 'development'
New HTTP RESTful Rhizome API, plus tests, and lots of Rhizome
improvements and refactoring
2013-12-30 18:14:34 +10:30
Andrew Bettison
669080edc8 Add 'rhizomehttp' to 'all' tests
Disable unused 'rhizomehttp' tests
2013-12-30 18:10:39 +10:30
Andrew Bettison
ee9c96bb8c Implement HTTP POST /restful/rhizome/insert
Change HTTP request buffer pointers from (const char*) to (char*)
because some Rhizome operations can modify received data in-place, eg,
when decrypting it.
2013-12-30 18:09:56 +10:30
Andrew Bettison
42e6168998 Improve Rhizome manifest setter functions
Remove interactions between rhizome_manifest_set_filesize()
and rhizome_manifest_set_filehash(), since any inconsistency
is caught by rhizome_manifest_validate() in any case
2013-12-30 16:30:43 +10:30
Andrew Bettison
aa3497df4f Refactor rhizome_crypt_xor_block() and add debug 2013-12-30 16:30:43 +10:30
Andrew Bettison
dd5048bd43 rhizome_manifest_set_name_from_path()
Refactor rhizome_fill_manifest() to use it
2013-12-30 16:30:43 +10:30
Andrew Bettison
464f0858f1 Refactor rhizome_write_file() to use fd not FILE* 2013-12-30 16:30:43 +10:30
Andrew Bettison
f81883758a Support streaming directly into Rhizome store
The rhizome_open_write() function now accepts RHIZOME_SIZE_UNSET as the
payload size, and streams into an external blob until finished, then
copies the external blob into the FILEBLOBS table if it is small enough.

Needed so that HTTP GET /restful/rhizome/insert can stream the payload
directly into the DB even if the supplied manifest does not specify
'filesize'.
2013-12-30 16:30:43 +10:30
Andrew Bettison
7cecdf7a3a Add Rhizome db blob primitive functions
sqlite_blob_open_retry()
sqlite_blob_write_retry()
sqlite_blob_close()
2013-12-30 16:30:43 +10:30
Andrew Bettison
34188fa489 Replace config 'rhizome.external_blobs' with 'rhizome.max_blob_size' 2013-12-30 16:30:43 +10:30
Andrew Bettison
0c88f8bf89 Replace str_to_uint() with str_to_uint32()
Also str_to_int() with str_to_int32()
2013-12-30 16:30:43 +10:30
Andrew Bettison
72040517e1 New enum rhizome_payload_status
Refactor a lot of Rhizome bundle storage code to use the new "enum
rhizome_payload_status" instead of mysterious int values to represent
the outcome of the operation.
2013-12-30 16:30:35 +10:30
Andrew Bettison
b37e27f5da Improve HTTP server multipart body parsing
Every handler function can return an HTTP response status code
to terminate request parsing and start the response.
2013-12-27 19:07:00 +10:30
Andrew Bettison
9ebef81a49 Formalise "rhizome add file" exit status
Formalise add-bundle result in "enum rhizome_bundle_status"

Rewrite rhizome_manifest_finalise(), rhizome_find_duplicate() and
rhizome_add_manifest() to return enum rhizome_bundle_status

New function rhizome_manifest_check_stored() that compares a manifest
with its stored counterpart and returns enum rhizome_bundle_status

Remove redundant rhizome_manifest_check_sanity(), consolidating all
manifest validation rules in rhizome_manifest_validate(), which now
checks the 'id' field is present, and that 'sender' and 'recipient' are
both present for MeshMS

Correct manifest finalisation logic: set the 'finalised' flag in
rhizome_manifest_validate(), not in rhizome_manifest_verify() (which
sets 'selfSigned'), and consistently clear 'finalised' flag in all
attribute setter functions

Remove manifest 'ttl' field and all references thereof (leaving unused
space in Rhizome BAR)

Rename some payload functions for clarity
2013-12-21 14:37:18 +10:30
Andrew Bettison
273c5f2689 Make rhizome_manifest_pack_variables() static 2013-12-20 11:29:26 +10:30
Andrew Bettison
8a1ce7f373 Use manifest 'has_id' consistently 2013-12-20 11:29:26 +10:30
Andrew Bettison
d7b926c39c HTTP server response codes 408, 409 2013-12-20 11:29:26 +10:30
Andrew Bettison
d52ba4c871 Remove rhizome_read_manifest_file()
Replace with memcpy() followed by rhizome_manifest_parse()
for memory buffers

Replace with rhizome_read_manifest_from_file() for files
2013-12-20 11:29:17 +10:30
Andrew Bettison
135df30b1b Improve test framework: assertGrep --ignore-case 2013-12-19 19:14:52 +10:30