Fossil SCM

Add new "transport_flip()" and "transport_rewind()" methods. These are no-ops for HTTP, but might be useful for FILE and maybe even HTTPS.

drh 2009-03-30 01:12 trunk
Commit 63ef585508a08ac847390be8506082ae098bd62e
+3
--- src/http.c
+++ src/http.c
@@ -167,10 +167,11 @@
167167
*/
168168
transport_send(&hdr);
169169
transport_send(&payload);
170170
blob_reset(&hdr);
171171
blob_reset(&payload);
172
+ transport_flip();
172173
173174
/*
174175
** Read and interpret the server reply
175176
*/
176177
closeConnection = 1;
@@ -216,10 +217,12 @@
216217
/*
217218
** Close the connection to the server if appropriate.
218219
*/
219220
if( closeConnection ){
220221
transport_close();
222
+ }else{
223
+ transport_rewind();
221224
}
222225
return;
223226
224227
/*
225228
** Jump to here if an error is seen.
226229
--- src/http.c
+++ src/http.c
@@ -167,10 +167,11 @@
167 */
168 transport_send(&hdr);
169 transport_send(&payload);
170 blob_reset(&hdr);
171 blob_reset(&payload);
 
172
173 /*
174 ** Read and interpret the server reply
175 */
176 closeConnection = 1;
@@ -216,10 +217,12 @@
216 /*
217 ** Close the connection to the server if appropriate.
218 */
219 if( closeConnection ){
220 transport_close();
 
 
221 }
222 return;
223
224 /*
225 ** Jump to here if an error is seen.
226
--- src/http.c
+++ src/http.c
@@ -167,10 +167,11 @@
167 */
168 transport_send(&hdr);
169 transport_send(&payload);
170 blob_reset(&hdr);
171 blob_reset(&payload);
172 transport_flip();
173
174 /*
175 ** Read and interpret the server reply
176 */
177 closeConnection = 1;
@@ -216,10 +217,12 @@
217 /*
218 ** Close the connection to the server if appropriate.
219 */
220 if( closeConnection ){
221 transport_close();
222 }else{
223 transport_rewind();
224 }
225 return;
226
227 /*
228 ** Jump to here if an error is seen.
229
--- src/http_transport.c
+++ src/http_transport.c
@@ -114,10 +114,30 @@
114114
if( sent<=0 ) break;
115115
n -= sent;
116116
}
117117
}
118118
}
119
+
120
+/*
121
+** This routine is called when the outbound message is complete and
122
+** it is time to being recieving a reply.
123
+*/
124
+void transport_flip(void){
125
+ if( g.urlIsFile ){
126
+ /* run "fossil http" to process the outbound message */
127
+ }
128
+}
129
+
130
+/*
131
+** This routine is called when the inbound message has been received
132
+** and it is time to start sending again.
133
+*/
134
+void transport_rewind(void){
135
+ if( g.urlIsFile ){
136
+ transport_close();
137
+ }
138
+}
119139
120140
/*
121141
** Read N bytes of content from the wire and store in the supplied buffer.
122142
** Return the number of bytes actually received.
123143
*/
124144
--- src/http_transport.c
+++ src/http_transport.c
@@ -114,10 +114,30 @@
114 if( sent<=0 ) break;
115 n -= sent;
116 }
117 }
118 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
119
120 /*
121 ** Read N bytes of content from the wire and store in the supplied buffer.
122 ** Return the number of bytes actually received.
123 */
124
--- src/http_transport.c
+++ src/http_transport.c
@@ -114,10 +114,30 @@
114 if( sent<=0 ) break;
115 n -= sent;
116 }
117 }
118 }
119
120 /*
121 ** This routine is called when the outbound message is complete and
122 ** it is time to being recieving a reply.
123 */
124 void transport_flip(void){
125 if( g.urlIsFile ){
126 /* run "fossil http" to process the outbound message */
127 }
128 }
129
130 /*
131 ** This routine is called when the inbound message has been received
132 ** and it is time to start sending again.
133 */
134 void transport_rewind(void){
135 if( g.urlIsFile ){
136 transport_close();
137 }
138 }
139
140 /*
141 ** Read N bytes of content from the wire and store in the supplied buffer.
142 ** Return the number of bytes actually received.
143 */
144

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button