Skip to content
This repository has been archived by the owner on Feb 3, 2025. It is now read-only.

Commit

Permalink
tiny fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
funny-falcon committed Oct 21, 2013
1 parent abda757 commit 00f964f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
1 change: 1 addition & 0 deletions context.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ type Canceler interface {
type CxState uint32

const (
CxOK = CxState(0)
CxCanceled = CxState(1)
CxTimeout = CxState(2)
)
Expand Down
4 changes: 4 additions & 0 deletions epoch.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,7 @@ func (e Epoch) String() string {
func (e Epoch) Remains() time.Duration {
return time.Duration(e - NowEpoch())
}

func (e Epoch) Elapsed() time.Duration {
return time.Duration(NowEpoch() - e)
}
1 change: 1 addition & 0 deletions request.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ func (cm *ReqContext) Done() {
if req := cm.Request; req != nil {
req.RespondFail(RcInternalError)
}
cm.Context.Done()
}

func (r *Request) Context() (cx *ReqContext) {
Expand Down
12 changes: 6 additions & 6 deletions response.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ const (
)

const (
RcShutdown = 0xff03
RcProtocolError = 0x0302
RcInternalError = 0xfc02
RcShutdown = RetCode(0xff03)
RcProtocolError = RetCode(0x0302)
RcInternalError = RetCode(0xfc02)
)
const (
RcCanceled = 0xff03
RcIOError = 0xfe03
RcTimeout = 0xfd03
RcCanceled = RetCode(0xff03)
RcIOError = RetCode(0xfe03)
RcTimeout = RetCode(0xfd03)
)

type Response struct {
Expand Down

0 comments on commit 00f964f

Please sign in to comment.