handle bad host sending us a c1 request

so we dont core
This commit is contained in:
Matt
2015-09-03 14:27:33 -06:00
parent ad95058fd5
commit 6cf69399e5
2 changed files with 9 additions and 1 deletions

@ -121,7 +121,7 @@ bool sendPageThreads ( TcpSocket *s , HttpRequest *r ) {
int64_t took = (now - t->m_launchedTime);
if(took <= 0) took = 1;
p.safePrintf("<td>%c%c%c/%"INT32"</td>", '?','?','?',t->m_bytesToGo);
p.safePrintf("<td>%.2f kbps</td>", 0.0);//(float)fs->m_bytesDone/took);
p.safePrintf("<td>%.2f MB/s</td>", 0.0);//(float)fs->m_bytesDone/took);
p.safePrintf("<td>%s</td>",t->m_doWrite? "Write":"Read");
}
else {

@ -13680,6 +13680,14 @@ void handleRequestc1 ( UdpSlot *slot , int32_t niceness ) {
char *req = slot->m_readBuf;
if ( ! slot->m_host ) {
log("handc1: no slot->m_host from ip=%s udpport=%i",
iptoa(slot->m_ip),(int)slot->m_port);
g_errno = ENOHOST;
us->sendErrorReply ( slot , g_errno );
return;
}
//if ( ! isClockSynced() ) {
//}