Diff
Not logged in

Differences From:

File src/winhttp.c part of check-in [24f336c9ae] - Make sure temporary files are well-named and are deleted after use in the win32 fossil server command. by drh on 2008-05-17 17:52:08. [view]

To:

File src/winhttp.c part of check-in [dfb68976be] - Add the "ui" command to automatically launch a web browser after starting the HTTP server. The web browser choice can be configured using the "setting" command. by drh on 2008-05-17 18:19:11. [view]

@@ -135,9 +135,9 @@
 /*
 ** Start a listening socket and process incoming HTTP requests on
 ** that socket.
 */
-void win32_http_server(int iPort){
+void win32_http_server(int iPort, char *zBrowser){
   WSADATA wd;
   SOCKET s;
   SOCKADDR_IN addr;
   int idCnt = 0;
@@ -160,8 +160,14 @@
   if( listen(s, SOMAXCONN)==SOCKET_ERROR ){
     closesocket(s);
     fossil_fatal("unable to listen");
   }
+  printf("Listening for HTTP requests on TCP port %d\n", iPort);
+  if( zBrowser ){
+    printf("Launch webbrowser: %s\n", zBrowser);
+    system(zBrowser);
+  }
+  printf("Type Ctrl-C to stop the HTTP server\n");
   for(;;){
     SOCKET client;
     SOCKADDR_IN client_addr;
     HttpRequest *p;