-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtail_ref.patch
More file actions
106 lines (100 loc) · 4.37 KB
/
tail_ref.patch
File metadata and controls
106 lines (100 loc) · 4.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
Subject: [PATCH] tail_ref
---
Index: picoquic/quicctx.c
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/picoquic/quicctx.c b/picoquic/quicctx.c
--- a/picoquic/quicctx.c (revision 7892ea1fd6270c412e740be890cb7c1f0db26a45)
+++ b/picoquic/quicctx.c (date 1670954405792)
@@ -2481,6 +2481,7 @@
free(next);
}
stream->send_queue = NULL;
+ stream->send_queue_end = NULL;
picosplay_empty_tree(&stream->stream_data_tree);
picoquic_sack_list_free(&stream->sack_list);
}
Index: picoquic/frames.c
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/picoquic/frames.c b/picoquic/frames.c
--- a/picoquic/frames.c (revision 7892ea1fd6270c412e740be890cb7c1f0db26a45)
+++ b/picoquic/frames.c (date 1670955203992)
@@ -238,6 +238,7 @@
free(stream->send_queue);
stream->send_queue = next;
}
+ stream->send_queue_end = NULL;
(void)picoquic_delete_stream_if_closed(cnx, stream);
}
else {
@@ -1539,6 +1540,7 @@
free(stream->send_queue->bytes);
free(stream->send_queue);
stream->send_queue = next;
+ if (!stream->send_queue) stream->send_queue_end = NULL;
}
stream->sent_offset += length;
@@ -1922,6 +1924,7 @@
free(stream->send_queue->bytes);
free(stream->send_queue);
stream->send_queue = next;
+ if (!stream->send_queue) stream->send_queue_end = NULL;
}
stream->sent_offset += length;
Index: picoquic/sender.c
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/picoquic/sender.c b/picoquic/sender.c
--- a/picoquic/sender.c (revision 7892ea1fd6270c412e740be890cb7c1f0db26a45)
+++ b/picoquic/sender.c (date 1670954584147)
@@ -207,20 +207,27 @@
stream_data = NULL;
ret = -1;
} else {
- picoquic_stream_queue_node_t** pprevious = &stream->send_queue;
- picoquic_stream_queue_node_t* next = stream->send_queue;
+ //picoquic_stream_queue_node_t** pprevious = &stream->send_queue;
+ picoquic_stream_queue_node_t* end = stream->send_queue_end;
memcpy(stream_data->bytes, data, length);
stream_data->length = length;
stream_data->offset = 0;
stream_data->next_stream_data = NULL;
- while (next != NULL) {
+ /*while (next != NULL) {
pprevious = &next->next_stream_data;
next = next->next_stream_data;
+ }*/
+
+ if (!end) {
+ stream->send_queue = stream_data;
+ } else {
+ end->next_stream_data = stream_data;
}
+ stream->send_queue_end = stream_data;
- *pprevious = stream_data;
+ //*pprevious = stream_data;
}
}
Index: picoquic/picoquic_internal.h
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/picoquic/picoquic_internal.h b/picoquic/picoquic_internal.h
--- a/picoquic/picoquic_internal.h (revision 7892ea1fd6270c412e740be890cb7c1f0db26a45)
+++ b/picoquic/picoquic_internal.h (date 1670954272711)
@@ -777,6 +777,7 @@
picosplay_tree_t stream_data_tree; /* splay of received stream segments */
uint64_t sent_offset; /* Amount of data sent in the stream */
picoquic_stream_queue_node_t* send_queue; /* if the stream is not "active", list of data segments ready to send */
+ picoquic_stream_queue_node_t* send_queue_end; /* if the stream is not "active", list of data segments ready to send */
void * app_stream_ctx;
picoquic_stream_direct_receive_fn direct_receive_fn; /* direct receive function, if not NULL */
void* direct_receive_ctx; /* direct receive context */