@@ -785,7 +785,7 @@ func (t *http2Client) updateFlowControl(n uint32) {
785
785
ss : []http2.Setting {
786
786
{
787
787
ID : http2 .SettingInitialWindowSize ,
788
- Val : uint32 ( n ) ,
788
+ Val : n ,
789
789
},
790
790
},
791
791
})
@@ -795,7 +795,7 @@ func (t *http2Client) handleData(f *http2.DataFrame) {
795
795
size := f .Header ().Length
796
796
var sendBDPPing bool
797
797
if t .bdpEst != nil {
798
- sendBDPPing = t .bdpEst .add (uint32 ( size ) )
798
+ sendBDPPing = t .bdpEst .add (size )
799
799
}
800
800
// Decouple connection's flow control from application's read.
801
801
// An update on connection's flow control should not depend on
@@ -806,7 +806,7 @@ func (t *http2Client) handleData(f *http2.DataFrame) {
806
806
// active(fast) streams from starving in presence of slow or
807
807
// inactive streams.
808
808
//
809
- if w := t .fc .onData (uint32 ( size ) ); w > 0 {
809
+ if w := t .fc .onData (size ); w > 0 {
810
810
t .controlBuf .put (& outgoingWindowUpdate {
811
811
streamID : 0 ,
812
812
increment : w ,
@@ -831,12 +831,12 @@ func (t *http2Client) handleData(f *http2.DataFrame) {
831
831
return
832
832
}
833
833
if size > 0 {
834
- if err := s .fc .onData (uint32 ( size ) ); err != nil {
834
+ if err := s .fc .onData (size ); err != nil {
835
835
t .closeStream (s , io .EOF , true , http2 .ErrCodeFlowControl , status .New (codes .Internal , err .Error ()), nil )
836
836
return
837
837
}
838
838
if f .Header ().Flags .Has (http2 .FlagDataPadded ) {
839
- if w := s .fc .onRead (uint32 ( size ) - uint32 (len (f .Data ()))); w > 0 {
839
+ if w := s .fc .onRead (size - uint32 (len (f .Data ()))); w > 0 {
840
840
t .controlBuf .put (& outgoingWindowUpdate {s .id , w })
841
841
}
842
842
}
@@ -861,12 +861,11 @@ func (t *http2Client) handleRSTStream(f *http2.RSTStreamFrame) {
861
861
if ! ok {
862
862
return
863
863
}
864
- code := http2 .ErrCode (f .ErrCode )
865
- if code == http2 .ErrCodeRefusedStream {
864
+ if f .ErrCode == http2 .ErrCodeRefusedStream {
866
865
// The stream was unprocessed by the server.
867
866
atomic .StoreUint32 (& s .unprocessed , 1 )
868
867
}
869
- statusCode , ok := http2ErrConvTab [code ]
868
+ statusCode , ok := http2ErrConvTab [f . ErrCode ]
870
869
if ! ok {
871
870
warningf ("transport: http2Client.handleRSTStream found no mapped gRPC status for the received http2 error %v" , f .ErrCode )
872
871
statusCode = codes .Unknown
0 commit comments