Refactor log (#3446)

* Refactor log

* Add new log methods

* Fix logger test

* Change all logging code

* Clean up pathObj

* Rebase to latest main

* Remove invoking method name after the dot
This commit is contained in:
yuhan6665
2024-06-29 14:32:57 -04:00
committed by GitHub
parent 8320732743
commit 079d0bd8a9
291 changed files with 1837 additions and 2368 deletions
+4 -2
View File
@@ -6,6 +6,8 @@ package splithttp
import (
"container/heap"
"io"
"github.com/xtls/xray-core/common/errors"
)
type Packet struct {
@@ -33,7 +35,7 @@ func NewUploadQueue(maxPackets int) *UploadQueue {
func (h *UploadQueue) Push(p Packet) error {
if h.closed {
return newError("splithttp packet queue closed")
return errors.New("splithttp packet queue closed")
}
h.pushedPackets <- p
@@ -84,7 +86,7 @@ func (h *UploadQueue) Read(b []byte) (int, error) {
// the "reassembly buffer" is too large, and we want to
// constrain memory usage somehow. let's tear down the
// connection, and hope the application retries.
return 0, newError("packet queue is too large")
return 0, errors.New("packet queue is too large")
}
heap.Push(&h.heap, packet)
packet2, more := <-h.pushedPackets