Check-in [36edf3fd5c]
Not logged in
Overview

SHA1 Hash:36edf3fd5c8ed8ea20da2c723b956e1fc489ac06
Date: 2007-08-01 09:04:46
User: dan
Comment:Populate the ipaddr column of the rcvfrom table when a file is received from a remote source (push/pull/sync).
Timelines: ancestors | descendants | both | trunk
Other Links: files | ZIP archive | manifest

Tags And Properties
Changes
[hide diffs]

Modified src/cgi.c from [1776db11b6] to [0b7697e1bf].

@@ -1001,11 +1001,18 @@
   for(i=0; zToken[i] && zToken[i]!='?'; i++){}
   if( zToken[i] ) zToken[i++] = 0;
   cgi_setenv("PATH_INFO", zToken);
   cgi_setenv("QUERY_STRING", &zToken[i]);
   if( getpeername(fileno(stdin), (struct sockaddr*)&remoteName, &size)>=0 ){
-    cgi_setenv("REMOTE_ADDR", inet_ntoa(remoteName.sin_addr));
+    char *zIpAddr = inet_ntoa(remoteName.sin_addr);
+    cgi_setenv("REMOTE_ADDR", zIpAddr);
+
+    /* Set the Global.zIpAddr variable to the server we are talking to.
+    ** This is used to populate the ipaddr column of the rcvfrom table,
+    ** if any files are received from the connected client.
+    */
+    g.zIpAddr = mprintf("%s", zIpAddr);
   }
 
   /* Get all the optional fields that follow the first line.
   */
   while( fgets(zLine,sizeof(zLine),stdin) ){

Modified src/http.c from [23446a0581] to [e887c92c4d].

@@ -61,10 +61,16 @@
       {
         fossil_panic("can't resolve host name: %s\n", g.urlName);
       }
     }
     addrIsInit = 1;
+
+    /* Set the Global.zIpAddr variable to the server we are talking to.
+    ** This is used to populate the ipaddr column of the rcvfrom table,
+    ** if any files are received from the server.
+    */
+    g.zIpAddr = mprintf("%s", inet_ntoa(addr.sin_addr));
   }
   s = socket(AF_INET,SOCK_STREAM,0);
   if( s<0 ){
     fossil_panic("cannot create a socket");
   }