Check-in [04f7535ee3]
Not logged in
Overview

SHA1 Hash:04f7535ee31e45fad8d3bc8f61e313971c5c3d05
Date: 2007-08-01 12:20:24
User: drh
Comment:The merge at dd9633a03d did not work because of the bug just fixed. This change moves the changes that should have been in that merge into the main line of the tree.
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");
   }