good morning!!!!

Skip to content
Snippets Groups Projects
Verified Commit d5c5714c authored by a's avatar a
Browse files

fuck me

parent 00d78f82
No related branches found
No related tags found
1 merge request!23Whatthefuck
Pipeline #30099 failed with stage
in 1 minute and 42 seconds
......@@ -59,7 +59,9 @@ func Dial(ctx context.Context, client *http.Client, target string) (*Client, err
if client == nil {
client = http.DefaultClient
}
return &Client{remote: target, c: client, headers: http.Header{}}, nil
return &Client{remote: target, c: client, headers: http.Header{
"Content-Type": []string{"application/json"},
}}, nil
}
func (c *Client) SetHeader(key string, value string) {
......@@ -196,6 +198,5 @@ func (c *Client) postBuf(ctx context.Context, rd io.Reader) (*http.Response, err
}
}
}()
hreq.Header.Add("Content-Type", "application/json")
return c.c.Do(hreq)
}
......@@ -11,6 +11,7 @@ import (
"net/http"
"net/url"
"strings"
"sync"
"gfx.cafe/open/jrpc/pkg/codec"
"gfx.cafe/open/jrpc/pkg/serverutil"
......@@ -29,6 +30,8 @@ type Codec struct {
msgs chan *serverutil.Bundle
errCh chan httpError
mu sync.Mutex
i codec.PeerInfo
}
......
......@@ -65,6 +65,11 @@ func (c *callRespWriter) Send(v any, e error) (err error) {
if err != nil {
return err
}
select {
case <-c.ctx.Done():
return c.ctx.Err()
default:
}
defer c.cr.mu.Release(1)
if c.err != nil {
e = c.err
......@@ -77,7 +82,6 @@ func (c *callRespWriter) Send(v any, e error) (err error) {
if v != nil {
ce.v = &v
}
err = c.cr.send(c.ctx, ce)
if err != nil {
return err
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment