-
Notifications
You must be signed in to change notification settings - Fork 175
ODBC Mars issues #690
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
base: master
Are you sure you want to change the base?
ODBC Mars issues #690
Changes from 1 commit
e782a89
675c58e
138584b
3ba42b5
c309dfc
148c56b
533f6b4
149edc9
8f8e509
a18a448
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -521,6 +521,7 @@ int | |
| tds_read_packet(TDSSOCKET * tds) | ||
| { | ||
| #if ENABLE_ODBC_MARS | ||
| TDS_UINT this_seq; | ||
| TDSCONNECTION *conn = tds->conn; | ||
|
|
||
| tds_mutex_lock(&conn->list_mtx); | ||
|
|
@@ -554,9 +555,10 @@ tds_read_packet(TDSSOCKET * tds) | |
| tds->in_pos = 8; | ||
| tds->in_flag = tds->in_buf[0]; | ||
|
|
||
| /* send acknowledge if needed */ | ||
| if ((int32_t) (tds->recv_seq + 2 - tds->recv_wnd) >= 0) | ||
| tds_update_recv_wnd(tds, tds->recv_seq + 4); | ||
| /* Look ahead by up to 4 packets */ | ||
| memcpy(&this_seq, ((char const *)packet->buf) + offsetof(TDS72_SMP_HEADER, seq), sizeof this_seq); | ||
| if (this_seq + 2 >= tds->recv_wnd) | ||
|
||
| tds_update_recv_wnd(tds, this_seq + 4); | ||
|
|
||
| return tds->in_len; | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would use
also, consider that other code will still use
tds->recv_seq, perhaps it would be better to update that in a different way.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree about using
TDS_GET_A4LE; but ispacketguaranteed to be correctly aligned for that cast?The code in
tds_connection_put_packetmakes the same cast, so I guess it's not a problem. The code intds_packet_read()usesmemcpy(&mars_header, packet->buf, sizeof(mars_header));.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I though I replied to this. Packet is an allocated buffer so it's surely aligned to 32 bit.