Con_Handle->Encrypt_Key_Len = SVAL(SMB_Hdr(pkt), SMB_negrLM_ekl_offset);
p = (SMB_Hdr(pkt) + SMB_negrLM_buf_offset);
- fprintf(stderr, "%d", (int) (SMB_Hdr(pkt) + SMB_negrLM_buf_offset));
memcpy(Con_Handle->Encrypt_Key, p, 8);
p = (SMB_Hdr(pkt) + SMB_negrLM_buf_offset + Con_Handle->Encrypt_Key_Len);
int SMBlib_SMB_Error;
#define SMBLIB_ERRNO
#define uchar unsigned char
+#include "util.h"
#include "smblib-priv.h"
#include "smblib.h"
#include "rfcnb-priv.h"
* service we are going to call, sine some servers want it in uppercase */
for (i = 0; i < strlen(server); i++)
- called[i] = toupper(server[i]);
+ called[i] = xtoupper(server[i]);
called[strlen(server)] = 0; /* Make it a string */
for (i = 0; i < strlen(con->myname); i++)
- calling[i] = toupper(con->myname[i]);
+ calling[i] = xtoupper(con->myname[i]);
calling[strlen(con->myname)] = 0; /* Make it a string */
* service we are going to call, sine some servers want it in uppercase */
for (i = 0; i < strlen(host); i++)
- called[i] = toupper(host[i]);
+ called[i] = xtoupper(host[i]);
called[strlen(host)] = 0; /* Make it a string */
for (i = 0; i < strlen(con->myname); i++)
- calling[i] = toupper(con->myname[i]);
+ calling[i] = xtoupper(con->myname[i]);
calling[strlen(con->myname)] = 0; /* Make it a string */
{
char *p = string, c;
while ((c = *p)) {
- *p = toupper(c);
+ *p = xtoupper(c);
p++;
}
}
{
char *p = string, c;
while ((c = *p)) {
- *p = tolower(c);
+ *p = xtolower(c);
p++;
}
}
* #endif *//* KANJI_WIN95_COMPATIBILITY */
{
if (islower((int)(unsigned char)*s))
- *s = toupper(*s);
+ *s = xtoupper(*s);
s++;
}
}
* service we are going to call, sine some servers want it in uppercase */
for (i = 0; i < strlen(server); i++)
- called[i] = toupper(server[i]);
+ called[i] = xtoupper(server[i]);
called[strlen(server)] = 0; /* Make it a string */
for (i = 0; i < strlen(con->myname); i++)
- calling[i] = toupper(con->myname[i]);
+ calling[i] = xtoupper(con->myname[i]);
calling[strlen(con->myname)] = 0; /* Make it a string */
* service we are going to call, sine some servers want it in uppercase */
for (i = 0; i < strlen(host); i++)
- called[i] = toupper(host[i]);
+ called[i] = xtoupper(host[i]);
called[strlen(host)] = 0; /* Make it a string */
for (i = 0; i < strlen(con->myname); i++)
- calling[i] = toupper(con->myname[i]);
+ calling[i] = xtoupper(con->myname[i]);
calling[strlen(con->myname)] = 0; /* Make it a string */
*/
/* the types are provided by squid's configure preocess */
+#include "util.h"
#define BOOL int16_t
#define int16 int16_t
{
char *p = string, c;
while ((c = *p)) {
- *p = tolower(c);
+ *p = xtolower(c);
p++;
}
}
{
hrtime_t regs;
-asm volatile ("rpcc $0":"=A" (regs)); /* I'm not sure of syntax */
+asm volatile ("rpcc %0" : "=r" (regs));
return regs;
}
get_tick(void)
{
hrtime_t regs;
+
__asm {
cpuid
rdtsc
/*
- * $Id: hash.c,v 1.17 2004/12/21 17:28:28 robertc Exp $
+ * $Id: hash.c,v 1.18 2005/07/03 15:25:07 serassio Exp $
*
* DEBUG: section 0 Hash Tables
* AUTHOR: Harvest Derived
void
hash_last(hash_table * hid)
{
- assert(hid);
+ assert(hid != NULL);
hid->next = NULL;
hid->current_slot = 0;
}
void
hashFreeMemory(hash_table * hid)
{
- assert(hid);
+ assert(hid != NULL);
if (hid->buckets)
xfree(hid->buckets);
xfree(hid);
/*
- * $Id: heap.c,v 1.9 2003/01/23 00:37:01 robertc Exp $
+ * $Id: heap.c,v 1.10 2005/07/03 15:25:07 serassio Exp $
*
* AUTHOR: John Dilley, Hewlett Packard
*
delete_heap(heap * hp)
{
int i;
- assert(hp);
+ assert(hp != NULL);
for (i = 0; i < hp->last; i++) {
xfree(hp->nodes[i]);
}
/*
- * $Id: rfc1123.c,v 1.34 2005/03/09 20:02:06 serassio Exp $
+ * $Id: rfc1123.c,v 1.35 2005/07/03 15:25:07 serassio Exp $
*
* DEBUG:
* AUTHOR: Harvest Derived
#elif defined(_SQUID_CYGWIN_)
#elif defined(_SQUID_MSWIN_)
#else
- extern time_t timezone;
+ extern long timezone;
#endif
/*
* The following assumes a fixed DST offset of 1 hour,
/*
- * $Id: util.c,v 1.92 2004/12/21 17:28:28 robertc Exp $
+ * $Id: util.c,v 1.93 2005/07/03 15:25:07 serassio Exp $
*
* DEBUG:
* AUTHOR: Harvest Derived
size_t sz;
void *p;
PROF_start(xstrndup);
- assert(s);
+ assert(s != NULL);
assert(n);
sz = strlen(s) + 1;
if (sz > n)
while (*s1 && *s2) {
if (xisupper(*s1))
- c1 = tolower(*s1);
+ c1 = xtolower(*s1);
else
c1 = *s1;
if (xisupper(*s2))
- c2 = tolower(*s2);
+ c2 = xtolower(*s2);
else
c2 = *s2;
if (c1 != c2)
#define WRITEONLY 20
#undef NOACCESS
#define NOACCESS 21
-#define STATUS 22
+#define SNMP_STATUS 22
#define MANDATORY 23
#define SNMP_OPTIONAL 24
#define OBSOLETE 25
{"read-only", sizeof("read-only") - 1, READONLY},
{"ACCESS", sizeof("ACCESS") - 1, ACCESS},
{"MAX-ACCESS", sizeof("MAX-ACCESS") - 1, ACCESS},
- {"STATUS", sizeof("STATUS") - 1, STATUS},
+ {"STATUS", sizeof("STATUS") - 1, SNMP_STATUS},
{"SYNTAX", sizeof("SYNTAX") - 1, SYNTAX},
{"OBJECT-TYPE", sizeof("OBJECT-TYPE") - 1, OBJTYPE},
{"{", sizeof("{") - 1, LEFTBRACKET},
return 0;
}
type = get_token(fp, token);
- if (type != STATUS) {
+ if (type != SNMP_STATUS) {
print_error("Should be STATUS", token, nexttype);
free_node(np);
return 0;
/*
- * $Id: diskd.cc,v 1.2 2004/12/21 15:47:33 robertc Exp $
+ * $Id: diskd.cc,v 1.3 2005/07/03 15:25:09 serassio Exp $
*
* DEBUG: section -- External DISKD process implementation.
* AUTHOR: Harvest Derived
#include "DiskIO/DiskDaemon/diomsg.h"
-#undef assert
-#include <assert.h>
+void
+xassert(const char *msg, const char *file, int line)
+{
+ fprintf(stderr,"assertion failed: %s:%d: \"%s\"\n", file, line, msg);
+ abort();
+}
const int diomsg::msg_snd_rcv_sz = sizeof(diomsg) - sizeof(mtyp_t);
#define DEBUG(LEVEL) if ((LEVEL) <= DebugLevel)
/*
- * $Id: ESI.cc,v 1.14 2005/06/03 15:24:14 serassio Exp $
+ * $Id: ESI.cc,v 1.15 2005/07/03 15:25:08 serassio Exp $
*
* DEBUG: section 86 ESI processing
* AUTHOR: Robert Collins
cbdataReferenceDone (templock);
- debug (86,5)("ESIContext::send: this=%p sent %d\n",this,len);
+ debugs (86,5,"ESIContext::send: this=" << this << " sent " << len);
return len;
}
/* Increase our buffer area with incoming data */
assert (recievedData.length <= HTTP_REQBUF_SZ);
assert (thisNode->readBuffer.offset == recievedData.offset);
- debug (86,5)("esiProcessStream found %u bytes of body data at offset %ld\n", recievedData.length, (long)recievedData.offset);
+ debugs (86,5, "esiProcessStream found " << recievedData.length << " bytes of body data at offset " << recievedData.offset);
/* secure the data for later use */
if (!context->incoming.getRaw()) {
debug (86,0)("ESIContext::parserComment: Parsing fragment '%s' failed.\n", s + 3);
setError();
char tempstr[1024];
- snprintf(tempstr, 1023, "ESIContext::parserComment: Parse error at line %d:\n%s\n",
+ snprintf(tempstr, 1023, "ESIContext::parserComment: Parse error at line %ld:\n%s\n",
tempParser->lineNumber(),
tempParser->errorString());
debug (86,0)("%s",tempstr);
{
assert (buffered.getRaw());
- debug (86,9)("ESIContext::parseOneBuffer: %d bytes\n",buffered->len);
+ debugs (86,9,"ESIContext::parseOneBuffer: " << buffered->len << " bytes");
bool lastBlock = buffered->next.getRaw() == NULL && flags.finishedtemplate ? true : false;
if (! parserState.theParser->parse(buffered->buf, buffered->len, lastBlock)) {
setError();
char tempstr[1024];
- snprintf (tempstr, 1023, "esiProcess: Parse error at line %d:\n%s\n",
+ snprintf (tempstr, 1023, "esiProcess: Parse error at line %ld:\n%s\n",
parserState.theParser->lineNumber(),
parserState.theParser->errorString());
debug (86,0)("%s", tempstr);
} else {
elements.push_back (element);
- debug (86,3)("esiChooseAdd: Added a new element, elements = %d\n", elements.size());
+ debugs (86,3, "esiChooseAdd: Added a new element, elements = " << elements.size());
if (chosenelement == -1)
if ((dynamic_cast<esiWhen *>(element.getRaw()))->
testsTrue()) {
chosenelement = elements.size() - 1;
- debug (86,3)("esiChooseAdd: Chose element %d\n", elements.size());
+ debugs (86,3, "esiChooseAdd: Chose element " << elements.size());
}
}
if ((dynamic_cast<esiWhen *>(elements[counter].getRaw()))->
testsTrue()) {
chosenelement = counter;
- debug (86,3)("esiChooseAdd: Chose element %d\n", counter + 1);
+ debugs (86,3, "esiChooseAdd: Chose element " << counter + 1);
return;
}
}
/*
- * $Id: ESICustomParser.cc,v 1.6 2005/03/28 21:44:12 hno Exp $
+ * $Id: ESICustomParser.cc,v 1.7 2005/07/03 15:25:08 serassio Exp $
*
* DEBUG: section 86 ESI processing
* AUTHOR: Robert Collins
SearchTrie = new Trie(new TrieCaseless);
+ static const ESITAG_t ESITAG_value = ESITAG;
+
assert (SearchTrie->add
- ("<esi:",5,(void *)ESITAG));
+ ("<esi:",5,(void *)&ESITAG_value));
+
+ static const ESITAG_t ESIENDTAG_value = ESIENDTAG;
assert (SearchTrie->add
- ("</esi:",6,(void *)ESIENDTAG));
+ ("</esi:",6,(void *)&ESIENDTAG_value));
+
+ static const ESITAG_t ESICOMMENT_value = ESICOMMENT;
assert (SearchTrie->add
- ("<!--",4,(void *)ESICOMMENT));
+ ("<!--",4,(void *)&ESICOMMENT_value));
return SearchTrie;
}
ESICustomParser::findTag(char const *buffer, size_t bufferLength)
{
size_t myOffset (0);
- void *resulttype = NULL;
+ ESITAG_t *resulttype = NULL;
while (myOffset < bufferLength &&
- (resulttype =GetTrie()->findPrefix (buffer + myOffset, bufferLength - myOffset)) == NULL)
+ (resulttype = static_cast<ESITAG_t *>(GetTrie()->findPrefix (buffer + myOffset, bufferLength - myOffset)))
+ == NULL)
++myOffset;
if (myOffset == bufferLength)
return NULL;
- debug (86,9)("ESICustomParser::findTag: found %p\n", resulttype);
+ debug (86,9)("ESICustomParser::findTag: found %d\n", *resulttype);
- /* Yuck! */
- lastTag = static_cast<ESITAG_t>((int)resulttype);
+ lastTag = *resulttype;
return buffer + myOffset;
}
return !openESITags;
}
-size_t
+long int
ESICustomParser::lineNumber() const
{
/* We don't track lines in the body */
/*
- * $Id: ESICustomParser.h,v 1.5 2005/03/28 21:44:12 hno Exp $
+ * $Id: ESICustomParser.h,v 1.6 2005/07/03 15:25:08 serassio Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
~ESICustomParser();
/* true on success */
bool parse(char const *dataToParse, size_t const lengthOfData, bool const endOfStream);
- size_t lineNumber() const;
+ long int lineNumber() const;
char const * errorString() const;
private:
/*
- * $Id: ESIExpatParser.cc,v 1.3 2005/03/28 21:44:12 hno Exp $
+ * $Id: ESIExpatParser.cc,v 1.4 2005/07/03 15:25:08 serassio Exp $
*
* DEBUG: section 86 ESI processing
* AUTHOR: Robert Collins
return XML_Parse(myParser(), dataToParse, lengthOfData, endOfStream);
}
-size_t
+long int
ESIExpatParser::lineNumber() const
{
- return XML_GetCurrentLineNumber(myParser());
+ return (long int)XML_GetCurrentLineNumber(myParser());
}
char const *
/*
- * $Id: ESIExpatParser.h,v 1.3 2005/03/28 21:44:12 hno Exp $
+ * $Id: ESIExpatParser.h,v 1.4 2005/07/03 15:25:08 serassio Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
~ESIExpatParser();
/* true on success */
bool parse(char const *dataToParse, size_t const lengthOfData, bool const endOfStream);
- size_t lineNumber() const;
+ long int lineNumber() const;
char const * errorString() const;
private:
/*
- * $Id: ESIExpression.cc,v 1.3 2003/07/14 14:15:56 robertc Exp $
+ * $Id: ESIExpression.cc,v 1.4 2005/07/03 15:25:08 serassio Exp $
*
* DEBUG: section 86 ESI processing
* AUTHOR: Robert Collins
debug (86,1) ("failed to convert '%s' to float \n", s);
*endptr = origs;
} else {
- debug (86,6) ("found %f of length %d\n",rv.value.floating, end - s);
+ debugs (86,6, "found " << rv.value.floating << " of length " << end - s);
*endptr = end;
rv.eval = evalliteral;
rv.valuestored = ESI_LITERAL_FLOAT;
debug (86,1) ("failed to convert '%s' to int \n", s);
*endptr = origs;
} else {
- debug (86,6) ("found %d of length %d\n",rv.value.integral, end - s);
+ debugs (86,6, "found " << rv.value.integral << " of length " << end - s);
*endptr = end;
rv.eval = evalliteral;
rv.valuestored = ESI_LITERAL_INT;
/*
- * $Id: ESIInclude.cc,v 1.5 2004/12/21 17:28:29 robertc Exp $
+ * $Id: ESIInclude.cc,v 1.6 2005/07/03 15:25:08 serassio Exp $
*
* DEBUG: section 86 ESI processing
* AUTHOR: Robert Collins
assert (recievedData.length <= sizeof(esiStream->localbuffer->buf));
assert (!esiStream->finished);
- debug (86,5) ("esiBufferRecipient rep %p body %p len %d\n", rep, recievedData.data, recievedData.length);
+ debugs (86,5, "esiBufferRecipient rep " << rep << " body " << recievedData.data << " len " << recievedData.length);
assert (node->readBuffer.offset == recievedData.offset || recievedData.length == 0);
/* trivial case */
/*
- * $Id: ESILibxml2Parser.cc,v 1.2 2005/03/28 21:44:12 hno Exp $
+ * $Id: ESILibxml2Parser.cc,v 1.3 2005/07/03 15:25:08 serassio Exp $
*
* AUTHOR: Joachim Bauch (mail@joachim-bauch.de)
*
return (xmlParseChunk(parser, dataToParse, lengthOfData, endOfStream) == 0);
}
-size_t
+long int
ESILibxml2Parser::lineNumber() const
{
- return xmlSAX2GetLineNumber(parser);
+ return (long int)xmlSAX2GetLineNumber(parser);
}
char const *
/*
- * $Id: ESILibxml2Parser.h,v 1.2 2005/03/28 21:44:12 hno Exp $
+ * $Id: ESILibxml2Parser.h,v 1.3 2005/07/03 15:25:08 serassio Exp $
*
* AUTHOR: Joachim Bauch (mail@joachim-bauch.de)
*
~ESILibxml2Parser();
/* true on success */
bool parse(char const *dataToParse, size_t const lengthOfData, bool const endOfStream);
- size_t lineNumber() const;
+ long int lineNumber() const;
char const * errorString() const;
ESIParserClient *getClient() { return theClient; }
/*
- * $Id: ESIParser.h,v 1.4 2005/04/30 19:32:01 serassio Exp $
+ * $Id: ESIParser.h,v 1.5 2005/07/03 15:25:08 serassio Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
static char *Type;
/* true on success */
virtual bool parse(char const *dataToParse, size_t const lengthOfData, bool const endOfStream) = 0;
- virtual size_t lineNumber() const =0;
+ virtual long int lineNumber() const =0;
virtual char const * errorString() const =0;
protected:
/*
- * $Id: ESISequence.cc,v 1.4 2004/08/30 05:12:31 robertc Exp $
+ * $Id: ESISequence.cc,v 1.5 2005/07/03 15:25:08 serassio Exp $
*
* DEBUG: section 86 ESI processing
* AUTHOR: Robert Collins
* and rendered elements
*/
assert (output->next == NULL);
- debug (86,5)("esiSequenceRender: rendering %d elements\n", processedcount);
+ debugs (86,5, "esiSequenceRender: rendering " << processedcount << " elements");
for (size_t i = 0; i < processedcount; ++i) {
elements[i]->render(output);
}
elements.push_back(element);
- debug (86,3)("esiSequenceAdd: Added a new element, elements = %d\n", elements.size());
+ debugs (86,3, "esiSequenceAdd: Added a new element, elements = " << elements.size());
return true;
}
esiProcessResult_t
esiSequence::processOne(int dovars, size_t index)
{
- debug (86,5)("esiSequence::process %p about to process element[%d] %p\n", this, index, elements[index].getRaw());
+ debugs (86,5, "esiSequence::process " << this << " about to process element[" << index << "] " << elements[index].getRaw());
switch (elements[index]->process(dovars)) {
/*
- * $Id: ESIVarState.cc,v 1.4 2005/01/06 13:16:39 serassio Exp $
+ * $Id: ESIVarState.cc,v 1.5 2005/07/03 15:25:08 serassio Exp $
*
* DEBUG: section 86 ESI processing
* AUTHOR: Robert Collins
ESIVarState::feedData (const char *buf, size_t len)
{
/* TODO: if needed - tune to skip segment iteration */
- debug (86,6)("esiVarState::feedData: accepting %d bytes\n", len);
+ debugs (86,6, "esiVarState::feedData: accepting " << len << " bytes");
ESISegment::ListAppend (input, buf, len);
}
/*
- * $Id: StoreHashIndex.h,v 1.1 2005/01/03 16:08:25 robertc Exp $
+ * $Id: StoreHashIndex.h,v 1.2 2005/07/03 15:25:08 serassio Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
virtual void maintain();
- virtual void updateSize(unsigned int, int);
+ virtual void updateSize(size_t, int);
virtual StoreSearch *search(String const url, HttpRequest *);
/*
- * $Id: htcp.cc,v 1.57 2004/08/30 05:12:31 robertc Exp $
+ * $Id: htcp.cc,v 1.58 2005/07/03 15:25:08 serassio Exp $
*
* DEBUG: section 31 Hypertext Caching Protocol
* AUTHOR: Duane Wesssels
else
len = 0;
- debug(31, 3) ("htcpBuildCountstr: LENGTH = %d\n", len);
+ debugs(31, 3, "htcpBuildCountstr: LENGTH = " << len);
debug(31, 3) ("htcpBuildCountstr: TEXT = {%s}\n", s ? s : "<NULL>");
/*
- * $Id: mem.cc,v 1.85 2004/08/30 05:12:31 robertc Exp $
+ * $Id: mem.cc,v 1.86 2005/07/03 15:25:08 serassio Exp $
*
* DEBUG: section 13 High Level Memory Pool Management
* AUTHOR: Harvest Derived
StrPools[i].pool = MemPools::GetInstance().create(StrPoolsAttrs[i].name, StrPoolsAttrs[i].obj_size);
if (StrPools[i].pool->objectSize() != StrPoolsAttrs[i].obj_size)
- debug(13, 1) ("Notice: %s is %d bytes instead of requested %d bytes\n", StrPoolsAttrs[i].name, StrPoolsAttrs[i].obj_size, StrPoolsAttrs[i].obj_size);
+ debugs(13, 1, "Notice: " << StrPoolsAttrs[i].name << " is " << StrPoolsAttrs[i].obj_size << " bytes instead of requested " << StrPoolsAttrs[i].obj_size << " bytes");
}
cachemgrRegister("mem",
/*
- * $Id: net_db.cc,v 1.176 2005/04/18 21:52:42 hno Exp $
+ * $Id: net_db.cc,v 1.177 2005/07/03 15:25:08 serassio Exp $
*
* DEBUG: section 38 Network Measurement Database
* AUTHOR: Duane Wessels
/* Get the size of the buffer now */
size = ex->buf_ofs + recievedData.length;
- debug(38, 3) ("netdbExchangeHandleReply: %d bytes buf\n", (int) size);
+ debugs(38, 3, "netdbExchangeHandleReply: " << size << " bytes buf");
/* Check if we're still doing headers */
/* skip reply headers */
if ((hdr_sz = headersEnd(p, ex->buf_ofs))) {
- debug(38, 5) ("netdbExchangeHandleReply: hdr_sz = %d\n", hdr_sz);
+ debugs(38, 5, "netdbExchangeHandleReply: hdr_sz = " << hdr_sz);
rep = ex->e->getReply();
assert (0 != rep->sline.status);
debug(38, 3) ("netdbExchangeHandleReply: reply status %d\n",
/*
- * $Id: squid.h,v 1.246 2005/06/03 15:00:55 serassio Exp $
+ * $Id: squid.h,v 1.247 2005/07/03 15:25:08 serassio Exp $
*
* AUTHOR: Duane Wessels
*
#ifndef PRIu64 /* ISO C99 Standard printf() macro for 64 bit unsigned int */
#ifdef _SQUID_MSWIN_ /* Windows native port using MSVCRT */
#define PRIu64 "I64u"
+/* FIXME: Temporary hack to allow the build on Digital/Compaq/HP Tru64 Unix.
+ Long term solution: add type size detect in configure like Squid 2.5 and
+ define PRIu64 according to the size of long int and int64_t.
+ */
+#elif defined(__alpha) && defined(_SQUID_OSF_)
+#define PRIu64 "lu"
#else
#define PRIu64 "llu"
#endif /* _SQUID_MSWIN_ */
/*
- * $Id: store_dir.cc,v 1.150 2005/01/03 16:08:26 robertc Exp $
+ * $Id: store_dir.cc,v 1.151 2005/07/03 15:25:09 serassio Exp $
*
* DEBUG: section 47 Store Directory Routines
* AUTHOR: Duane Wessels
}
void
-StoreHashIndex::updateSize(unsigned int, int)
+StoreHashIndex::updateSize(size_t, int)
{}
void