Commit ad889d0b authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 6906344b
...@@ -23,11 +23,10 @@ ...@@ -23,11 +23,10 @@
# XXX doc # XXX doc
from golang cimport error, refptr from golang cimport string, error, refptr
from golang cimport context from golang cimport context
from libcpp cimport nullptr_t, nullptr as nil from libcpp cimport nullptr_t, nullptr as nil
from libcpp.string cimport string
from libcpp.utility cimport pair from libcpp.utility cimport pair
cdef extern from *: cdef extern from *:
ctypedef bint cbool "bool" ctypedef bint cbool "bool"
...@@ -64,6 +63,7 @@ cdef extern from "wcfs_watchlink.h" nogil: ...@@ -64,6 +63,7 @@ cdef extern from "wcfs_watchlink.h" nogil:
Oid foid Oid foid
int64_t blk int64_t blk
Tid at Tid at
string msg
cdef extern from "wcfs.h" nogil: cdef extern from "wcfs.h" nogil:
...@@ -152,6 +152,11 @@ cdef class PyPinReq: ...@@ -152,6 +152,11 @@ cdef class PyPinReq:
return None return None
return at # XXX -> tid bytes return at # XXX -> tid bytes
# wcfs_test.py uses req.msg in several places
property msg:
def __get__(PyPinReq pypin):
return pypin.pinreq.msg
# ---- misc ---- # ---- misc ----
......
...@@ -319,7 +319,6 @@ error _WatchLink::recvReq(context::Context ctx, PinReq *prx) { ...@@ -319,7 +319,6 @@ error _WatchLink::recvReq(context::Context ctx, PinReq *prx) {
if (!ok) if (!ok)
return io::EOF_; return io::EOF_;
//pkt.to_string();
return _parsePinReq(prx, &pkt); return _parsePinReq(prx, &pkt);
} }
...@@ -329,6 +328,7 @@ static error _parsePinReq(PinReq *pin, const rxPkt *pkt) { ...@@ -329,6 +328,7 @@ static error _parsePinReq(PinReq *pin, const rxPkt *pkt) {
printf("parse pinreq: stream=%lu msg='%s'\n", pkt->stream, &pkt->data[0]); printf("parse pinreq: stream=%lu msg='%s'\n", pkt->stream, &pkt->data[0]);
pin->stream = pkt->stream; pin->stream = pkt->stream;
string msg = pkt->to_string(); string msg = pkt->to_string();
pin->msg = msg;
printf("'%s'\n", msg.c_str()); printf("'%s'\n", msg.c_str());
printf("has_prefix: %i\n", strings::has_prefix(msg, "pin ")); printf("has_prefix: %i\n", strings::has_prefix(msg, "pin "));
......
...@@ -117,6 +117,8 @@ struct PinReq { ...@@ -117,6 +117,8 @@ struct PinReq {
zodb::Oid foid; // request is about this file zodb::Oid foid; // request is about this file
int64_t blk; // ----//---- about this block int64_t blk; // ----//---- about this block
zodb::Tid at; // pin to this at; TidHead means unpin to head zodb::Tid at; // pin to this at; TidHead means unpin to head
string msg; // XXX raw message for tests (TODO kill)
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment