Start attempting to actually do IRC

This commit is contained in:
Darren VanBuren 2018-12-11 03:15:54 -08:00
parent 65d123ce2c
commit a66071288a
5 changed files with 75 additions and 5 deletions

View file

@ -1,7 +1,6 @@
#include <iostream>
#include "dns.h"
// NSPR include files
#include <prerror.h>
#include <prinit.h>
@ -19,6 +18,7 @@
// Qt-dependent Include Files, should come after NSPR / NSS
#include "ui.h"
#include "irc.h"
NSSInitContext *nssContext;
SECMODModule *builtInRootsMod;
@ -87,6 +87,11 @@ void init() {
}
}
void runIrc(void* args) {
irc* ircInst = (irc *) args;
ircInst->run();
}
int main(int argc, char *argv[]) {
init();
@ -105,7 +110,7 @@ int main(int argc, char *argv[]) {
PRFileDesc *tcpSocket = PR_OpenTCPSocket(PR_AF_INET6);
PRFileDesc *model = PR_NewTCPSocket();
theAddr.ipv6.port = PR_htons(443);
theAddr.ipv6.port = PR_htons(6697);
theAddr.raw.family = PR_AF_INET6;
PRFileDesc *nssSocket;
PRFileDesc *sslModel = SSL_ImportFD(NULL, model);
@ -175,6 +180,11 @@ int main(int argc, char *argv[]) {
char netBuf[8192];
irc *ircInst = new irc(nssSocket, "OKSnet", uiInstance);
PRThread* ircThread = PR_CreateThread(PR_SYSTEM_THREAD, runIrc, ircInst, PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
PR_JOINABLE_THREAD, 0);
// TEMP: Retreiving test file from HTTP daemon w/ TLS
// Send the request
snprintf(netBuf, sizeof(netBuf), "GET /junk/testfile.txt HTTP/1.0\r\nHost: buyvm.theoks.net\r\nUser-Agent: oksirc-testing\r\n\r\n");
@ -218,4 +228,5 @@ int main(int argc, char *argv[]) {
NSS_ShutdownContext(nssContext);
return qAppRetCode;
}
}