Fixed core dumps when closing unintialized mongo or sqlite log instances

Fixed a Host header bug in sinqhttpopt
This commit is contained in:
2016-04-08 11:24:02 +02:00
parent 1087dd6c8d
commit 1fb85ef6b5
4 changed files with 16 additions and 11 deletions

View File

@ -168,11 +168,11 @@ static void sendGet(pHttpProt pHttp, char *path)
char buffer[1024];
char hostname[256];
gethostname(hostname,255);
ANETinfo(pHttp->sockHandle,hostname,sizeof(hostname));
snprintf(buffer,1024,"GET %s HTTP/1.1\r\nHost: %s\r\nConnection: keep-alive\r\n",
path, hostname);
ANETwrite(pHttp->sockHandle, buffer,strlen(buffer));
sendAuth(pHttp);
sendAuth(pHttp);
}
/*---------------------------------------------------------------------*/
static void sendPost(pHttpProt pHttp, char *path, char *data)
@ -180,7 +180,7 @@ static void sendPost(pHttpProt pHttp, char *path, char *data)
char buffer[1024];
char hostname[256];
gethostname(hostname,255);
ANETinfo(pHttp->sockHandle,hostname,sizeof(hostname));
snprintf(buffer,1024,"POST %s HTTP/1.1\r\nHost: %s\r\nConnection: keep-alive\r\n",
path, hostname);
ANETwrite(pHttp->sockHandle, buffer,strlen(buffer));