hyperboria / bugs

Peer-to-peer IPv6 networking, secure and near-zero-conf.
154 stars 17 forks source link

Fix long outgoing references blocking cjdroute #80

Closed tigusoft closed 8 years ago

tigusoft commented 8 years ago

Too long text of reference in outgoing peers (in connectTo) is handled correctly:

We send to cjdroute (via UDP packet) only the needed data, skipping the fields that are not used.

Also, if anyway the reference is still too large (e.g. had very long password), it will be skipped with an error logged.

ansuz commented 8 years ago

rip connectTo-overflow

tigusoft commented 8 years ago

Version 3, abort if there is error

tigusoft commented 8 years ago

@Kubuxu thanks for comment re try-catch, we left it still there in separate function, because in other case the gcc (or at least some versions) are complaining about clobbered local variable.

Maybe that warning is false-positive (because we return immediately if there is an exception catched) but either way it stops builds, so better leave it as that imo. Anyway we want to abort (or continue) in case of the exception so we can handle it in the wrapper function).

ghost commented 8 years ago

:+1: this is neat!

tigusoft commented 8 years ago

@lgierth how about this one then :)

hbdgr commented 8 years ago

Tested on Ubuntu 15.10 version: a26136ae174ddb4c412f3b0bd74fe4e1bca5eede working for me. For example too long "login" in reference causes: "Too long peer reference" WARN and exit cjdns.

tigusoft-vm commented 8 years ago

@ansuz we're ready to merge this, it works taking into account this discussed changes... so could you merge it? Or anything more to change?

ghost commented 8 years ago

great thanks :clap:

ghost commented 8 years ago

will propose our master to cjd today