Commits

Anonymous committed b3d5c48

updates for boost-1.42/snow leopard

  • Participants
  • Parent commits ef0dd0a

Comments (0)

Files changed (3)

 src/tinymq.d \
 src/durable_store.d
 
-LIBS := -lboost_thread-xgcc40-mt -lboost_system-xgcc40-mt -lboost_program_options-xgcc40-mt -lboost_filesystem-xgcc40-mt 
-CFLAGS := -I/usr/local/include/boost-1_38 -Iextlib -O0 -gdwarf-2 -Wall 
+BOOST_PREFIX=/opt/local
+
+LIBS := -L$(BOOST_PREFIX)/lib -lboost_thread-mt -lboost_system-mt -lboost_program_options-mt -lboost_filesystem-mt 
+CFLAGS := -I$(BOOST_PREFIX)/include -Iextlib -O0 -gdwarf-2 -Wall 
 all: tinymq
 
 tinymq: $(OBJS)

client/tinymq_client.py

 
     def get(self):
         self._send("I", self.GET)
-        msg_id, = self._recv(8, "Q")
-        msg_len, = self._recv(4, "L")
+        msg_id, = self._recv(8, "L")
+        msg_len, = self._recv(4, "I")
         recvd = 0
         buf = []
         while (recvd < msg_len):
     c = tinymq_client("127.0.0.1", 5673)
     c.connect()
     msg = "a"*1024
-    for i in range(0, 1000):
+    for i in range(0, 10000):
         print c.put(msg)
     for i in range(0, 10000):
         msg_id, msg_data = c.get()

src/connection.cpp

     if (!curmsg_) wait();
     else {
         const message_header& hdr(curmsg_->header());
-        boost::array<a::const_buffer, 3> bufs = {
+        boost::array<a::const_buffer, 3> bufs = {{
             a::buffer((void*)&hdr.id, sizeof(message_id)),
             a::buffer((void*)&hdr.len, sizeof(message_len_t)),
             a::buffer((void*)&curmsg_->data()->front(), curmsg_->size())
-        };
+            }};
         a::async_write(socket_, bufs,
                 boost::bind(&connection::handle_write, shared_from_this(),
                         a::placeholders::error,