Fossil

Changes On Branch windows-loopback-ipv6
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Changes In Branch windows-loopback-ipv6 Excluding Merge-Ins

This is equivalent to a diff from 96dcb7e709 to c038de8d27

2018-01-03
23:55
In the "fossil ui" and "fossil server" commands on Windows, use IPv6 for loopback. check-in: 696e14811d user: drh tags: trunk
22:13
Fix harmless compiler warning. check-in: a61922e2be user: mistachkin tags: trunk
20:07
For "fossil ui" and "fossil server" use the IPV6 loopback on Windows. Closed-Leaf check-in: c038de8d27 user: drh tags: windows-loopback-ipv6
18:56
Accept both "127.0.0.1" and "::ffff:127.0.0.1" as valid loopback IP addresses. check-in: 96dcb7e709 user: drh tags: trunk
2018-01-02
11:37
Fix the login mechanism on the new IPv6 code for "fossil server" on Windows. Patch from Olivier Mascia. check-in: 723dedac57 user: drh tags: trunk

Changes to src/cgi.c.
2037
2038
2039
2040
2041
2042
2043
2044

2045
}

/*
** Return true if information is coming from the loopback network.
*/
int cgi_is_loopback(const char *zIpAddr){
  return fossil_strcmp(zIpAddr, "127.0.0.1")==0 ||
         fossil_strcmp(zIpAddr, "::ffff:127.0.0.1")==0;

}







|
>

2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
}

/*
** Return true if information is coming from the loopback network.
*/
int cgi_is_loopback(const char *zIpAddr){
  return fossil_strcmp(zIpAddr, "127.0.0.1")==0 ||
         fossil_strcmp(zIpAddr, "::ffff:127.0.0.1")==0 ||
         fossil_strcmp(zIpAddr, "::1")==0;
}
Changes to src/main.c.
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
  /* Win32 implementation */
  if( isUiCmd ){
    zBrowser = db_get("web-browser", "start");
    if( zIpAddr ){
      zBrowserCmd = mprintf("%s http://%s:%%d/%s &",
                            zBrowser, zIpAddr, zInitPage);
    }else{
      zBrowserCmd = mprintf("%s http://localhost:%%d/%s &",
                            zBrowser, zInitPage);
    }
  }
  if( g.repositoryOpen ) flags |= HTTP_SERVER_HAD_REPOSITORY;
  if( g.localOpen ) flags |= HTTP_SERVER_HAD_CHECKOUT;
  db_close(1);
  if( allowRepoList ){







|







2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
  /* Win32 implementation */
  if( isUiCmd ){
    zBrowser = db_get("web-browser", "start");
    if( zIpAddr ){
      zBrowserCmd = mprintf("%s http://%s:%%d/%s &",
                            zBrowser, zIpAddr, zInitPage);
    }else{
      zBrowserCmd = mprintf("%s http://[::1]:%%d/%s &",
                            zBrowser, zInitPage);
    }
  }
  if( g.repositoryOpen ) flags |= HTTP_SERVER_HAD_REPOSITORY;
  if( g.localOpen ) flags |= HTTP_SERVER_HAD_CHECKOUT;
  db_close(1);
  if( allowRepoList ){
Changes to src/winhttp.c.
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
                 zSavedKey, savedKeySize);
  }
#endif
  if( WSAStartup(MAKEWORD(2,0), &wd) ){
    fossil_fatal("unable to initialize winsock");
  }
  if( flags & HTTP_SERVER_LOCALHOST ){
    zIpAddr = "127.0.0.1";
  }
  while( iPort<=mxPort ){
    DWORD ipv6only = 0;
    s = socket(AF_INET6, SOCK_STREAM, 0);
    if( s==INVALID_SOCKET ){
      fossil_fatal("unable to create a socket");
    }







|







374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
                 zSavedKey, savedKeySize);
  }
#endif
  if( WSAStartup(MAKEWORD(2,0), &wd) ){
    fossil_fatal("unable to initialize winsock");
  }
  if( flags & HTTP_SERVER_LOCALHOST ){
    zIpAddr = "::1";
  }
  while( iPort<=mxPort ){
    DWORD ipv6only = 0;
    s = socket(AF_INET6, SOCK_STREAM, 0);
    if( s==INVALID_SOCKET ){
      fossil_fatal("unable to create a socket");
    }