Skip to content

Commit 3f9ecf2

Browse files
committed
fix tab
1 parent 91b90cd commit 3f9ecf2

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,3 @@ lain secret add ${LAIN-Domain} web /lain/app/prod.json -f example.json
6767
## Licensing
6868
6969
Entry is released under [MIT](https://github.com/laincloud/entry/blob/master/LICENSE) license.
70-

server/handler/handle_websocket.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ func handleRequest(conn *websocket.Conn, s *models.Session, sessionWriter io.Wri
115115
default:
116116
if _, err = buf.Write(inMsg.Content); err != nil {
117117
log.Errorf("buf.Write() failed, error: %s, session: %+v.", err, s)
118+
} else {
119+
log.Infof("buf.Write() succeed, inMsg.Content: %s(%v), session: %+v.", inMsg.Content, inMsg.Content, s)
118120
}
119121
}
120122
case message.RequestMessage_WINCH:
@@ -155,7 +157,7 @@ func handleResponse(conn *websocket.Conn, sessionReader io.ReadCloser, wg *sync.
155157
if pipe != nil {
156158
select {
157159
case <-pipe.requestBuffer:
158-
// log.Infof(">>> validLen: %v, buf[:validLen]: %v.", validLen, buf[:validLen])
160+
log.Infof("buf[:validLen]: %s(%v).", buf[:validLen], buf[:validLen])
159161
pipe.responseBuffer <- util.TermComplement(buf[:validLen])
160162
default:
161163
}

server/sql/bootstrap.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ CREATE TABLE `commands` (
2121
`command_id` bigint(20) NOT NULL AUTO_INCREMENT,
2222
`session_id` bigint(20) DEFAULT NULL,
2323
`user` varchar(255) DEFAULT NULL,
24-
`content` varchar(255) DEFAULT NULL,
24+
`content` varchar(1024) DEFAULT NULL,
2525
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
2626
PRIMARY KEY (`command_id`),
2727
KEY `idx_commands_user` (`user`(191)),

server/util/term.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,8 @@ func TermComplement(src []byte) []byte {
236236
return []byte{}
237237
}
238238

239-
for _, b := range src {
240-
if b == ' ' {
239+
for i, b := range src {
240+
if b == ' ' && (i != len(src)-1) {
241241
return []byte{}
242242
}
243243
}

swagger.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ swagger: "2.0"
22

33
info:
44
title: Entry
5-
version: 3.0.0
5+
version: 3.0.1
66

77
schemes:
88
- http

0 commit comments

Comments
 (0)