Fossil SCM
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.
Commit
04f7535ee31e45fad8d3bc8f61e313971c5c3d05
Parent
5c3e87171a336b0…
2 files changed
+8
-1
+6
+8
-1
| --- src/cgi.c | ||
| +++ src/cgi.c | ||
| @@ -1001,11 +1001,18 @@ | ||
| 1001 | 1001 | for(i=0; zToken[i] && zToken[i]!='?'; i++){} |
| 1002 | 1002 | if( zToken[i] ) zToken[i++] = 0; |
| 1003 | 1003 | cgi_setenv("PATH_INFO", zToken); |
| 1004 | 1004 | cgi_setenv("QUERY_STRING", &zToken[i]); |
| 1005 | 1005 | if( getpeername(fileno(stdin), (struct sockaddr*)&remoteName, &size)>=0 ){ |
| 1006 | - cgi_setenv("REMOTE_ADDR", inet_ntoa(remoteName.sin_addr)); | |
| 1006 | + char *zIpAddr = inet_ntoa(remoteName.sin_addr); | |
| 1007 | + cgi_setenv("REMOTE_ADDR", zIpAddr); | |
| 1008 | + | |
| 1009 | + /* Set the Global.zIpAddr variable to the server we are talking to. | |
| 1010 | + ** This is used to populate the ipaddr column of the rcvfrom table, | |
| 1011 | + ** if any files are received from the connected client. | |
| 1012 | + */ | |
| 1013 | + g.zIpAddr = mprintf("%s", zIpAddr); | |
| 1007 | 1014 | } |
| 1008 | 1015 | |
| 1009 | 1016 | /* Get all the optional fields that follow the first line. |
| 1010 | 1017 | */ |
| 1011 | 1018 | while( fgets(zLine,sizeof(zLine),stdin) ){ |
| 1012 | 1019 |
| --- src/cgi.c | |
| +++ src/cgi.c | |
| @@ -1001,11 +1001,18 @@ | |
| 1001 | for(i=0; zToken[i] && zToken[i]!='?'; i++){} |
| 1002 | if( zToken[i] ) zToken[i++] = 0; |
| 1003 | cgi_setenv("PATH_INFO", zToken); |
| 1004 | cgi_setenv("QUERY_STRING", &zToken[i]); |
| 1005 | if( getpeername(fileno(stdin), (struct sockaddr*)&remoteName, &size)>=0 ){ |
| 1006 | cgi_setenv("REMOTE_ADDR", inet_ntoa(remoteName.sin_addr)); |
| 1007 | } |
| 1008 | |
| 1009 | /* Get all the optional fields that follow the first line. |
| 1010 | */ |
| 1011 | while( fgets(zLine,sizeof(zLine),stdin) ){ |
| 1012 |
| --- src/cgi.c | |
| +++ src/cgi.c | |
| @@ -1001,11 +1001,18 @@ | |
| 1001 | for(i=0; zToken[i] && zToken[i]!='?'; i++){} |
| 1002 | if( zToken[i] ) zToken[i++] = 0; |
| 1003 | cgi_setenv("PATH_INFO", zToken); |
| 1004 | cgi_setenv("QUERY_STRING", &zToken[i]); |
| 1005 | if( getpeername(fileno(stdin), (struct sockaddr*)&remoteName, &size)>=0 ){ |
| 1006 | char *zIpAddr = inet_ntoa(remoteName.sin_addr); |
| 1007 | cgi_setenv("REMOTE_ADDR", zIpAddr); |
| 1008 | |
| 1009 | /* Set the Global.zIpAddr variable to the server we are talking to. |
| 1010 | ** This is used to populate the ipaddr column of the rcvfrom table, |
| 1011 | ** if any files are received from the connected client. |
| 1012 | */ |
| 1013 | g.zIpAddr = mprintf("%s", zIpAddr); |
| 1014 | } |
| 1015 | |
| 1016 | /* Get all the optional fields that follow the first line. |
| 1017 | */ |
| 1018 | while( fgets(zLine,sizeof(zLine),stdin) ){ |
| 1019 |
+6
| --- src/http.c | ||
| +++ src/http.c | ||
| @@ -61,10 +61,16 @@ | ||
| 61 | 61 | { |
| 62 | 62 | fossil_panic("can't resolve host name: %s\n", g.urlName); |
| 63 | 63 | } |
| 64 | 64 | } |
| 65 | 65 | addrIsInit = 1; |
| 66 | + | |
| 67 | + /* Set the Global.zIpAddr variable to the server we are talking to. | |
| 68 | + ** This is used to populate the ipaddr column of the rcvfrom table, | |
| 69 | + ** if any files are received from the server. | |
| 70 | + */ | |
| 71 | + g.zIpAddr = mprintf("%s", inet_ntoa(addr.sin_addr)); | |
| 66 | 72 | } |
| 67 | 73 | s = socket(AF_INET,SOCK_STREAM,0); |
| 68 | 74 | if( s<0 ){ |
| 69 | 75 | fossil_panic("cannot create a socket"); |
| 70 | 76 | } |
| 71 | 77 |
| --- src/http.c | |
| +++ src/http.c | |
| @@ -61,10 +61,16 @@ | |
| 61 | { |
| 62 | fossil_panic("can't resolve host name: %s\n", g.urlName); |
| 63 | } |
| 64 | } |
| 65 | addrIsInit = 1; |
| 66 | } |
| 67 | s = socket(AF_INET,SOCK_STREAM,0); |
| 68 | if( s<0 ){ |
| 69 | fossil_panic("cannot create a socket"); |
| 70 | } |
| 71 |
| --- src/http.c | |
| +++ src/http.c | |
| @@ -61,10 +61,16 @@ | |
| 61 | { |
| 62 | fossil_panic("can't resolve host name: %s\n", g.urlName); |
| 63 | } |
| 64 | } |
| 65 | addrIsInit = 1; |
| 66 | |
| 67 | /* Set the Global.zIpAddr variable to the server we are talking to. |
| 68 | ** This is used to populate the ipaddr column of the rcvfrom table, |
| 69 | ** if any files are received from the server. |
| 70 | */ |
| 71 | g.zIpAddr = mprintf("%s", inet_ntoa(addr.sin_addr)); |
| 72 | } |
| 73 | s = socket(AF_INET,SOCK_STREAM,0); |
| 74 | if( s<0 ){ |
| 75 | fossil_panic("cannot create a socket"); |
| 76 | } |
| 77 |