Check-in [5d7f6cacbe]
Not logged in

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

Overview
Comment:Replace NOPE with NO-DO
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 5d7f6cacbe8daf55ba7fb20244f81900a2cdfd1f
User & Date: bernd 2019-08-26 21:21:20
Context
2019-08-26
21:59
Revert NOPE check-in: 39625fe0e3 user: bernd tags: trunk
21:21
Replace NOPE with NO-DO check-in: 5d7f6cacbe user: bernd tags: trunk
14:54
Fix responses to entering new IDs check-in: f880b8bbe9 user: bernd tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to net2o.fs.

916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
....
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
....
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
....
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
	0= IF  data-resend 0 2 cells $del  THEN
    maxdata +LOOP ;

: data-resend-flush ( -- )
    data-resend $@len 0 U+DO
	data-resend $@ I /string drop @ 0= IF
	    data-resend I 2 cells $del
	    0  data-resend $@len I unloop U+DO NOPE
	ELSE
	    [ 2 cells ]L
	THEN
    +LOOP ;

: remove-resend { nback -- }
    data-resend $@ bounds U+DO
................................................................................
    resize-sema c-section
    ticker 64@ ack@ .ticks-init ;

: o-chunks ( -- )
    [: chunks $@ bounds ?DO
	    I chunk-context @ o = IF
		chunks I chunks-struct del$one
		unloop chunks next$ ?DO NOPE 0
	    ELSE  chunks-struct  THEN  +LOOP ;]
    resize-sema c-section ;

event: :>send-chunks ( o -- ) .do-send-chunks ;

in net2o : send-chunks  sender-task 0= IF  do-send-chunks  EXIT  THEN
    <event o elit, :>send-chunks sender-task event> ;
................................................................................

: eval-queue ( -- )
    queue $@len 0= ?EXIT  ticker 64@
    queue $@ bounds ?DO  I >o
	64dup queue-timestamp 64@ 64u> IF
	    addr queue-xt @ queue-job @ .execute o>
	    queue I queue-struct del$one
	    unloop queue next$ ?DO  NOPE 0
	ELSE  o>  queue-struct  THEN
    +LOOP  64drop ;

\ poll loop

: prep-evsocks ( -- )
    epiper @    fileno POLLIN pollfds fds!+ drop 1 to pollfd# ;
................................................................................
	    I .cc-secret [ tmp-cookie .cc-secret ]L KEYBYTES move
	    cookies I cookie-size# del$one drop
	    unloop  dup IF  true  THEN  EXIT
	THEN
	I .cc-timeout 64@ timeout 64u< IF
	    cookies I cookie-size# del$one
	    cookies next$
	    unloop  ?DO  NOPE \ this replaces the loop variables
	    0 \ we re-iterate over the exactly same index
	ELSE
	    cookie-size#
	THEN
    +LOOP  64drop 0 ;

: ?cookie ( cookie -- context true / false )







|







 







|







 







|







 







|







916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
....
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
....
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
....
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
	0= IF  data-resend 0 2 cells $del  THEN
    maxdata +LOOP ;

: data-resend-flush ( -- )
    data-resend $@len 0 U+DO
	data-resend $@ I /string drop @ 0= IF
	    data-resend I 2 cells $del
	    0  data-resend $@len I unloop U+DO NO-DO
	ELSE
	    [ 2 cells ]L
	THEN
    +LOOP ;

: remove-resend { nback -- }
    data-resend $@ bounds U+DO
................................................................................
    resize-sema c-section
    ticker 64@ ack@ .ticks-init ;

: o-chunks ( -- )
    [: chunks $@ bounds ?DO
	    I chunk-context @ o = IF
		chunks I chunks-struct del$one
		unloop chunks next$ ?DO NO-DO 0
	    ELSE  chunks-struct  THEN  +LOOP ;]
    resize-sema c-section ;

event: :>send-chunks ( o -- ) .do-send-chunks ;

in net2o : send-chunks  sender-task 0= IF  do-send-chunks  EXIT  THEN
    <event o elit, :>send-chunks sender-task event> ;
................................................................................

: eval-queue ( -- )
    queue $@len 0= ?EXIT  ticker 64@
    queue $@ bounds ?DO  I >o
	64dup queue-timestamp 64@ 64u> IF
	    addr queue-xt @ queue-job @ .execute o>
	    queue I queue-struct del$one
	    unloop queue next$ ?DO  NO-DO 0
	ELSE  o>  queue-struct  THEN
    +LOOP  64drop ;

\ poll loop

: prep-evsocks ( -- )
    epiper @    fileno POLLIN pollfds fds!+ drop 1 to pollfd# ;
................................................................................
	    I .cc-secret [ tmp-cookie .cc-secret ]L KEYBYTES move
	    cookies I cookie-size# del$one drop
	    unloop  dup IF  true  THEN  EXIT
	THEN
	I .cc-timeout 64@ timeout 64u< IF
	    cookies I cookie-size# del$one
	    cookies next$
	    unloop  ?DO  NO-DO \ this replaces the loop variables
	    0 \ we re-iterate over the exactly same index
	ELSE
	    cookie-size#
	THEN
    +LOOP  64drop 0 ;

: ?cookie ( cookie -- context true / false )

Changes to tools.fs.

171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
...
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
    :noname  action-of thread-init compile,
    r@ compile, postpone off postpone ;
    is thread-init
    :noname  r> compile, postpone $off  action-of kill-task  compile,
    postpone ;
    is kill-task ;

[IFUNDEF] NOPE
    : NOPE ( c:sys -- )
	\G removes a control structure sys from the stack
	drop 2drop ; immediate restrict
[THEN]

require bits.fs

\ variable length integers, similar to protobuf, but MSB first
................................................................................
    >r over @ cell+ - tuck r> $del ;
: next$ ( pos string -- addre addrs )
    $@ rot /string bounds ;
: del$cell ( addr stringaddr -- ) { string }
    string $@ bounds ?DO
	dup I @ = IF
	    string I cell del$one
	    unloop string next$ ?DO NOPE 0
	ELSE  cell  THEN
    +LOOP drop ;

\ unique list of cells

Sema resize-sema








|
|







 







|







171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
...
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
    :noname  action-of thread-init compile,
    r@ compile, postpone off postpone ;
    is thread-init
    :noname  r> compile, postpone $off  action-of kill-task  compile,
    postpone ;
    is kill-task ;

[IFUNDEF] NO-DO
    : NO-DO ( c:sys -- )
	\G removes a control structure sys from the stack
	drop 2drop ; immediate restrict
[THEN]

require bits.fs

\ variable length integers, similar to protobuf, but MSB first
................................................................................
    >r over @ cell+ - tuck r> $del ;
: next$ ( pos string -- addre addrs )
    $@ rot /string bounds ;
: del$cell ( addr stringaddr -- ) { string }
    string $@ bounds ?DO
	dup I @ = IF
	    string I cell del$one
	    unloop string next$ ?DO NO-DO 0
	ELSE  cell  THEN
    +LOOP drop ;

\ unique list of cells

Sema resize-sema