Lots of errors spotted by Alex fixed, added mutexes to accept & I/O, added
"remote" commands to set ACL, start mirror etc.
This commit is contained in:
10
util.h
10
util.h
@@ -6,7 +6,7 @@
|
||||
|
||||
void error_init();
|
||||
|
||||
void error(int consult_errno, int close_socket, const char* format, ...);
|
||||
void error(int consult_errno, int close_socket, pthread_mutex_t* unlock, const char* format, ...);
|
||||
|
||||
void* xrealloc(void* ptr, size_t size);
|
||||
|
||||
@@ -21,14 +21,14 @@ void* xmalloc(size_t size);
|
||||
#endif
|
||||
|
||||
#define CLIENT_ERROR(msg, ...) \
|
||||
error(0, client->socket, msg, ##__VA_ARGS__)
|
||||
error(0, client->socket, &client->serve->l_io, msg, ##__VA_ARGS__)
|
||||
#define CLIENT_ERROR_ON_FAILURE(test, msg, ...) \
|
||||
if (test < 0) { error(1, client->socket, msg, ##__VA_ARGS__); }
|
||||
if (test < 0) { error(1, client->socket, &client->serve->l_io, msg, ##__VA_ARGS__); }
|
||||
|
||||
#define SERVER_ERROR(msg, ...) \
|
||||
error(0, 0, msg, ##__VA_ARGS__)
|
||||
error(0, 0, NULL, msg, ##__VA_ARGS__)
|
||||
#define SERVER_ERROR_ON_FAILURE(test, msg, ...) \
|
||||
if (test < 0) { error(1, 0, msg, ##__VA_ARGS__); }
|
||||
if (test < 0) { error(1, 0, NULL, msg, ##__VA_ARGS__); }
|
||||
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user