diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-05-05 21:01:39 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-05-05 21:01:39 +0000 |
commit | dfaf45ecc89b3f06fe1348350f06bdb63253d355 (patch) | |
tree | 5f8648bef55449135878f8dedbf8d7f8d826ef92 /include | |
parent | 0b5f4d7645bf52ce4f1c4c018dc3fa68317e67ad (diff) |
move ast_carefulwrite from manager.c to utils.c so that cli.c and
res_agi.c no longer depend on manager.h (issue #6397, casper)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@25026 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rw-r--r-- | include/asterisk/manager.h | 2 | ||||
-rw-r--r-- | include/asterisk/utils.h | 11 |
2 files changed, 11 insertions, 2 deletions
diff --git a/include/asterisk/manager.h b/include/asterisk/manager.h index 4541e7f17..71b5a5966 100644 --- a/include/asterisk/manager.h +++ b/include/asterisk/manager.h @@ -81,8 +81,6 @@ struct manager_action { struct manager_action *next; }; -int ast_carefulwrite(int fd, char *s, int len, int timeoutms); - /* External routines may register/unregister manager callbacks this way */ #define ast_manager_register(a, b, c, d) ast_manager_register2(a, b, c, d, NULL) diff --git a/include/asterisk/utils.h b/include/asterisk/utils.h index 9a61f573b..d2db42e07 100644 --- a/include/asterisk/utils.h +++ b/include/asterisk/utils.h @@ -217,6 +217,17 @@ const char *ast_inet_ntoa(char *buf, int bufsiz, struct in_addr ia); int ast_utils_init(void); int ast_wait_for_input(int fd, int ms); +/*! ast_carefulwrite + \brief Try to write string, but wait no more than ms milliseconds + before timing out. + + \note If you are calling ast_carefulwrite, it is assumed that you are calling + it on a file descriptor that _DOES_ have NONBLOCK set. This way, + there is only one system call made to do a write, unless we actually + have a need to wait. This way, we get better performance. +*/ +int ast_carefulwrite(int fd, char *s, int len, int timeoutms); + /*! Compares the source address and port of two sockaddr_in */ static force_inline int inaddrcmp(const struct sockaddr_in *sin1, const struct sockaddr_in *sin2) { |