@@ -262,26 +262,26 @@ func (client *Client) SetLimits(offset int, limit int, max int, cutoff int) *Cli
262
262
func (self * Client ) Status () ([][]string , os.Error ) {
263
263
body := make ([]byte , 4 )
264
264
binary .BigEndian .PutUint32 (body [0 :4 ], 1 )
265
-
265
+
266
266
rest , err := self .simpleQuery (searchdCommandStatus , verCommandStatus , len (body ), body )
267
267
if err != nil {
268
268
return nil , err
269
269
}
270
-
270
+
271
271
rows := binary .BigEndian .Uint32 (rest [0 :4 ])
272
272
cols := binary .BigEndian .Uint32 (rest [4 :8 ])
273
273
rest = rest [8 :]
274
-
274
+
275
275
response := make ([][]string , rows )
276
276
for i := 0 ; i < int (rows ); i ++ {
277
277
response [i ] = make ([]string , cols )
278
278
for j := 0 ; j < int (cols ); j ++ {
279
279
len := binary .BigEndian .Uint32 (rest [0 :4 ])
280
- response [i ][j ] = bytes .NewBuffer (rest [4 : 4 + len ]).String ()
280
+ response [i ][j ] = bytes .NewBuffer (rest [4 : 4 + len ]).String ()
281
281
rest = rest [4 + len :]
282
282
}
283
283
}
284
-
284
+
285
285
return response , nil
286
286
}
287
287
@@ -307,7 +307,7 @@ func (self *Client) connect() (*net.TCPConn, os.Error) {
307
307
return nil , err
308
308
}
309
309
my_proto := binary .BigEndian .Uint32 (ver_bits [0 :4 ])
310
-
310
+
311
311
if my_proto < 1 {
312
312
self .error = fmt .Sprintf ("expected searchd protocol version 1+, got version %d" , my_proto )
313
313
return nil , SphinxError {os .ErrorString (self .error )}
@@ -321,18 +321,18 @@ func (self *Client) simpleQuery(command int, version int, size int, body []byte)
321
321
return nil , err
322
322
}
323
323
324
- header := make ([]byte , 8 + len (body ))
324
+ header := make ([]byte , 8 + len (body ))
325
325
binary .BigEndian .PutUint16 (header [0 :2 ], uint16 (command ))
326
326
binary .BigEndian .PutUint16 (header [2 :4 ], uint16 (version ))
327
327
binary .BigEndian .PutUint32 (header [4 :8 ], uint32 (size ))
328
328
329
- request := bytes .Add (header , body );
329
+ request := bytes .Add (header , body )
330
330
331
331
_ , err = conn .Write (request )
332
332
if err != nil {
333
333
return nil , err
334
334
}
335
-
335
+
336
336
return self .getResponse (conn )
337
337
}
338
338
@@ -342,7 +342,7 @@ func (self *Client) getResponse(conn *net.TCPConn) ([]byte, os.Error) {
342
342
// ver := binary.BigEndian.Uint16(size_bits[2:4])
343
343
size := binary .BigEndian .Uint32 (size_bits [4 :8 ])
344
344
rest , _ := ioutil .ReadAll (io .LimitReader (conn , int64 (size )))
345
-
345
+
346
346
switch status {
347
347
case SearchdOk :
348
348
case SearchdWarning :
0 commit comments