5 #include "cvmfs_config.h"
22 assert(message.length() > 0);
25 for (map<shash::Md5, int>::iterator i = back_channels_.begin(),
26 iend = back_channels_.end(); i != iend; )
29 message.c_str(), i->first.ToString().c_str());
30 int written = write(i->second, message.data(), message.length());
31 if (written < 0) written = 0;
32 if (static_cast<unsigned>(written) != message.length()) {
33 bool remove_backchannel = errno != EAGAIN;
35 "failed to broadcast '%s' to %s (written %d, error %d)",
36 message.c_str(), i->first.ToString().c_str(), written, errno);
37 if (remove_backchannel) {
39 "removing back channel %s", i->first.ToString().c_str());
40 map<shash::Md5, int>::iterator remove_me = i;
42 close(remove_me->second);
43 back_channels_.erase(remove_me);
56 reinterpret_cast<pthread_mutex_t *
>(smalloc(
sizeof(pthread_mutex_t)));
pthread_mutex_t * lock_back_channels_
void BroadcastBackchannels(const std::string &message)
static const uint32_t kProtocolRevision
assert((mem||(size==0))&&"Out Of Memory")
std::map< shash::Md5, int > back_channels_
CVMFS_EXPORT void LogCvmfs(const LogSource source, const int mask, const char *format,...)