projects
/
yazpp-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use odr_create_Odr_oct
[yazpp-moved-to-github.git]
/
zlint
/
zlint.cpp
diff --git
a/zlint/zlint.cpp
b/zlint/zlint.cpp
index
73179fe
..
b8b8d59
100644
(file)
--- a/
zlint/zlint.cpp
+++ b/
zlint/zlint.cpp
@@
-1,5
+1,5
@@
/* This file is part of the yazpp toolkit.
/* This file is part of the yazpp toolkit.
- * Copyright (C) 1998-2012 Index Data and Mike Taylor
+ * Copyright (C) 1998-2013 Index Data and Mike Taylor
* See the file LICENSE for details.
*/
* See the file LICENSE for details.
*/
@@
-14,6
+14,7
@@
#include <yaz/otherinfo.h>
#include <yaz/charneg.h>
#include <yaz/log.h>
#include <yaz/otherinfo.h>
#include <yaz/charneg.h>
#include <yaz/log.h>
+#include <yaz/odr.h>
#include <zlint.h>
#include <zlint.h>
@@
-35,9
+36,9
@@
private:
int m_test_reported;
};
int m_test_reported;
};
-Zlint::Zlint(IPDU_Observable *the_PDU_Observable) :
+Zlint::Zlint(IPDU_Observable *the_PDU_Observable) :
Z_Assoc(the_PDU_Observable)
Z_Assoc(the_PDU_Observable)
-
+
{
m_PDU_Observable = the_PDU_Observable;
m_host = 0;
{
m_PDU_Observable = the_PDU_Observable;
m_host = 0;
@@
-79,13
+80,12
@@
void Zlint::timeoutNotify()
{
if (m_cur_test->m_t->recv_fail(this, 2) != TEST_FINISHED)
{
{
if (m_cur_test->m_t->recv_fail(this, 2) != TEST_FINISHED)
{
- close();
client(m_host);
timeout(30);
return;
}
client(m_host);
timeout(30);
return;
}
+ close_goto_next();
}
}
- close_goto_next();
}
void Zlint::failNotify()
}
void Zlint::failNotify()
@@
-94,13
+94,12
@@
void Zlint::failNotify()
{
if (m_cur_test->m_t->recv_fail(this, 1) != TEST_FINISHED)
{
{
if (m_cur_test->m_t->recv_fail(this, 1) != TEST_FINISHED)
{
- close();
client(m_host);
timeout(30);
return;
}
client(m_host);
timeout(30);
return;
}
+ close_goto_next();
}
}
- close_goto_next();
}
void Zlint::connectNotify()
}
void Zlint::connectNotify()
@@
-109,8
+108,8
@@
void Zlint::connectNotify()
{
if (m_cur_test->m_t->init(this) != TEST_FINISHED)
return;
{
if (m_cur_test->m_t->init(this) != TEST_FINISHED)
return;
+ close_goto_next();
}
}
- close_goto_next();
}
void Zlint::recv_GDU(Z_GDU *gdu, int len)
}
void Zlint::recv_GDU(Z_GDU *gdu, int len)
@@
-122,23
+121,25
@@
void Zlint::recv_GDU(Z_GDU *gdu, int len)
return;
if (r == TEST_REOPEN)
{
return;
if (r == TEST_REOPEN)
{
- close();
client(m_host);
timeout(30);
return;
}
client(m_host);
timeout(30);
return;
}
+ close_goto_next();
}
}
- close_goto_next();
}
void Zlint::close_goto_next()
{
}
void Zlint::close_goto_next()
{
- close();
if (m_cur_test)
m_cur_test = m_cur_test->m_next;
if (m_cur_test)
if (m_cur_test)
m_cur_test = m_cur_test->m_next;
if (m_cur_test)
+ {
client(m_host);
client(m_host);
- timeout(30);
+ timeout(30);
+ }
+ else
+ close();
}
IPDU_Observer *Zlint::sessionNotify(
}
IPDU_Observer *Zlint::sessionNotify(
@@
-149,26
+150,18
@@
IPDU_Observer *Zlint::sessionNotify(
Z_ReferenceId *Zlint::mk_refid(const char *buf, int len)
{
Z_ReferenceId *Zlint::mk_refid(const char *buf, int len)
{
- Z_ReferenceId *id =
- (Z_ReferenceId *) odr_malloc(odr_encode(), sizeof(*id));
- id->size = id->len = len;
- id->buf = (unsigned char*) odr_malloc(odr_encode(), len);
- memcpy(id->buf, buf, len);
- return id;
+ return odr_create_Odr_oct(odr_encode(), buf, len);
}
int Zlint::initResponseGetVersion(Z_InitResponse *init)
{
int no = 0;
}
int Zlint::initResponseGetVersion(Z_InitResponse *init)
{
int no = 0;
- int off = 0;
int i;
for (i = 0; i<12; i++)
if (ODR_MASK_GET(init->protocolVersion, no))
{
no = i+1;
}
int i;
for (i = 0; i<12; i++)
if (ODR_MASK_GET(init->protocolVersion, no))
{
no = i+1;
}
- else
- off = 1;
return no;
}
return no;
}