Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
ca5e34cd
Commit
ca5e34cd
authored
Mar 29, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
3725aa97
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
wcfs/wcfs.go
wcfs/wcfs.go
+4
-4
No files found.
wcfs/wcfs.go
View file @
ca5e34cd
...
@@ -1245,7 +1245,7 @@ retry:
...
@@ -1245,7 +1245,7 @@ retry:
// XXX place=ok?
// XXX place=ok?
func
(
w
*
FileWatch
)
pin
(
ctx
context
.
Context
,
blk
int64
,
rev
zodb
.
Tid
)
(
err
error
)
{
func
(
w
*
FileWatch
)
pin
(
ctx
context
.
Context
,
blk
int64
,
rev
zodb
.
Tid
)
(
err
error
)
{
foid
:=
w
.
file
.
zfile
.
POid
()
foid
:=
w
.
file
.
zfile
.
POid
()
defer
xerr
.
Contextf
(
&
err
,
"f<%s>: watch%d: pin #
blk
@%s"
,
foid
,
w
.
link
.
id
,
blk
,
rev
)
defer
xerr
.
Contextf
(
&
err
,
"f<%s>: watch%d: pin #
%d
@%s"
,
foid
,
w
.
link
.
id
,
blk
,
rev
)
// XXX locking?
// XXX locking?
// XXX simultaneous calls?
// XXX simultaneous calls?
...
@@ -1262,7 +1262,7 @@ func (w *FileWatch) pin(ctx context.Context, blk int64, rev zodb.Tid) (err error
...
@@ -1262,7 +1262,7 @@ func (w *FileWatch) pin(ctx context.Context, blk int64, rev zodb.Tid) (err error
// XXX comment
// XXX comment
rev
,
_
=
w
.
file
.
δFtail
.
LastRevOf
(
blk
,
w
.
at
)
rev
,
_
=
w
.
file
.
δFtail
.
LastRevOf
(
blk
,
w
.
at
)
ack
,
err
:=
w
.
link
.
sendReq
(
ctx
,
fmt
.
Sprintf
(
"pin %s #%
s
@%s"
,
foid
,
blk
,
rev
))
ack
,
err
:=
w
.
link
.
sendReq
(
ctx
,
fmt
.
Sprintf
(
"pin %s #%
d
@%s"
,
foid
,
blk
,
rev
))
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
...
@@ -1364,7 +1364,7 @@ func (w *Watcher) _serveRX() (err error) {
...
@@ -1364,7 +1364,7 @@ func (w *Watcher) _serveRX() (err error) {
func
(
w
*
Watcher
)
sendReq
(
ctx
context
.
Context
,
req
string
)
(
reply
string
,
err
error
)
{
func
(
w
*
Watcher
)
sendReq
(
ctx
context
.
Context
,
req
string
)
(
reply
string
,
err
error
)
{
// XXX err ctx
// XXX err ctx
// XXX assert '\n' not in req
// XXX assert '\n' not in req
stream
=
...
// XXX
stream
:=
uint64
(
2
)
// FIXME allocate stream anew as several in-flight sendReq are possible
rxq
:=
make
(
chan
string
)
// XXX cap=1? (so that if we return canceled we do not block client)
rxq
:=
make
(
chan
string
)
// XXX cap=1? (so that if we return canceled we do not block client)
w
.
rxMu
.
Lock
()
w
.
rxMu
.
Lock
()
...
@@ -1374,7 +1374,7 @@ func (w *Watcher) sendReq(ctx context.Context, req string) (reply string, err er
...
@@ -1374,7 +1374,7 @@ func (w *Watcher) sendReq(ctx context.Context, req string) (reply string, err er
// XXX lock tx
// XXX lock tx
// XXX timeout write on ctx cancel
// XXX timeout write on ctx cancel
err
=
w
.
sk
.
Write
(
fmt
.
Sprintf
(
"%d %s
\n
"
,
stream
,
req
))
_
,
err
=
w
.
sk
.
Write
([]
byte
(
fmt
.
Sprintf
(
"%d %s
\n
"
,
stream
,
req
)
))
if
err
!=
nil
{
if
err
!=
nil
{
return
""
,
err
return
""
,
err
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment