diff options
Diffstat (limited to 'src/h.c')
-rw-r--r-- | src/h.c | 29 |
1 files changed, 15 insertions, 14 deletions
@@ -17,18 +17,18 @@ /* it's strongly recommended to calloc structs during initialization. */ enum dc_status { /* theese are flags and should be and-checked */ DC_UNSET = 0, /* default value when enum is calloced */ - DC_INCOMPLETE = 1 << 1, /* struct SHALL NOT be used by the ui, it is yet to be filled by api */ - DC_OK = 1 << 2, /* success status, api usually sets this after completion/filling of the strct */ - DC_BAD_LOGIN = 1 << 3, /* login failed */ - DC_VERIFICATION_NEEDED = 1 << 4, /* login: check email, click link/reg: tough luck ur IP flagd */ - DC_CAPTCHA_NEEDED = 1 << 5, /* must solve captcha, tough luck, not impl, use browser login */ - DC_BAD_USERNAME = 1 << 6, /* provided username can't be registered */ - DC_BAD_EMAIL = 1 << 7, /* provided email can't be registered */ - DC_NOT_FOUND = 1 << 8, /* when querying for roles/users/... received a 404 */ - DC_CONTINUE = 1 << 9, /* attached handlers return this to continue processing this output, N/I */ - DC_BREAK = 1 << 10, /* attached handlers return this to stop processing this output */ - DC_BODY_SENT = 1 << 11, /* LWS already sent body, it's now time to send _FINAL for H2 */ - DC_MUST_FREE = 1 << 12 /* cb pass: body must be freed when request is done with user_data */ + DC_INCOMPLETE = 1 << 0, /* struct SHALL NOT be used by the ui, it is yet to be filled by api */ + DC_OK = 1 << 1, /* success status, api usually sets this after completion/filling of the strct */ + DC_BAD_LOGIN = 1 << 2, /* login failed */ + DC_VERIFICATION_NEEDED = 1 << 3, /* login: check email, click link/reg: tough luck ur IP flagd */ + DC_CAPTCHA_NEEDED = 1 << 4, /* must solve captcha, tough luck, not impl, use browser login */ + DC_BAD_USERNAME = 1 << 5, /* provided username can't be registered */ + DC_BAD_EMAIL = 1 << 6, /* provided email can't be registered */ + DC_NOT_FOUND = 1 << 7, /* when querying for roles/users/... received a 404 */ + DC_CONTINUE = 1 << 8, /* attached handlers return this to continue processing this output, N/I */ + DC_BREAK = 1 << 9, /* attached handlers return this to stop processing this output */ + DC_FROM_LWS = 1 << 10, /* LWS cb is the caller, so do not attempt to do lws_service (loop) */ + DC_MUST_FREE = 1 << 11 /* cb pass: body must be freed when request is done with user_data */ }; enum dc_permissions { /* other permissions exist, but are not implemented/understood */ DC_ALL_PERMISSIONS = 1 << 3, /* this is incredibly retarded, why is this SEPARATE?!? - admins */ @@ -96,11 +96,12 @@ void dc_api_io_free (struct dc_api_io * s) { free(s); return; } +void dc_api_i (struct dc_api_io); enum dc_lws_headers { DC_LWS_AUTHORIZATION, DC_LWS_HEADERS_LENGTH -} -char dc_lws_headers[][] = { +}; +char * dc_lws_headers[] = { "Authorization:", }; struct dc_lws_pass { /* struct that is allocated for in dc_lws_cb unique per connection in void * us */ |