projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: usage of wrong xml node. Fix string compare. Cosmetic: add newline after xml...
[yaz-moved-to-github.git]
/
src
/
zoom-c.c
diff --git
a/src/zoom-c.c
b/src/zoom-c.c
index
742b956
..
dc52963
100644
(file)
--- a/
src/zoom-c.c
+++ b/
src/zoom-c.c
@@
-506,8
+506,15
@@
ZOOM_API(void)
ZOOM_options_get_int(c->options, "preferredMessageSize", 1024*1024);
c->async = ZOOM_options_get_bool(c->options, "async", 0);
ZOOM_options_get_int(c->options, "preferredMessageSize", 1024*1024);
c->async = ZOOM_options_get_bool(c->options, "async", 0);
+
+ if (c->sru_mode == zoom_sru_error)
+ {
+ ZOOM_set_error(c, ZOOM_ERROR_UNSUPPORTED_PROTOCOL, val);
+ ZOOM_connection_remove_tasks(c);
+ return;
+ }
+
yaz_log(c->log_details, "%p ZOOM_connection_connect async=%d", c, c->async);
yaz_log(c->log_details, "%p ZOOM_connection_connect async=%d", c, c->async);
-
ZOOM_connection_add_task(c, ZOOM_TASK_CONNECT);
if (!c->async)
ZOOM_connection_add_task(c, ZOOM_TASK_CONNECT);
if (!c->async)
@@
-1526,7
+1533,7
@@
static void handle_http(ZOOM_connection c, Z_HTTP_Response *hres)
{
zoom_ret cret = zoom_complete;
int ret = -1;
{
zoom_ret cret = zoom_complete;
int ret = -1;
- const char *addinfo = 0;
+ char *addinfo = 0;
const char *connection_head = z_HTTP_header_lookup(hres->headers,
"Connection");
const char *location;
const char *connection_head = z_HTTP_header_lookup(hres->headers,
"Connection");
const char *location;
@@
-1556,7
+1563,7
@@
static void handle_http(ZOOM_connection c, Z_HTTP_Response *hres)
}
else
{
}
else
{
- ret = ZOOM_handle_sru(c, hres, &cret);
+ ret = ZOOM_handle_sru(c, hres, &cret, &addinfo);
if (ret == 0)
{
if (c->no_redirects) /* end of redirect. change hosts again */
if (ret == 0)
{
if (c->no_redirects) /* end of redirect. change hosts again */
@@
-1569,7
+1576,11
@@
static void handle_http(ZOOM_connection c, Z_HTTP_Response *hres)
if (hres->code != 200)
ZOOM_set_HTTP_error(c, hres->code, 0, 0);
else
if (hres->code != 200)
ZOOM_set_HTTP_error(c, hres->code, 0, 0);
else
+ {
+ yaz_log(YLOG_LOG, "set error... addinfo=%s", addinfo ?
+ addinfo : "NULL");
ZOOM_set_error(c, ZOOM_ERROR_DECODE, addinfo);
ZOOM_set_error(c, ZOOM_ERROR_DECODE, addinfo);
+ }
ZOOM_connection_close(c);
}
if (cret == zoom_complete)
ZOOM_connection_close(c);
}
if (cret == zoom_complete)
@@
-1601,6
+1612,8
@@
static void handle_http(ZOOM_connection c, Z_HTTP_Response *hres)
c->reconnect_ok = 0;
}
}
c->reconnect_ok = 0;
}
}
+ else
+ c->reconnect_ok = 1; /* if the server closes anyway */
}
}
#endif
}
}
#endif
@@
-1671,7
+1684,6
@@
static int do_read(ZOOM_connection c)
#endif
}
}
#endif
}
}
- c->reconnect_ok = 0;
}
return 1;
}
}
return 1;
}