-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Interface Conversion Error #20
Comments
I always tried to implement and use Frame as a pointer type, so that you can either always do |
So the code in this repository seems to be type coherent. It may be coming from your code then ? |
But if there was an issue with the initialization, wouldn't (*frame).FrameType() not work either ? |
I essentially have a function that receives a pointer to a frame (frame *Frame) and and then a switch case depending on the type of the frame. It works for all other frames, just throws this error for MaxStreamDataType, MaxDataType and MaxStreamsType. Also, I'm not really creating or initialising a frame. I pass a pointer to a packet (packet *Packet) to a function from EncodeAndEncrypt. I then extract the frames from the packet using -
|
I have fixed this in aa881ba. |
I updated the code, but still run into the same problem. I experimented a little more and found something really surprising. I figured maybe passing packets and frames using pointers is leading to the unexpected behaviour, so I removed all reference passing from my code and still got the same behaviour. Considering that I have done no initialization and am just trying to access these values from packets when they reach EncodeAndEncrypt function, I can't understand what's happening at all.(Infact, just to be extra sure, I cloned a fresh copy of the repo and added only a couple of lines in the connection.go file which extract the frames from the packet to make sure something else in my code wasn't leading to this) |
Infact, this specific test case might help you see the error first hand.
Now, I run the scenario_runner.go script for http3_get and the sever_flow_control scenario against the host quic.tech:8443. |
Thank you for taking the time to dig this up. I rarely have to look into the packets that are sent and I have found some occurences of this type inconsistency recently when adding qlog. I found another one in server_flow_control. A fix is pushed that changes all Frame-implementing structs to use pointers. Now it fails to compile when using an existing frame struct as a value and not a pointer. I think this will end all the troubles listed here. |
Great ! Works well now :D |
The error I'm running into is this :-
panic: interface conversion: quictracker.Frame is quictracker.MaxDataFrame, not *quictracker.MaxDataFrame
To provide context,
I have a function which receives a pointer to a frame i.e. frame *Frame. I then determine the type of the frame using (*frame).FrameType() which evaluates to MaxDataType. Following this, when I try to extract the MaximumData value using (*frame).(*MaxDataFrame).MaximumData, I run into the error above.
I'm unable to figure out the correct way of extracting MaximumData value from the frame.
The text was updated successfully, but these errors were encountered: