Skip to content

Commit

Permalink
Propagate changes from the dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
rescrv committed Jul 24, 2015
1 parent caefa05 commit 12ba4b2
Show file tree
Hide file tree
Showing 22 changed files with 129 additions and 212 deletions.
3 changes: 2 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,7 @@ libhyperdex_admin_la_LIBADD += $(MACAROONS_LIBS)
libhyperdex_admin_la_LIBADD += $(REPLICANT_LIBS)
libhyperdex_admin_la_LIBADD += $(BUSYBEE_LIBS)
libhyperdex_admin_la_LIBADD += $(E_LIBS)
libhyperdex_admin_la_LIBADD += $(PO6_LIBS)
libhyperdex_admin_la_LIBADD += -lrt -lpthread
libhyperdex_admin_la_LDFLAGS = -version-info 1:0:0

Expand Down Expand Up @@ -1193,7 +1194,7 @@ EXTRA_DIST += man/hyperdex.1.md
EXTRA_DIST += man/hyperdex.1.h2m
hyperdex_SOURCES = hyperdex.cc
hyperdex_CPPFLAGS = -DHYPERDEX_EXEC_DIR=\""$(hyperdexexecdir)\"" $(AM_CPPFLAGS) $(CPPFLAGS)
hyperdex_LDADD = $(POPT_LIBS)
hyperdex_LDADD = $(E_LIBS) $(PO6_LIBS) $(POPT_LIBS)
man/hyperdex.1: man/hyperdex.1.h2m hyperdex.cc | hyperdex$(EXEEXT)
$(help2man_verbose)help2man $(HELP2MAN_FLAGS) --section 1 --output $@ --include $< ${abs_top_builddir}/hyperdex$(EXEEXT)

Expand Down
11 changes: 1 addition & 10 deletions admin/admin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -450,16 +450,7 @@ admin :: server_register(uint64_t token, const char* address,

server_id sid(token);
po6::net::location loc;

try
{
loc = po6::net::location(address);
}
catch (po6::error& e)
{
ERROR(TIMEOUT) << "could not parse address";
return -1;
}
loc = po6::net::location(address);

int64_t id = m_next_admin_id;
++m_next_admin_id;
Expand Down
11 changes: 0 additions & 11 deletions admin/c.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,6 @@ inline void return_void() {}
{ \
X \
} \
catch (po6::error& e) \
{ \
errno = e; \
*status = HYPERDEX_ADMIN_EXCEPTION; \
return -1; \
} \
catch (std::bad_alloc& ba) \
{ \
errno = ENOMEM; \
Expand All @@ -94,11 +88,6 @@ hyperdex_admin_create(const char* coordinator, uint16_t port)
{
return reinterpret_cast<struct hyperdex_admin*>(new hyperdex::admin(coordinator, port));
}
catch (po6::error& e)
{
errno = e;
return NULL;
}
catch (std::bad_alloc& ba)
{
errno = ENOMEM;
Expand Down
27 changes: 3 additions & 24 deletions admin/pending_perf_counters.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@

#define __STDC_LIMIT_MACROS

// e
#include <e/time.h>
// po6
#include <po6/time.h>

// HyperDex
#include "admin/admin.h"
Expand All @@ -37,27 +37,6 @@

using hyperdex::pending_perf_counters;

#if defined(__APPLE__)
#include <mach/mach_time.h>
#endif

static uint64_t
monotonic_time()
{
#ifdef __APPLE__
return e::time();
#else
timespec ts;

if (clock_gettime(CLOCK_MONOTONIC, &ts) < 0)
{
throw po6::error(errno);
}

return ts.tv_sec * 1000000000ULL + ts.tv_nsec;
#endif
}

struct pending_perf_counters::perf_counter
{
perf_counter(uint64_t i, uint64_t t, const std::string& p, uint64_t m)
Expand Down Expand Up @@ -150,7 +129,7 @@ int
pending_perf_counters :: millis_to_next_send()
{
const uint64_t one_second = 1000ULL * 1000ULL * 1000ULL;
uint64_t now = monotonic_time();
uint64_t now = po6::monotonic_time();

if (now >= m_next_send)
{
Expand Down
6 changes: 0 additions & 6 deletions admin/raw_backup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,6 @@ hyperdex_admin_raw_backup(const char* host, uint16_t port,
return -1;
}
}
catch (po6::error& e)
{
errno = e;
*status = HYPERDEX_ADMIN_EXCEPTION;
return -1;
}
catch (std::bad_alloc& ba)
{
errno = ENOMEM;
Expand Down
24 changes: 0 additions & 24 deletions client/c.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,6 @@ inline void return_void() {}
{ \
X \
} \
catch (po6::error& e) \
{ \
errno = e; \
*status = HYPERDEX_CLIENT_EXCEPTION; \
cl->set_error_message("unhandled exception was thrown"); \
return -1; \
} \
catch (std::bad_alloc& ba) \
{ \
errno = ENOMEM; \
Expand Down Expand Up @@ -99,11 +92,6 @@ hyperdex_client_create(const char* coordinator, uint16_t port)
{
return reinterpret_cast<hyperdex_client*>(new hyperdex::client(coordinator, port));
}
catch (po6::error& e)
{
errno = e;
return NULL;
}
catch (std::bad_alloc& ba)
{
errno = ENOMEM;
Expand All @@ -124,11 +112,6 @@ hyperdex_client_create_conn_str(const char* conn_str)
{
return reinterpret_cast<hyperdex_client*>(new hyperdex::client(conn_str));
}
catch (po6::error& e)
{
errno = e;
return NULL;
}
catch (std::bad_alloc& ba)
{
errno = ENOMEM;
Expand Down Expand Up @@ -213,13 +196,6 @@ hyperdex_client_attribute_type(hyperdex_client* _cl,
{
return cl->attribute_type(space, name, status);
}
catch (po6::error& e)
{
errno = e;
*status = HYPERDEX_CLIENT_EXCEPTION;
cl->set_error_message("unhandled exception was thrown");
return HYPERDATATYPE_GARBAGE;
}
catch (std::bad_alloc& ba)
{
errno = ENOMEM;
Expand Down
6 changes: 4 additions & 2 deletions client/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ struct microtransaction
: space(space_), sc(sc_), status(status_), funcalls(), memory()
{}

PO6_NONCOPYABLE(microtransaction);

int64_t generate_message(size_t header_sz, size_t footer_sz,
const std::vector<attribute_check>& checks,
std::auto_ptr<e::buffer>* msg);
Expand All @@ -69,6 +67,10 @@ struct microtransaction
hyperdex_client_returncode* status;
std::vector<funcall> funcalls;
e::arena memory;

private:
microtransaction(const microtransaction&);
microtransaction& operator = (const microtransaction&);
};

class client
Expand Down
8 changes: 4 additions & 4 deletions daemon/auth.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.

// e
#include <e/time.h>
// po6
#include <po6/time.h>

// HyperDex
#include <hyperdex/client.h>
Expand Down Expand Up @@ -173,7 +173,7 @@ hyperdex :: auth_verify_read(const schema& sc,
auth_wallet* aw)
{
const char* exact[] = {"op = read", NULL};
uint64_t time = e::time() / 1000000000ULL;
uint64_t time = po6::time() / 1000000000ULL;
general_caveat general[] = {general_caveat(check_time, &time), general_caveat()};
return auth_verify(sc, has_value, value, aw, exact, general);
}
Expand Down Expand Up @@ -214,7 +214,7 @@ hyperdex :: auth_verify_write(const schema& sc,
else
{
const char* exact[] = {"op = write", NULL};
uint64_t time = e::time() / 1000000000ULL;
uint64_t time = po6::time() / 1000000000ULL;
general_caveat general[] = {general_caveat(check_time, &time), general_caveat()};
return auth_verify(sc, has_value, value, kc.auth.get(), exact, general);
}
Expand Down
Loading

0 comments on commit 12ba4b2

Please sign in to comment.