Skip to content

Commit

Permalink
prune unused code & add header to sse response to support nginx proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
lonord committed Aug 26, 2018
1 parent cc6a129 commit 3be8077
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 53 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@
# Output of the go coverage tool, specifically when used with LiteIDE
*.out

.idea/
dist/
4 changes: 3 additions & 1 deletion app/webservice_netspeed.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ type netSpeedService struct {

func newNetSpeedService(action *MainAction) *netSpeedService {
return &netSpeedService{
sse: sse.NewService(),
sse: sse.NewServiceWithOption(sse.Option{
Headers: map[string]string{"X-Accel-Buffering": "no"},
}),
action: action,
}
}
Expand Down
52 changes: 0 additions & 52 deletions dnsmasq/dnsmasq_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,58 +24,6 @@ func TestCollectInternalArgs(t *testing.T) {
}
}

func TestConvertLeases(t *testing.T) {
leases := convertLeases(leasesContent)
if len(leases) != 6 {
t.Errorf("leases length dismatch")
}
if leases[0].ExpireTimeStamp != 1524448523 {
t.Errorf("ExpireTimeStamp dismatch")
}
if leases[0].MACAddr != "00:0e:c6:a6:0c:99" {
t.Errorf("MACAddr dismatch")
}
if leases[0].IPAddr != "192.168.4.127" {
t.Errorf("IPAddr dismatch")
}
if leases[0].HostName != "lmbp" {
t.Errorf("HostName dismatch")
}
if leases[0].ClientID != "01:00:0e:c6:a6:0c:99" {
t.Errorf("ClientID dismatch")
}
if leases[1].ExpireTimeStamp != 1528766444 {
t.Errorf("ExpireTimeStamp dismatch")
}
if leases[1].MACAddr != "dc:a9:04:86:fd:99" {
t.Errorf("MACAddr dismatch")
}
if leases[1].IPAddr != "192.168.4.90" {
t.Errorf("IPAddr dismatch")
}
if leases[1].HostName != "*" {
t.Errorf("HostName dismatch")
}
if leases[1].ClientID != "01:dc:a9:04:86:fd:99" {
t.Errorf("ClientID dismatch")
}
if leases[4].ExpireTimeStamp != 1528766261 {
t.Errorf("ExpireTimeStamp dismatch")
}
if leases[4].MACAddr != "60:6b:ff:25:29:99" {
t.Errorf("MACAddr dismatch")
}
if leases[4].IPAddr != "192.168.4.92" {
t.Errorf("IPAddr dismatch")
}
if leases[4].HostName != "*" {
t.Errorf("HostName dismatch")
}
if leases[4].ClientID != "*" {
t.Errorf("ClientID dismatch")
}
}

const dsContent = `. IN DS 19036 8 2 49AAC11D7B6F6446702E54A1607371607A1A41855200FD2CE1CDDE32F24E8FB5
`

Expand Down

0 comments on commit 3be8077

Please sign in to comment.