Add some comments to clarify Rhizome enums

This commit is contained in:
Andrew Bettison 2015-11-17 00:18:21 +10:30
parent 0dd778bab5
commit bdb3b99143
2 changed files with 6 additions and 2 deletions

View File

@ -272,8 +272,8 @@ void httpd_server_poll(struct sched_ent *alarm)
}
current_httpd_requests = request;
++current_httpd_request_count;
request->payload_status = INVALID_RHIZOME_PAYLOAD_STATUS;
request->bundle_status = INVALID_RHIZOME_BUNDLE_STATUS;
request->payload_status = INVALID_RHIZOME_PAYLOAD_STATUS; // will cause FATAL unless set
request->bundle_status = INVALID_RHIZOME_BUNDLE_STATUS; // will cause FATAL unless set
if (peerip)
request->http.client_sockaddr_in = *peerip;
request->http.uuid = http_request_uuid_counter;

View File

@ -414,6 +414,8 @@ enum rhizome_bundle_status {
RHIZOME_BUNDLE_STATUS_BUSY = 9, // the database is currently busy
};
// Useful for initialising a variable then checking later that it was set to a
// valid value (typically FATAL if not).
#define INVALID_RHIZOME_BUNDLE_STATUS ((enum rhizome_bundle_status)-2)
const char *rhizome_bundle_status_message(enum rhizome_bundle_status);
@ -431,6 +433,8 @@ enum rhizome_payload_status {
RHIZOME_PAYLOAD_STATUS_EVICTED = 7, // other payloads in our store are more important
};
// Useful for initialising a variable then checking later that it was set to a
// valid value (typically FATAL if not).
#define INVALID_RHIZOME_PAYLOAD_STATUS ((enum rhizome_payload_status)-2)
const char *rhizome_payload_status_message(enum rhizome_payload_status);