diff options
author | Mattias Andrée <maandree@operamail.com> | 2015-08-24 17:39:23 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2015-08-24 17:41:04 +0200 |
commit | 55689e21c0b84cd398de2f852209cfa6dc3aa158 (patch) | |
tree | 021d87afcf232067b91b1531a64077e99680cf69 /src/libmdsserver/util.h | |
parent | libmdsserver: style (diff) | |
download | mds-55689e21c0b84cd398de2f852209cfa6dc3aa158.tar.gz mds-55689e21c0b84cd398de2f852209cfa6dc3aa158.tar.bz2 mds-55689e21c0b84cd398de2f852209cfa6dc3aa158.tar.xz |
style + error messages should include message id + fix buffer overflow
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r-- | src/libmdsserver/util.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/libmdsserver/util.h b/src/libmdsserver/util.h index cd091d4..9ac0357 100644 --- a/src/libmdsserver/util.h +++ b/src/libmdsserver/util.h @@ -400,11 +400,13 @@ int verify_utf8(const char* string, int allow_modified_nul) __attribute__((pure) * @param send_buffer_size Pointer to the allocation size of `*send_buffer`, it should * contain the current size of `*send_buffer` and will be updated * with the new size, must not be `NULL` + * @param message_id The message ID of this message * @return The length of the message, zero on error */ size_t construct_error_message(const char* restrict recv_client_id, const char* restrict recv_message_id, - int custom, int errnum, const char* restrict message, char** restrict send_buffer, - size_t* restrict send_buffer_size) __attribute__((nonnull(1, 2, 6, 7))); + int custom, int errnum, const char* restrict message, + char** restrict send_buffer, size_t* restrict send_buffer_size, + uint32_t message_id) __attribute__((nonnull(1, 2, 6, 7))); /** * Send an error message @@ -426,12 +428,14 @@ size_t construct_error_message(const char* restrict recv_client_id, const char* * @param send_buffer_size Pointer to the allocation size of `*send_buffer`, it should * contain the current size of `*send_buffer` and will be updated * with the new size, must not be `NULL` + * @param message_id The message ID of this message * @param socket_fd The file descriptor of the socket * @return Zero on success, -1 on error */ int send_error(const char* restrict recv_client_id, const char* restrict recv_message_id, int custom, int errnum, const char* restrict message, char** restrict send_buffer, - size_t* restrict send_buffer_size, int socket_fd) __attribute__((nonnull(1, 2, 6, 7))); + size_t* restrict send_buffer_size, uint32_t message_id, + int socket_fd) __attribute__((nonnull(1, 2, 6, 7))); #endif |