Check-in [989ab0b104]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Try to fix ihave forwarding
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 989ab0b10414ab83129ba635bb04eba30394b1ac
User & Date: bernd 2020-03-18 15:14:06.018
Context
2020-03-19
13:38
Bump version number check-in: 4ef8185694 user: bernd tags: trunk, 0.9.7-20200319
2020-03-18
15:14
Try to fix ihave forwarding check-in: 989ab0b104 user: bernd tags: trunk
2020-03-05
15:59
Bump version number check-in: d24e67b97a user: bernd tags: trunk, 0.9.7-20200305
Changes
Unified Diff Ignore Whitespace Patch
Changes to linux/net.fs.
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
$200 Constant netlink-size#
0 Value netlink-sock
sockaddr_nl buffer: netlink-addr
netlink-size# buffer: netlink-buffer

AF_NETLINK netlink-addr nl_family w!
0          netlink-addr nl_pad w!
$00d8607f5 netlink-addr nl_groups l!

: prep-netlink ( -- )
    epiper @ fileno POLLIN  pollfds fds!+ >r
    netlink-sock POLLIN  r> fds!+
    pollfds - pollfd / to pollfd# ;

: get-netlink ( -- )







|







18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
$200 Constant netlink-size#
0 Value netlink-sock
sockaddr_nl buffer: netlink-addr
netlink-size# buffer: netlink-buffer

AF_NETLINK netlink-addr nl_family w!
0          netlink-addr nl_pad w!
$0d8607f5  netlink-addr nl_groups l!

: prep-netlink ( -- )
    epiper @ fileno POLLIN  pollfds fds!+ >r
    netlink-sock POLLIN  r> fds!+
    pollfds - pollfd / to pollfd# ;

: get-netlink ( -- )
Changes to msg.fs.
37
38
39
40
41
42
43
44
45
46
47
48

49



50
51
52
53
54
55
56
    THEN  last# cell+ $@ drop cell+ to msg-group-o
    2drop ;

Variable ihave$
Variable mehave$
Variable push$

: avalanche-msg ( o:connect -- )
    \G forward message to all next nodes of that message group
    msg-group-o .msg:peers[] $@
    bounds ?DO  I @ o <> IF  I @ .avalanche-to  THEN
    cell +LOOP

    ihave$ $free mehave$ $free push$ $free ;




Variable msg-group$
User replay-mode
User skip-sig?

Sema msglog-sema








|
<


|
>

>
>
>







37
38
39
40
41
42
43
44

45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
    THEN  last# cell+ $@ drop cell+ to msg-group-o
    2drop ;

Variable ihave$
Variable mehave$
Variable push$

: (avalanche-msg) ( o:connect- )

    msg-group-o .msg:peers[] $@
    bounds ?DO  I @ o <> IF  I @ .avalanche-to  THEN
    cell +LOOP ;
: cleanup-msg ( -- )
    ihave$ $free mehave$ $free push$ $free ;
: avalanche-msg ( o:connect -- )
    \G forward message to all next nodes of that message group
    (avalanche-msg) cleanup-msg ;

Variable msg-group$
User replay-mode
User skip-sig?

Sema msglog-sema

330
331
332
333
334
335
336

337
338
339
340
341

342
343
344
345
346
347
348
    ." ====== hash owend by ======" cr
    have# [: dup $@ 85type ." :"
	cell+ $@ bounds U+DO
	    space I $@ .@host.id
	cell +LOOP cr ;] #map ;

: >send-have ( addr u -- )

    have-group# #@ dup IF
	bounds ?DO
	    I @ to msg-group-o 0 .avalanche-msg
	cell +LOOP
    THEN ;


: msg:ihave ( id u1 hash u2 -- )
\    ." ihave:" 2over dump 2dup dump
    2dup ihave$ $+!  2over mehave$ $!
    bounds U+DO  2dup I keysize have# #!ins[]  keysize +LOOP  2drop ;
: pk.host ( -- addr u ) [: pk@ type host$ $. ;] $tmp ;
: >ihave ( hash u -- )







>
|
|
|
|
|
>







333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
    ." ====== hash owend by ======" cr
    have# [: dup $@ 85type ." :"
	cell+ $@ bounds U+DO
	    space I $@ .@host.id
	cell +LOOP cr ;] #map ;

: >send-have ( addr u -- )
    msg-group-o >r [:
	have-group# #@ dup IF
	    bounds ?DO
		I @ to msg-group-o 0 .(avalanche-msg)
	    cell +LOOP
	THEN  cleanup-msg ;] catch
    r> to msg-group-o throw ;

: msg:ihave ( id u1 hash u2 -- )
\    ." ihave:" 2over dump 2dup dump
    2dup ihave$ $+!  2over mehave$ $!
    bounds U+DO  2dup I keysize have# #!ins[]  keysize +LOOP  2drop ;
: pk.host ( -- addr u ) [: pk@ type host$ $. ;] $tmp ;
: >ihave ( hash u -- )