Fossil SCM

Adding some ipv4-only code to get the ip where we took the content from for the https connections. The "rcvfrom" information was lost in the case of https connections. I don't know how to make it work well for ipv6 too.

viriketo 2011-09-01 20:33 UTC trunk
Commit daa6a0eb9b03c4f091f541ee7162d46461e69157
1 file changed +11
--- src/http_ssl.c
+++ src/http_ssl.c
@@ -280,10 +280,21 @@
280280
if( blob_str(&ans)[0]=='a' ) {
281281
ssl_save_certificate(cert);
282282
}
283283
blob_reset(&ans);
284284
}
285
+
286
+ /* Set the Global.zIpAddr variable to the server we are talking to.
287
+ ** This is used to populate the ipaddr column of the rcvfrom table,
288
+ ** if any files are received from the server.
289
+ */
290
+ {
291
+ /* IPv4 only code */
292
+ const char *ip = BIO_get_conn_ip(iBio);
293
+ g.zIpAddr = mprintf("%d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]);
294
+ }
295
+
285296
X509_free(cert);
286297
return 0;
287298
}
288299
289300
/*
290301
--- src/http_ssl.c
+++ src/http_ssl.c
@@ -280,10 +280,21 @@
280 if( blob_str(&ans)[0]=='a' ) {
281 ssl_save_certificate(cert);
282 }
283 blob_reset(&ans);
284 }
 
 
 
 
 
 
 
 
 
 
 
285 X509_free(cert);
286 return 0;
287 }
288
289 /*
290
--- src/http_ssl.c
+++ src/http_ssl.c
@@ -280,10 +280,21 @@
280 if( blob_str(&ans)[0]=='a' ) {
281 ssl_save_certificate(cert);
282 }
283 blob_reset(&ans);
284 }
285
286 /* Set the Global.zIpAddr variable to the server we are talking to.
287 ** This is used to populate the ipaddr column of the rcvfrom table,
288 ** if any files are received from the server.
289 */
290 {
291 /* IPv4 only code */
292 const char *ip = BIO_get_conn_ip(iBio);
293 g.zIpAddr = mprintf("%d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]);
294 }
295
296 X509_free(cert);
297 return 0;
298 }
299
300 /*
301

Keyboard Shortcuts

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