Use client stop signals for thread stopping
This commit is contained in:
10
src/util.h
10
src/util.h
@@ -6,7 +6,7 @@
|
||||
|
||||
void error_init();
|
||||
|
||||
void error(int consult_errno, int close_socket, pthread_mutex_t* unlock, const char* format, ...);
|
||||
void error(int consult_errno, int fatal, int close_socket, pthread_mutex_t* unlock, const char* format, ...);
|
||||
|
||||
void* xrealloc(void* ptr, size_t size);
|
||||
|
||||
@@ -21,14 +21,14 @@ void debug(const char*msg, ...);
|
||||
#endif
|
||||
|
||||
#define CLIENT_ERROR(msg, ...) \
|
||||
error(0, client->socket, &client->serve->l_io, msg, ##__VA_ARGS__)
|
||||
error(0, 0, client->socket, &client->serve->l_io, msg, ##__VA_ARGS__)
|
||||
#define CLIENT_ERROR_ON_FAILURE(test, msg, ...) \
|
||||
if (test < 0) { error(1, client->socket, &client->serve->l_io, msg, ##__VA_ARGS__); }
|
||||
if (test < 0) { error(1, 0, client->socket, &client->serve->l_io, msg, ##__VA_ARGS__); }
|
||||
|
||||
#define SERVER_ERROR(msg, ...) \
|
||||
error(0, 0, NULL, msg, ##__VA_ARGS__)
|
||||
error(0, 1, 0, NULL, msg, ##__VA_ARGS__)
|
||||
#define SERVER_ERROR_ON_FAILURE(test, msg, ...) \
|
||||
if (test < 0) { error(1, 0, NULL, msg, ##__VA_ARGS__); }
|
||||
if (test < 0) { error(1, 1, 0, NULL, msg, ##__VA_ARGS__); }
|
||||
|
||||
|
||||
#define NULLCHECK(x); if ( NULL == (x) ) { SERVER_ERROR( "Null " #x "." ); }
|
||||
|
Reference in New Issue
Block a user