@@ -214,21 +214,6 @@ func (m *mapSession) serveLongPoll() {
214
214
m .infof ("node has disconnected, mapSession: %p, chan: %p" , m , m .ch )
215
215
}()
216
216
217
- // From version 68, all streaming requests can be treated as read only.
218
- // TODO: Remove when we drop support for 1.48
219
- if m .capVer < 68 {
220
- // Error has been handled/written to client in the func
221
- // return
222
- err := m .handleSaveNode ()
223
- if err != nil {
224
- mapResponseWriteUpdatesInStream .WithLabelValues ("error" ).Inc ()
225
-
226
- m .close ()
227
- return
228
- }
229
- mapResponseWriteUpdatesInStream .WithLabelValues ("ok" ).Inc ()
230
- }
231
-
232
217
// Set up the client stream
233
218
m .h .pollNetMapStreamWG .Add (1 )
234
219
defer m .h .pollNetMapStreamWG .Done ()
@@ -549,72 +534,6 @@ func (m *mapSession) handleEndpointUpdate() {
549
534
return
550
535
}
551
536
552
- // handleSaveNode saves node updates in the maprequest _streaming_
553
- // path and is mostly the same code as in handleEndpointUpdate.
554
- // It is not attempted to be deduplicated since it will go away
555
- // when we stop supporting older than 68 which removes updates
556
- // when the node is streaming.
557
- func (m * mapSession ) handleSaveNode () error {
558
- m .tracef ("saving node update from stream session" )
559
-
560
- change := m .node .PeerChangeFromMapRequest (m .req )
561
-
562
- // A stream is being set up, the node is Online
563
- online := true
564
- change .Online = & online
565
-
566
- m .node .ApplyPeerChange (& change )
567
-
568
- sendUpdate , routesChanged := hostInfoChanged (m .node .Hostinfo , m .req .Hostinfo )
569
- m .node .Hostinfo = m .req .Hostinfo
570
-
571
- // If there is no changes and nothing to save,
572
- // return early.
573
- if peerChangeEmpty (change ) || ! sendUpdate {
574
- return nil
575
- }
576
-
577
- // Check if the Hostinfo of the node has changed.
578
- // If it has changed, check if there has been a change to
579
- // the routable IPs of the host and update update them in
580
- // the database. Then send a Changed update
581
- // (containing the whole node object) to peers to inform about
582
- // the route change.
583
- // If the hostinfo has changed, but not the routes, just update
584
- // hostinfo and let the function continue.
585
- if routesChanged {
586
- var err error
587
- _ , err = m .h .db .SaveNodeRoutes (m .node )
588
- if err != nil {
589
- return err
590
- }
591
-
592
- if m .h .ACLPolicy != nil {
593
- // update routes with peer information
594
- err := m .h .db .EnableAutoApprovedRoutes (m .h .ACLPolicy , m .node )
595
- if err != nil {
596
- return err
597
- }
598
- }
599
- }
600
-
601
- if err := m .h .db .DB .Save (m .node ).Error ; err != nil {
602
- return err
603
- }
604
-
605
- ctx := types .NotifyCtx (context .Background (), "pre-68-update-while-stream" , m .node .Hostname )
606
- m .h .nodeNotifier .NotifyWithIgnore (
607
- ctx ,
608
- types.StateUpdate {
609
- Type : types .StatePeerChanged ,
610
- ChangeNodes : []types.NodeID {m .node .ID },
611
- Message : "called from handlePoll -> pre-68-update-while-stream" ,
612
- },
613
- m .node .ID )
614
-
615
- return nil
616
- }
617
-
618
537
func (m * mapSession ) handleReadOnlyRequest () {
619
538
m .tracef ("Client asked for a lite update, responding without peers" )
620
539
0 commit comments