Refactored protocol code to use defined IDs rather then raw integers
This commit is contained in:
12
nread.c
12
nread.c
@@ -42,6 +42,8 @@
|
||||
#include "commandlog.h"
|
||||
#include "uselect.h"
|
||||
#include "trace.h"
|
||||
#include "protocol.h"
|
||||
|
||||
|
||||
extern pServer pServ;
|
||||
extern int VerifyChannel(mkChannel * self); /* defined in network.c */
|
||||
@@ -296,7 +298,7 @@ static int NetReadRead(pNetRead self, pNetItem pItem)
|
||||
if (strlen(pItem->pHold) > 0) {
|
||||
strlcat(pItem->pHold, pPtr, 511);
|
||||
/* DFC locking for protocol zero only */
|
||||
if (pItem->pCon->iProtocolID == 0 &&
|
||||
if (pItem->pCon->iProtocolID == PROTSICS &&
|
||||
CostaLocked(pItem->pCon->pStack))
|
||||
iStat = 0;
|
||||
else
|
||||
@@ -308,7 +310,7 @@ static int NetReadRead(pNetRead self, pNetItem pItem)
|
||||
} else {
|
||||
/* no, normal command */
|
||||
/* DFC locking for protocol zero only */
|
||||
if (pItem->pCon->iProtocolID == 0 &&
|
||||
if (pItem->pCon->iProtocolID == PROTSICS &&
|
||||
CostaLocked(pItem->pCon->pStack))
|
||||
iStat = 0;
|
||||
else
|
||||
@@ -498,7 +500,7 @@ static int TelnetRead(pNetRead self, pNetItem pItem)
|
||||
case '\r':
|
||||
case '\n':
|
||||
/* DFC locking for protocol zero only */
|
||||
if (pItem->pCon->iProtocolID == 0 &&
|
||||
if (pItem->pCon->iProtocolID == PROTSICS &&
|
||||
CostaLocked(pItem->pCon->pStack))
|
||||
iStat = 0;
|
||||
else
|
||||
@@ -1076,7 +1078,7 @@ static int CommandDataCB(int handle, void *userData)
|
||||
if (pPtr[i] == '\r' || pPtr[i] == '\n') {
|
||||
self->state = SKIPTERM;
|
||||
if (!testAndInvokeInterrupt(self, handle)) {
|
||||
if (self->pCon->iProtocolID == 0 && CostaLocked(self->pCon->pStack))
|
||||
if (self->pCon->iProtocolID == PROTSICS && CostaLocked(self->pCon->pStack))
|
||||
status = 0;
|
||||
else
|
||||
status = CostaTop(self->pCon->pStack, GetCharArray(self->command));
|
||||
@@ -1180,7 +1182,7 @@ static int ANETTelnetProcess(int handle, void *usData)
|
||||
case '\r':
|
||||
case '\n':
|
||||
if (!testAndInvokeInterrupt(self, handle)) {
|
||||
if (self->pCon->iProtocolID == 0 && CostaLocked(self->pCon->pStack))
|
||||
if (self->pCon->iProtocolID == PROTSICS && CostaLocked(self->pCon->pStack))
|
||||
status = 0;
|
||||
else
|
||||
status = CostaTop(self->pCon->pStack, GetCharArray(self->command));
|
||||
|
||||
Reference in New Issue
Block a user