Fossil SCM
Make sure the socket of the "ui" and "server" commands is bound to the specified port when the -P or --port option is used. Ticket [7ef970e4a2]
Commit
53db94cd41f9eeaf5e9de68621e327f436d02159
Parent
72959c415eded01…
2 files changed
+2
-2
+2
-2
+2
-2
| --- src/cgi.c | ||
| +++ src/cgi.c | ||
| @@ -1214,11 +1214,11 @@ | ||
| 1214 | 1214 | struct timeval delay; /* How long to wait inside select() */ |
| 1215 | 1215 | struct sockaddr_in inaddr; /* The socket address */ |
| 1216 | 1216 | int opt = 1; /* setsockopt flag */ |
| 1217 | 1217 | int iPort = mnPort; |
| 1218 | 1218 | |
| 1219 | - while( iPort<mxPort ){ | |
| 1219 | + while( iPort<=mxPort ){ | |
| 1220 | 1220 | memset(&inaddr, 0, sizeof(inaddr)); |
| 1221 | 1221 | inaddr.sin_family = AF_INET; |
| 1222 | 1222 | inaddr.sin_addr.s_addr = INADDR_ANY; |
| 1223 | 1223 | inaddr.sin_port = htons(iPort); |
| 1224 | 1224 | listener = socket(AF_INET, SOCK_STREAM, 0); |
| @@ -1240,11 +1240,11 @@ | ||
| 1240 | 1240 | if( iPort>mxPort ){ |
| 1241 | 1241 | if( mnPort==mxPort ){ |
| 1242 | 1242 | fossil_fatal("unable to open listening socket on ports %d", mnPort); |
| 1243 | 1243 | }else{ |
| 1244 | 1244 | fossil_fatal("unable to open listening socket on any" |
| 1245 | - " ports %d..%d", mnPort, mxPort); | |
| 1245 | + " port in the range %d..%d", mnPort, mxPort); | |
| 1246 | 1246 | } |
| 1247 | 1247 | } |
| 1248 | 1248 | if( iPort>mxPort ) return 1; |
| 1249 | 1249 | listen(listener,10); |
| 1250 | 1250 | if( iPort>mnPort ){ |
| 1251 | 1251 |
| --- src/cgi.c | |
| +++ src/cgi.c | |
| @@ -1214,11 +1214,11 @@ | |
| 1214 | struct timeval delay; /* How long to wait inside select() */ |
| 1215 | struct sockaddr_in inaddr; /* The socket address */ |
| 1216 | int opt = 1; /* setsockopt flag */ |
| 1217 | int iPort = mnPort; |
| 1218 | |
| 1219 | while( iPort<mxPort ){ |
| 1220 | memset(&inaddr, 0, sizeof(inaddr)); |
| 1221 | inaddr.sin_family = AF_INET; |
| 1222 | inaddr.sin_addr.s_addr = INADDR_ANY; |
| 1223 | inaddr.sin_port = htons(iPort); |
| 1224 | listener = socket(AF_INET, SOCK_STREAM, 0); |
| @@ -1240,11 +1240,11 @@ | |
| 1240 | if( iPort>mxPort ){ |
| 1241 | if( mnPort==mxPort ){ |
| 1242 | fossil_fatal("unable to open listening socket on ports %d", mnPort); |
| 1243 | }else{ |
| 1244 | fossil_fatal("unable to open listening socket on any" |
| 1245 | " ports %d..%d", mnPort, mxPort); |
| 1246 | } |
| 1247 | } |
| 1248 | if( iPort>mxPort ) return 1; |
| 1249 | listen(listener,10); |
| 1250 | if( iPort>mnPort ){ |
| 1251 |
| --- src/cgi.c | |
| +++ src/cgi.c | |
| @@ -1214,11 +1214,11 @@ | |
| 1214 | struct timeval delay; /* How long to wait inside select() */ |
| 1215 | struct sockaddr_in inaddr; /* The socket address */ |
| 1216 | int opt = 1; /* setsockopt flag */ |
| 1217 | int iPort = mnPort; |
| 1218 | |
| 1219 | while( iPort<=mxPort ){ |
| 1220 | memset(&inaddr, 0, sizeof(inaddr)); |
| 1221 | inaddr.sin_family = AF_INET; |
| 1222 | inaddr.sin_addr.s_addr = INADDR_ANY; |
| 1223 | inaddr.sin_port = htons(iPort); |
| 1224 | listener = socket(AF_INET, SOCK_STREAM, 0); |
| @@ -1240,11 +1240,11 @@ | |
| 1240 | if( iPort>mxPort ){ |
| 1241 | if( mnPort==mxPort ){ |
| 1242 | fossil_fatal("unable to open listening socket on ports %d", mnPort); |
| 1243 | }else{ |
| 1244 | fossil_fatal("unable to open listening socket on any" |
| 1245 | " port in the range %d..%d", mnPort, mxPort); |
| 1246 | } |
| 1247 | } |
| 1248 | if( iPort>mxPort ) return 1; |
| 1249 | listen(listener,10); |
| 1250 | if( iPort>mnPort ){ |
| 1251 |
+2
-2
| --- src/winhttp.c | ||
| +++ src/winhttp.c | ||
| @@ -144,11 +144,11 @@ | ||
| 144 | 144 | int iPort = mnPort; |
| 145 | 145 | |
| 146 | 146 | if( WSAStartup(MAKEWORD(1,1), &wd) ){ |
| 147 | 147 | fossil_fatal("unable to initialize winsock"); |
| 148 | 148 | } |
| 149 | - while( iPort<mxPort ){ | |
| 149 | + while( iPort<=mxPort ){ | |
| 150 | 150 | s = socket(AF_INET, SOCK_STREAM, 0); |
| 151 | 151 | if( s==INVALID_SOCKET ){ |
| 152 | 152 | fossil_fatal("unable to create a socket"); |
| 153 | 153 | } |
| 154 | 154 | addr.sin_family = AF_INET; |
| @@ -169,11 +169,11 @@ | ||
| 169 | 169 | if( iPort>mxPort ){ |
| 170 | 170 | if( mnPort==mxPort ){ |
| 171 | 171 | fossil_fatal("unable to open listening socket on ports %d", mnPort); |
| 172 | 172 | }else{ |
| 173 | 173 | fossil_fatal("unable to open listening socket on any" |
| 174 | - " ports %d..%d", mnPort, mxPort); | |
| 174 | + " port in the range %d..%d", mnPort, mxPort); | |
| 175 | 175 | } |
| 176 | 176 | } |
| 177 | 177 | zTempPrefix = mprintf("fossil_server_P%d_", iPort); |
| 178 | 178 | printf("Listening for HTTP requests on TCP port %d\n", iPort); |
| 179 | 179 | if( zBrowser ){ |
| 180 | 180 |
| --- src/winhttp.c | |
| +++ src/winhttp.c | |
| @@ -144,11 +144,11 @@ | |
| 144 | int iPort = mnPort; |
| 145 | |
| 146 | if( WSAStartup(MAKEWORD(1,1), &wd) ){ |
| 147 | fossil_fatal("unable to initialize winsock"); |
| 148 | } |
| 149 | while( iPort<mxPort ){ |
| 150 | s = socket(AF_INET, SOCK_STREAM, 0); |
| 151 | if( s==INVALID_SOCKET ){ |
| 152 | fossil_fatal("unable to create a socket"); |
| 153 | } |
| 154 | addr.sin_family = AF_INET; |
| @@ -169,11 +169,11 @@ | |
| 169 | if( iPort>mxPort ){ |
| 170 | if( mnPort==mxPort ){ |
| 171 | fossil_fatal("unable to open listening socket on ports %d", mnPort); |
| 172 | }else{ |
| 173 | fossil_fatal("unable to open listening socket on any" |
| 174 | " ports %d..%d", mnPort, mxPort); |
| 175 | } |
| 176 | } |
| 177 | zTempPrefix = mprintf("fossil_server_P%d_", iPort); |
| 178 | printf("Listening for HTTP requests on TCP port %d\n", iPort); |
| 179 | if( zBrowser ){ |
| 180 |
| --- src/winhttp.c | |
| +++ src/winhttp.c | |
| @@ -144,11 +144,11 @@ | |
| 144 | int iPort = mnPort; |
| 145 | |
| 146 | if( WSAStartup(MAKEWORD(1,1), &wd) ){ |
| 147 | fossil_fatal("unable to initialize winsock"); |
| 148 | } |
| 149 | while( iPort<=mxPort ){ |
| 150 | s = socket(AF_INET, SOCK_STREAM, 0); |
| 151 | if( s==INVALID_SOCKET ){ |
| 152 | fossil_fatal("unable to create a socket"); |
| 153 | } |
| 154 | addr.sin_family = AF_INET; |
| @@ -169,11 +169,11 @@ | |
| 169 | if( iPort>mxPort ){ |
| 170 | if( mnPort==mxPort ){ |
| 171 | fossil_fatal("unable to open listening socket on ports %d", mnPort); |
| 172 | }else{ |
| 173 | fossil_fatal("unable to open listening socket on any" |
| 174 | " port in the range %d..%d", mnPort, mxPort); |
| 175 | } |
| 176 | } |
| 177 | zTempPrefix = mprintf("fossil_server_P%d_", iPort); |
| 178 | printf("Listening for HTTP requests on TCP port %d\n", iPort); |
| 179 | if( zBrowser ){ |
| 180 |