@@ -44,54 +44,48 @@ type FileStats struct {
44
44
func openx () {
45
45
http .HandleFunc ("/openx-darwinamd64" , func (w http.ResponseWriter , r * http.Request ) {
46
46
err := erpc .CheckGet (w , r )
47
- if err != nil {
48
- log .Println (err )
49
- erpc .ResponseHandler (w , erpc .StatusNotFound )
47
+ if erpc .Err (w , err , erpc .StatusNotFound ) {
48
+ return
50
49
}
51
50
52
51
http .ServeFile (w , r , "openx-darwinamd64.gz" )
53
52
})
54
53
http .HandleFunc ("/openx-linuxamd64" , func (w http.ResponseWriter , r * http.Request ) {
55
54
err := erpc .CheckGet (w , r )
56
- if err != nil {
57
- log .Println (err )
58
- erpc .ResponseHandler (w , erpc .StatusNotFound )
55
+ if erpc .Err (w , err , erpc .StatusNotFound ) {
56
+ return
59
57
}
60
58
61
59
http .ServeFile (w , r , "openx-linuxamd64.gz" )
62
60
})
63
61
http .HandleFunc ("/openx-linux386" , func (w http.ResponseWriter , r * http.Request ) {
64
62
err := erpc .CheckGet (w , r )
65
- if err != nil {
66
- log .Println (err )
67
- erpc .ResponseHandler (w , erpc .StatusNotFound )
63
+ if erpc .Err (w , err , erpc .StatusNotFound ) {
64
+ return
68
65
}
69
66
70
67
http .ServeFile (w , r , "openx-linux386.gz" )
71
68
})
72
69
http .HandleFunc ("/openx-arm64" , func (w http.ResponseWriter , r * http.Request ) {
73
70
err := erpc .CheckGet (w , r )
74
- if err != nil {
75
- log .Println (err )
76
- erpc .ResponseHandler (w , erpc .StatusNotFound )
71
+ if erpc .Err (w , err , erpc .StatusNotFound ) {
72
+ return
77
73
}
78
74
79
75
http .ServeFile (w , r , "openx-arm64.gz" )
80
76
})
81
77
http .HandleFunc ("/openx-arm" , func (w http.ResponseWriter , r * http.Request ) {
82
78
err := erpc .CheckGet (w , r )
83
- if err != nil {
84
- log .Println (err )
85
- erpc .ResponseHandler (w , erpc .StatusNotFound )
79
+ if erpc .Err (w , err , erpc .StatusNotFound ) {
80
+ return
86
81
}
87
82
88
83
http .ServeFile (w , r , "openx-arm.gz" )
89
84
})
90
85
http .HandleFunc ("/openx" , func (w http.ResponseWriter , r * http.Request ) {
91
86
err := erpc .CheckGet (w , r )
92
- if err != nil {
93
- log .Println (err )
94
- erpc .ResponseHandler (w , erpc .StatusNotFound )
87
+ if erpc .Err (w , err , erpc .StatusNotFound ) {
88
+ return
95
89
}
96
90
97
91
http .ServeFile (w , r , "openx.gz" )
@@ -101,54 +95,48 @@ func openx() {
101
95
func opensolar () {
102
96
http .HandleFunc ("/opensolar-darwinamd64" , func (w http.ResponseWriter , r * http.Request ) {
103
97
err := erpc .CheckGet (w , r )
104
- if err != nil {
105
- log .Println (err )
106
- erpc .ResponseHandler (w , erpc .StatusNotFound )
98
+ if erpc .Err (w , err , erpc .StatusNotFound ) {
99
+ return
107
100
}
108
101
109
102
http .ServeFile (w , r , "opensolar-darwinamd64.gz" )
110
103
})
111
104
http .HandleFunc ("/opensolar-linuxamd64" , func (w http.ResponseWriter , r * http.Request ) {
112
105
err := erpc .CheckGet (w , r )
113
- if err != nil {
114
- log .Println (err )
115
- erpc .ResponseHandler (w , erpc .StatusNotFound )
106
+ if erpc .Err (w , err , erpc .StatusNotFound ) {
107
+ return
116
108
}
117
109
118
110
http .ServeFile (w , r , "opensolar-linuxamd64.gz" )
119
111
})
120
112
http .HandleFunc ("/opensolar-linux386" , func (w http.ResponseWriter , r * http.Request ) {
121
113
err := erpc .CheckGet (w , r )
122
- if err != nil {
123
- log .Println (err )
124
- erpc .ResponseHandler (w , erpc .StatusNotFound )
114
+ if erpc .Err (w , err , erpc .StatusNotFound ) {
115
+ return
125
116
}
126
117
127
118
http .ServeFile (w , r , "opensolar-linux386.gz" )
128
119
})
129
120
http .HandleFunc ("/opensolar-arm64" , func (w http.ResponseWriter , r * http.Request ) {
130
121
err := erpc .CheckGet (w , r )
131
- if err != nil {
132
- log .Println (err )
133
- erpc .ResponseHandler (w , erpc .StatusNotFound )
122
+ if erpc .Err (w , err , erpc .StatusNotFound ) {
123
+ return
134
124
}
135
125
136
126
http .ServeFile (w , r , "opensolar-arm64.gz" )
137
127
})
138
128
http .HandleFunc ("/opensolar-arm" , func (w http.ResponseWriter , r * http.Request ) {
139
129
err := erpc .CheckGet (w , r )
140
- if err != nil {
141
- log .Println (err )
142
- erpc .ResponseHandler (w , erpc .StatusNotFound )
130
+ if erpc .Err (w , err , erpc .StatusNotFound ) {
131
+ return
143
132
}
144
133
145
134
http .ServeFile (w , r , "opensolar-arm.gz" )
146
135
})
147
136
http .HandleFunc ("/opensolar" , func (w http.ResponseWriter , r * http.Request ) {
148
137
err := erpc .CheckGet (w , r )
149
- if err != nil {
150
- log .Println (err )
151
- erpc .ResponseHandler (w , erpc .StatusNotFound )
138
+ if erpc .Err (w , err , erpc .StatusNotFound ) {
139
+ return
152
140
}
153
141
154
142
http .ServeFile (w , r , "opensolar.gz" )
@@ -158,54 +146,48 @@ func opensolar() {
158
146
func teller () {
159
147
http .HandleFunc ("/teller-darwinamd64" , func (w http.ResponseWriter , r * http.Request ) {
160
148
err := erpc .CheckGet (w , r )
161
- if err != nil {
162
- log .Println (err )
163
- erpc .ResponseHandler (w , erpc .StatusNotFound )
149
+ if erpc .Err (w , err , erpc .StatusNotFound ) {
150
+ return
164
151
}
165
152
166
153
http .ServeFile (w , r , "teller-darwinamd64.gz" )
167
154
})
168
155
http .HandleFunc ("/teller-linuxamd64" , func (w http.ResponseWriter , r * http.Request ) {
169
156
err := erpc .CheckGet (w , r )
170
- if err != nil {
171
- log .Println (err )
172
- erpc .ResponseHandler (w , erpc .StatusNotFound )
157
+ if erpc .Err (w , err , erpc .StatusNotFound ) {
158
+ return
173
159
}
174
160
175
161
http .ServeFile (w , r , "teller-linuxamd64.gz" )
176
162
})
177
163
http .HandleFunc ("/teller-linux386" , func (w http.ResponseWriter , r * http.Request ) {
178
164
err := erpc .CheckGet (w , r )
179
- if err != nil {
180
- log .Println (err )
181
- erpc .ResponseHandler (w , erpc .StatusNotFound )
165
+ if erpc .Err (w , err , erpc .StatusNotFound ) {
166
+ return
182
167
}
183
168
184
169
http .ServeFile (w , r , "teller-linux386.gz" )
185
170
})
186
171
http .HandleFunc ("/teller-arm64" , func (w http.ResponseWriter , r * http.Request ) {
187
172
err := erpc .CheckGet (w , r )
188
- if err != nil {
189
- log .Println (err )
190
- erpc .ResponseHandler (w , erpc .StatusNotFound )
173
+ if erpc .Err (w , err , erpc .StatusNotFound ) {
174
+ return
191
175
}
192
176
193
177
http .ServeFile (w , r , "teller-arm64.gz" )
194
178
})
195
179
http .HandleFunc ("/teller-arm" , func (w http.ResponseWriter , r * http.Request ) {
196
180
err := erpc .CheckGet (w , r )
197
- if err != nil {
198
- log .Println (err )
199
- erpc .ResponseHandler (w , erpc .StatusNotFound )
181
+ if erpc .Err (w , err , erpc .StatusNotFound ) {
182
+ return
200
183
}
201
184
202
185
http .ServeFile (w , r , "teller-arm.gz" )
203
186
})
204
187
http .HandleFunc ("/teller" , func (w http.ResponseWriter , r * http.Request ) {
205
188
err := erpc .CheckGet (w , r )
206
- if err != nil {
207
- log .Println (err )
208
- erpc .ResponseHandler (w , erpc .StatusNotFound )
189
+ if erpc .Err (w , err , erpc .StatusNotFound ) {
190
+ return
209
191
}
210
192
211
193
http .ServeFile (w , r , "teller.gz" )
@@ -215,9 +197,8 @@ func teller() {
215
197
func lastbuilt () {
216
198
http .HandleFunc ("/lastbuilt" , func (w http.ResponseWriter , r * http.Request ) {
217
199
err := erpc .CheckGet (w , r )
218
- if err != nil {
219
- log .Println (err )
220
- erpc .ResponseHandler (w , erpc .StatusNotFound )
200
+ if erpc .Err (w , err , erpc .StatusNotFound ) {
201
+ return
221
202
}
222
203
223
204
erpc .MarshalSend (w , LastBuilt )
@@ -227,9 +208,8 @@ func lastbuilt() {
227
208
func shaEndpoint () {
228
209
http .HandleFunc ("/sha" , func (w http.ResponseWriter , r * http.Request ) {
229
210
err := erpc .CheckGet (w , r )
230
- if err != nil {
231
- log .Println (err )
232
- erpc .ResponseHandler (w , erpc .StatusNotFound )
211
+ if erpc .Err (w , err , erpc .StatusNotFound ) {
212
+ return
233
213
}
234
214
235
215
erpc .MarshalSend (w , Sha )
@@ -246,9 +226,8 @@ type HashesResponse struct {
246
226
func hashesEndpoint () {
247
227
http .HandleFunc ("/hashes" , func (w http.ResponseWriter , r * http.Request ) {
248
228
err := erpc .CheckGet (w , r )
249
- if err != nil {
250
- log .Println (err )
251
- erpc .ResponseHandler (w , erpc .StatusNotFound )
229
+ if erpc .Err (w , err , erpc .StatusNotFound ) {
230
+ return
252
231
}
253
232
254
233
var x HashesResponse
0 commit comments