-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exits after 5 seconds w/o DEBUG, or gets stuck in infinite loop when running with DEBUG on #14
Comments
DEBUG=dat* dat-push
dat-push seems to start replicating with two copies of the same peer and then thinks it has finished replicating witch each copy twice.
|
How often is the "want" event expected to be emitted? I added logging here and disabled the timeout and can then transfer data for several minutes without receiving a single 'want' event to reset the timeout. Line 84 in 1346982
|
I found the same thing looking at this module while digging into have/wants. Here is how I found to add have/want listeners to replication streams: https://gist.github.com/substack/c69c2013c0694176ce9f36b0fa848c12 So that part of dat-push/index.js should be something like: stream.on('feed', (id) => {
var ch = stream._feed(id)
if (ch.id <= -1) return
if (!ch.peer) ch.peer = {}
var prev = ch.peer.onwant
ch.peer.onwant = function () {
if (typeof prev === 'function') prev.apply(this, arguments)
clearTimeout(to)
to = startTheClock()
}
}) |
dat-push exits five seconds after the remote client connects unless I run with
DEUBG=dat*
. Transfer seems to work for the first five seconds regardless of running with DEBUG or not. The timeout introduced in 98522b7 by @pfrazee doesn’t seem to work as expected.When I do run with debug the receiving end gets stuck printing this line every one second forever:
The remote receiving end with DEBUG will print this corresponding message every one second forever:
dat-push will print that it is uploading a few other packets and then print
Finished replicating with 1.2.3.4
twice prior to both sides getting stuck in this loop. Without DEBUG dat-push exits and the remote end complains that there are no peers before also exiting.The text was updated successfully, but these errors were encountered: