diff options
Diffstat (limited to 'src/include/microhttpd2.h')
-rw-r--r-- | src/include/microhttpd2.h | 66 |
1 files changed, 56 insertions, 10 deletions
diff --git a/src/include/microhttpd2.h b/src/include/microhttpd2.h index f54d16b2..05fa58e9 100644 --- a/src/include/microhttpd2.h +++ b/src/include/microhttpd2.h | |||
@@ -493,6 +493,27 @@ enum MHD_StatusCode | |||
493 | */ | 493 | */ |
494 | MHD_SC_CONNECTION_WRITE_FAIL_CLOSED = 40003, | 494 | MHD_SC_CONNECTION_WRITE_FAIL_CLOSED = 40003, |
495 | 495 | ||
496 | /** | ||
497 | * MHD is returning an error because the header provided | ||
498 | * by the client is too big. | ||
499 | */ | ||
500 | MHD_SC_CLIENT_HEADER_TOO_BIG = 40004, | ||
501 | |||
502 | /** | ||
503 | * An HTTP/1.1 request was sent without the "Host:" header. | ||
504 | */ | ||
505 | MHD_SC_HOST_HEADER_MISSING = 40005, | ||
506 | |||
507 | /** | ||
508 | * The given content length was not a number. | ||
509 | */ | ||
510 | MHD_SC_CONTENT_LENGTH_MALFORMED = 40006, | ||
511 | |||
512 | /** | ||
513 | * The given uploaded, chunked-encoded body was malformed. | ||
514 | */ | ||
515 | MHD_SC_CHUNKED_ENCODING_MALFORMED = 40007, | ||
516 | |||
496 | 517 | ||
497 | 518 | ||
498 | /* 50000-level errors are because of an error internal | 519 | /* 50000-level errors are because of an error internal |
@@ -782,6 +803,18 @@ enum MHD_StatusCode | |||
782 | */ | 803 | */ |
783 | MHD_SC_STATEMACHINE_FAILURE_CONNECTION_CLOSED = 50054, | 804 | MHD_SC_STATEMACHINE_FAILURE_CONNECTION_CLOSED = 50054, |
784 | 805 | ||
806 | /** | ||
807 | * Failed to allocate memory in connection's pool | ||
808 | * to parse the cookie header. | ||
809 | */ | ||
810 | MHD_SC_COOKIE_POOL_ALLOCATION_FAILURE = 50055, | ||
811 | |||
812 | /** | ||
813 | * MHD failed to build the response header. | ||
814 | */ | ||
815 | MHD_SC_FAILED_RESPONSE_HEADER_GENERATION = 50056, | ||
816 | |||
817 | |||
785 | 818 | ||
786 | /* 60000-level errors are because the application | 819 | /* 60000-level errors are because the application |
787 | logic did something wrong or generated an error. */ | 820 | logic did something wrong or generated an error. */ |
@@ -820,6 +853,19 @@ enum MHD_StatusCode | |||
820 | */ | 853 | */ |
821 | MHD_SC_APPLICATION_DATA_GENERATION_FAILURE_CLOSED = 60005, | 854 | MHD_SC_APPLICATION_DATA_GENERATION_FAILURE_CLOSED = 60005, |
822 | 855 | ||
856 | /** | ||
857 | * MHD is closing a connection because the application | ||
858 | * callback told it to do so. | ||
859 | */ | ||
860 | MHD_SC_APPLICATION_CALLBACK_FAILURE_CLOSED = 60006, | ||
861 | |||
862 | /** | ||
863 | * Application only partially processed upload and did | ||
864 | * not suspend connection. This may result in a hung | ||
865 | * connection. | ||
866 | */ | ||
867 | MHD_SC_APPLICATION_HUNG_CONNECTION = 60007, | ||
868 | |||
823 | 869 | ||
824 | }; | 870 | }; |
825 | 871 | ||
@@ -1409,7 +1455,7 @@ enum MHD_Method | |||
1409 | * if the socket must be closed due to a serios | 1455 | * if the socket must be closed due to a serios |
1410 | * error while handling the request | 1456 | * error while handling the request |
1411 | */ | 1457 | */ |
1412 | typedef struct MHD_Action * | 1458 | typedef const struct MHD_Action * |
1413 | (*MHD_RequestCallback) (void *cls, | 1459 | (*MHD_RequestCallback) (void *cls, |
1414 | struct MHD_Request *request, | 1460 | struct MHD_Request *request, |
1415 | const char *url, | 1461 | const char *url, |
@@ -2791,7 +2837,7 @@ MHD_get_reason_phrase_for (enum MHD_HTTP_StatusCode code); | |||
2791 | * | 2837 | * |
2792 | * @return action to cause a request to be suspended. | 2838 | * @return action to cause a request to be suspended. |
2793 | */ | 2839 | */ |
2794 | _MHD_EXTERN struct MHD_Action * | 2840 | _MHD_EXTERN const struct MHD_Action * |
2795 | MHD_action_suspend (void); | 2841 | MHD_action_suspend (void); |
2796 | 2842 | ||
2797 | 2843 | ||
@@ -2826,10 +2872,10 @@ struct MHD_Response; | |||
2826 | 2872 | ||
2827 | 2873 | ||
2828 | /** | 2874 | /** |
2829 | * Converts a @a response to an action. If @a consume | 2875 | * Converts a @a response to an action. If @a destroy_after_use |
2830 | * is set, the reference to the @a response is consumed | 2876 | * is set, the reference to the @a response is consumed |
2831 | * by the conversion. If @a consume is #MHD_NO, then | 2877 | * by the conversion. If @a consume is #MHD_NO, then |
2832 | * the response can be converted to actions in the future. | 2878 | * the @a response can be converted to actions in the future. |
2833 | * However, the @a response is frozen by this step and | 2879 | * However, the @a response is frozen by this step and |
2834 | * must no longer be modified (i.e. by setting headers). | 2880 | * must no longer be modified (i.e. by setting headers). |
2835 | * | 2881 | * |
@@ -2842,7 +2888,7 @@ struct MHD_Response; | |||
2842 | * as a response *is* an action. As no memory is | 2888 | * as a response *is* an action. As no memory is |
2843 | * allocated, this operation cannot fail. | 2889 | * allocated, this operation cannot fail. |
2844 | */ | 2890 | */ |
2845 | _MHD_EXTERN struct MHD_Action * | 2891 | _MHD_EXTERN const struct MHD_Action * |
2846 | MHD_action_from_response (struct MHD_Response *response, | 2892 | MHD_action_from_response (struct MHD_Response *response, |
2847 | enum MHD_Bool destroy_after_use) | 2893 | enum MHD_Bool destroy_after_use) |
2848 | MHD_NONNULL(1); | 2894 | MHD_NONNULL(1); |
@@ -3364,7 +3410,7 @@ MHD_response_get_header (struct MHD_Response *response, | |||
3364 | * | 3410 | * |
3365 | * @return action operation, never NULL | 3411 | * @return action operation, never NULL |
3366 | */ | 3412 | */ |
3367 | _MHD_EXTERN struct MHD_Action * | 3413 | _MHD_EXTERN const struct MHD_Action * |
3368 | MHD_action_continue (void); | 3414 | MHD_action_continue (void); |
3369 | 3415 | ||
3370 | 3416 | ||
@@ -3386,7 +3432,7 @@ MHD_action_continue (void); | |||
3386 | * NULL to close the socket, or a response | 3432 | * NULL to close the socket, or a response |
3387 | * to discard the rest of the upload and return the data given | 3433 | * to discard the rest of the upload and return the data given |
3388 | */ | 3434 | */ |
3389 | typedef struct MHD_Action * | 3435 | typedef const struct MHD_Action * |
3390 | (*MHD_UploadCallback) (void *cls, | 3436 | (*MHD_UploadCallback) (void *cls, |
3391 | const char *upload_data, | 3437 | const char *upload_data, |
3392 | size_t *upload_data_size); | 3438 | size_t *upload_data_size); |
@@ -3400,7 +3446,7 @@ typedef struct MHD_Action * | |||
3400 | * @return NULL on error (out of memory) | 3446 | * @return NULL on error (out of memory) |
3401 | * @ingroup action | 3447 | * @ingroup action |
3402 | */ | 3448 | */ |
3403 | _MHD_EXTERN struct MHD_Action * | 3449 | _MHD_EXTERN const struct MHD_Action * |
3404 | MHD_action_process_upload (MHD_UploadCallback uc, | 3450 | MHD_action_process_upload (MHD_UploadCallback uc, |
3405 | void *uc_cls) | 3451 | void *uc_cls) |
3406 | MHD_NONNULL(1); | 3452 | MHD_NONNULL(1); |
@@ -3429,7 +3475,7 @@ MHD_action_process_upload (MHD_UploadCallback uc, | |||
3429 | * NULL to close the socket, or a response | 3475 | * NULL to close the socket, or a response |
3430 | * to discard the rest of the upload and return the data given | 3476 | * to discard the rest of the upload and return the data given |
3431 | */ | 3477 | */ |
3432 | typedef struct MHD_Action * | 3478 | typedef const struct MHD_Action * |
3433 | (*MHD_PostDataIterator) (void *cls, | 3479 | (*MHD_PostDataIterator) (void *cls, |
3434 | enum MHD_ValueKind kind, | 3480 | enum MHD_ValueKind kind, |
3435 | const char *key, | 3481 | const char *key, |
@@ -3465,7 +3511,7 @@ typedef struct MHD_Action * | |||
3465 | * otherwise a PP handle | 3511 | * otherwise a PP handle |
3466 | * @ingroup request | 3512 | * @ingroup request |
3467 | */ | 3513 | */ |
3468 | _MHD_EXTERN struct MHD_Action * | 3514 | _MHD_EXTERN const struct MHD_Action * |
3469 | MHD_action_parse_post (size_t buffer_size, | 3515 | MHD_action_parse_post (size_t buffer_size, |
3470 | MHD_PostDataIterator iter, | 3516 | MHD_PostDataIterator iter, |
3471 | void *iter_cls) | 3517 | void *iter_cls) |