mirror of
https://github.com/civetweb/civetweb
synced 2025-03-28 21:13:27 +00:00

The "struct mg_error_data" is used to return error information. It is used only in functions marked as "experimental", and was never fully implemented. In particular, there was a pointer "code". The latest release did not do anything useful with this pointer: it was set to 0 once, and neigher read nor written later. It is only additional complexity with no benefit to have a pointer here instead of a value. Therefore this experimental interface has been modified to provide a value. Now the civetweb.c code will set mg_error_data.code to a reasonable error code. The values of all error codes have been defined in civetweb.h as MG_ERROR_DATA_CODE_* In addition to "code" there is also a new member "code_sub". The interpretation of this value depends on "code". In combination "code" and "code_sub" should provide enough error information, embedding code cound use it for language specific error messages.