5359edc160de518d8e43fdd3448365c15b912c3c galt Mon Jul 22 11:48:10 2019 -0700 Added ipv6 support. Listening processes us hybrid dual stack feature of OS to simplify implementation and use a single listening socket. Works with both TCP and UDP. Parasol working. geoIp also updated and ready for IPv6. Should be invisible to most users, while providing connections via ipv6 where available. Supports both ipv4 and ipv6. diff --git src/parasol/parasol/parasol.c src/parasol/parasol/parasol.c index ab6205d..a6bfbe2 100644 --- src/parasol/parasol/parasol.c +++ src/parasol/parasol/parasol.c @@ -101,66 +101,66 @@ void getResultsFile(char results[PATH_LEN]) /* get the results file, either from -results= option or a default.*/ { char curDir[PATH_LEN]; char defaultResults[PATH_LEN]; (void) getcwd(curDir, sizeof(curDir)); // ignore return value safef(defaultResults, sizeof(defaultResults), "%s/results", curDir); safecpy(results, PATH_LEN, optionVal("results", defaultResults)); } boolean commandHubExt(char *command, struct paraMessage *pm, struct paraMultiMessage *pmm) /* Send a command to hub. */ { -pmInitFromName(pm, paraHubHost, paraHubPort); +pmInitFromName(pm, paraHubHost, paraHubPortStr); if (pmm) { /* ensure the multi-message response comes from the correct ip and has no duplicate msgs*/ - pmmInit(pmm, pm, pm->ipAddress.sin_addr); + pmmInit(pmm, pm); } return pmSendString(pm, hubRudp, command); } boolean commandHub(char *command) /* Send a command to hub. */ { struct paraMessage pm; return commandHubExt(command, &pm, NULL); } -char *hubCommandGetReciept(char *command) -/* Send command to hub, wait for one line respons and +char *hubCommandGetReceipt(char *command) +/* Send command to hub, wait for one line response and * return it. freeMem return value when done. */ { struct paraMessage pm; if (!commandHub(command)) return NULL; if (pmReceive(&pm, hubRudp)) return cloneString(pm.data); else return NULL; } void hubCommandCheckReceipt(char *command) /* Send command to hub, and wait for one line response which should * be 'ok'. */ { -char *line = hubCommandGetReciept(command); +char *line = hubCommandGetReceipt(command); if (line == NULL || !sameString(line, "ok")) errAbort("Hub didn't acknowledge %s", command); freeMem(line); } void hubCommandAndPrint(char *command) /* Send command to hub, and print response until blank line. */ { char *line = NULL; struct slRef *list = NULL, *ref; struct paraMessage pm; struct paraMultiMessage pmm; int count = 0; char *row[256]; @@ -264,62 +264,62 @@ char *err = optionVal("err", NULL); char *jobIdString; int i; char curDir[PATH_LEN]; (void) getcwd(curDir, sizeof(curDir)); // ignore return value char *dir = optionVal("dir", curDir); char results[PATH_LEN]; getResultsFile(results); dyStringPrintf(dy, "addJob2 %s %s %s %s %s %f %lld", userName, dir, in, out, results, cpuUsage, ramUsage); for (i=0; istring, dy->stringSize); -jobIdString = hubCommandGetReciept(dy->string); +jobIdString = hubCommandGetReceipt(dy->string); dyStringFree(&dy); if (sameString(jobIdString, "0")) errAbort("sick batch?: hub returned jobId==%s", jobIdString); if (printId) printf("%s\n", jobIdString); if (verbose) { printf("your job %s (\"%s", jobIdString, argv[0]); for (i=1; istring); +response = hubCommandGetReceipt(dy->string); if (!sameString(response, "0")) errAbort("Couldn't clear sick nodes for %s %s", userName, results); dyStringFree(&dy); freez(&response); } void checkDeadNodesASAP() /* Tell hub to check dead nodes for signs of life ASAP. */ { mustBeRoot(); commandHub("checkDeadNodesASAP"); } @@ -488,52 +488,52 @@ int i; for (i=0; i