Lines Matching refs:connection
93 struct MHD_Connection *connection, in request_meta_free() argument
267 struct MHD_Connection *connection) { in request_parse_accept() argument
272 assert(connection); in request_parse_accept()
274 header = MHD_lookup_connection_value(connection, MHD_HEADER_KIND, "Accept"); in request_parse_accept()
294 struct MHD_Connection *connection) { in request_parse_range() argument
300 assert(connection); in request_parse_range()
302 range = MHD_lookup_connection_value(connection, MHD_HEADER_KIND, "Range"); in request_parse_range()
454 struct MHD_Connection *connection) { in request_parse_arguments() argument
457 assert(connection); in request_parse_arguments()
460 … MHD_get_connection_values(connection, MHD_GET_ARGUMENT_KIND, request_parse_arguments_iterator, m); in request_parse_arguments()
466 struct MHD_Connection *connection, in request_handler_entries() argument
473 assert(connection); in request_handler_entries()
478 … return mhd_respondf(connection, r, MHD_HTTP_INTERNAL_SERVER_ERROR, "Failed to open journal: %m"); in request_handler_entries()
480 if (request_parse_accept(m, connection) < 0) in request_handler_entries()
481 … return mhd_respond(connection, MHD_HTTP_BAD_REQUEST, "Failed to parse Accept header."); in request_handler_entries()
483 if (request_parse_range(m, connection) < 0) in request_handler_entries()
484 … return mhd_respond(connection, MHD_HTTP_BAD_REQUEST, "Failed to parse Range header."); in request_handler_entries()
486 if (request_parse_arguments(m, connection) < 0) in request_handler_entries()
487 … return mhd_respond(connection, MHD_HTTP_BAD_REQUEST, "Failed to parse URL arguments."); in request_handler_entries()
491 …return mhd_respond(connection, MHD_HTTP_BAD_REQUEST, "Discrete seeks require a cursor specificatio… in request_handler_entries()
504 return mhd_respond(connection, MHD_HTTP_BAD_REQUEST, "Failed to seek in journal."); in request_handler_entries()
508 return respond_oom(connection); in request_handler_entries()
511 return respond_oom(connection); in request_handler_entries()
513 return MHD_queue_response(connection, MHD_HTTP_OK, response); in request_handler_entries()
614 struct MHD_Connection *connection, in request_handler_fields() argument
622 assert(connection); in request_handler_fields()
627 … return mhd_respondf(connection, r, MHD_HTTP_INTERNAL_SERVER_ERROR, "Failed to open journal: %m"); in request_handler_fields()
629 if (request_parse_accept(m, connection) < 0) in request_handler_fields()
630 … return mhd_respond(connection, MHD_HTTP_BAD_REQUEST, "Failed to parse Accept header."); in request_handler_fields()
634 … return mhd_respond(connection, MHD_HTTP_BAD_REQUEST, "Failed to query unique fields."); in request_handler_fields()
638 return respond_oom(connection); in request_handler_fields()
641 return respond_oom(connection); in request_handler_fields()
643 return MHD_queue_response(connection, MHD_HTTP_OK, response); in request_handler_fields()
647 struct MHD_Connection *connection, in request_handler_redirect() argument
653 assert(connection); in request_handler_redirect()
657 return respond_oom(connection); in request_handler_redirect()
661 return respond_oom(connection); in request_handler_redirect()
666 return respond_oom(connection); in request_handler_redirect()
668 return MHD_queue_response(connection, MHD_HTTP_MOVED_PERMANENTLY, response); in request_handler_redirect()
672 struct MHD_Connection *connection, in request_handler_file() argument
680 assert(connection); in request_handler_file()
686 … return mhd_respondf(connection, errno, MHD_HTTP_NOT_FOUND, "Failed to open file %s: %m", path); in request_handler_file()
689 … return mhd_respondf(connection, errno, MHD_HTTP_INTERNAL_SERVER_ERROR, "Failed to stat file: %m"); in request_handler_file()
693 return respond_oom(connection); in request_handler_file()
697 return respond_oom(connection); in request_handler_file()
699 return MHD_queue_response(connection, MHD_HTTP_OK, response); in request_handler_file()
733 struct MHD_Connection *connection, in request_handler_machine() argument
744 assert(connection); in request_handler_machine()
749 … return mhd_respondf(connection, r, MHD_HTTP_INTERNAL_SERVER_ERROR, "Failed to open journal: %m"); in request_handler_machine()
753 …return mhd_respondf(connection, r, MHD_HTTP_INTERNAL_SERVER_ERROR, "Failed to determine machine ID… in request_handler_machine()
757 …return mhd_respondf(connection, r, MHD_HTTP_INTERNAL_SERVER_ERROR, "Failed to determine boot ID: %… in request_handler_machine()
761 return respond_oom(connection); in request_handler_machine()
765 …return mhd_respondf(connection, r, MHD_HTTP_INTERNAL_SERVER_ERROR, "Failed to determine disk usage… in request_handler_machine()
769 …return mhd_respondf(connection, r, MHD_HTTP_INTERNAL_SERVER_ERROR, "Failed to determine disk usage… in request_handler_machine()
792 return respond_oom(connection); in request_handler_machine()
796 return respond_oom(connection); in request_handler_machine()
800 return respond_oom(connection); in request_handler_machine()
802 return MHD_queue_response(connection, MHD_HTTP_OK, response); in request_handler_machine()
807 struct MHD_Connection *connection, in request_handler() argument
816 assert(connection); in request_handler()
822 return mhd_respond(connection, MHD_HTTP_NOT_ACCEPTABLE, "Unsupported method."); in request_handler()
826 return respond_oom(connection); in request_handler()
831 r = check_permissions(connection, &code, NULL); in request_handler()
837 return request_handler_redirect(connection, "/browse"); in request_handler()
840 return request_handler_entries(connection, *connection_cls); in request_handler()
843 return request_handler_fields(connection, url + 8, *connection_cls); in request_handler()
846 return request_handler_file(connection, DOCUMENT_ROOT "/browse.html", "text/html"); in request_handler()
849 return request_handler_machine(connection, *connection_cls); in request_handler()
851 return mhd_respond(connection, MHD_HTTP_NOT_FOUND, "Not found."); in request_handler()