THRPLUSLIB:=libglite_lb_clientpp_${thrflavour}.la
TOOLS:=dump load purge
-EXAMPLES:=log_usertag_proxy job_reg feed_shark notify
+EXAMPLES:=query_seq_code log_usertag_proxy job_reg feed_shark notify query_ext
FAKE_EXAMPLES:=job_log_fake job_reg_fake logevent_fake
FAKE_EXAMPLES_SOURCES:=job_log.c job_reg.c
return edg_wll_QueryEvents(ctx,j,e,eventsOut);
}
-
-/* XXX missing */
-int edg_wll_QuerySequenceCode(edg_wll_Context ctx, edg_wlc_JobId jobId, char **code)
-{
- return edg_wll_SetError(ctx, EOPNOTSUPP, NULL);
-}
-
memset(&saddr, 0, sizeof(saddr));
saddr.sun_family = AF_UNIX;
- if (!ctx->p_proxy_filename) {
+ if (!ctx->p_lbproxy_serve_sock) {
edg_wll_SetError(ctx, EINVAL, "Proxy socket path not set!");
goto err;
}
- if (strlen(ctx->p_proxy_filename) > 108) { // UNIX_PATH_MAX (def. in linux/un.h)
+ if (strlen(ctx->p_lbproxy_serve_sock) > 108) { // UNIX_PATH_MAX (def. in linux/un.h)
// but not defined in sys/un.h
edg_wll_SetError(ctx, EINVAL, "proxy_filename too long!");
goto err;
}
- strcpy(saddr.sun_path, ctx->p_proxy_filename);
+ strcpy(saddr.sun_path, ctx->p_lbproxy_serve_sock);
if ((flags = fcntl(ctx->connPlain->sock, F_GETFL, 0)) < 0 ||
fcntl(ctx->connPlain->sock, F_SETFL, flags | O_NONBLOCK) < 0) {
}
-
-int edg_wll_QuerySequenceCode(edg_wll_Context ctx, edg_wlc_JobId jobId, char **code)
-{
- int error = 0;
- char *response = NULL,
- *message = NULL,
- *send_mess = NULL;
-
-
- edg_wll_ResetError(ctx);
-
- if ( edg_wll_QuerySequenceCodeToXML(ctx, jobId, &send_mess) != 0 )
- {
- edg_wll_SetError(ctx , (edg_wll_ErrorCode) EINVAL, "Invalid query record.");
- goto err;
- }
-
- ctx->p_tmp_timeout = ctx->p_query_timeout;
-
- error = edg_wll_http_send_recv_proxy(ctx, "POST /querySequenceCode HTTP/1.1",
- request_headers, send_mess, &response, NULL, &message);
- if ( error != 0 )
- goto err;
-
- if (http_check_status(ctx,response))
- goto err;
-
- edg_wll_ParseQuerySequenceCodeResult(ctx,message,code);
-
-err:
- free(response);
- free(message);
- free(send_mess);
- return edg_wll_Error(ctx,NULL,NULL);
-
-}
-
-
int set_server_name_and_port(edg_wll_Context ctx, const edg_wll_QueryRec **job_conditions)
{
int i = 0, j,
return(error);
}
+int edg_wll_QuerySequenceCodeProxy(edg_wll_Context ctx, edg_wlc_JobId jobId, char **code)
+{
+ int error = 0;
+ char *response = NULL,
+ *message = NULL,
+ *send_mess = NULL;
+
+
+ ctx->isProxy = 1;
+ edg_wll_ResetError(ctx);
+
+ if ( edg_wll_QuerySequenceCodeToXML(ctx, jobId, &send_mess) != 0 )
+ {
+ edg_wll_SetError(ctx , (edg_wll_ErrorCode) EINVAL, "Invalid query record.");
+ goto err;
+ }
+
+ ctx->p_tmp_timeout = ctx->p_query_timeout;
+
+ error = edg_wll_http_send_recv_proxy(ctx, "POST /querySequenceCode HTTP/1.1",
+ request_headers, send_mess, &response, NULL, &message);
+ if ( error != 0 )
+ goto err;
+
+ if (http_check_status(ctx,response))
+ goto err;
+
+ edg_wll_ParseQuerySequenceCodeResult(ctx,message,code);
+
+err:
+ free(response);
+ free(message);
+ free(send_mess);
+
+ return edg_wll_Error(ctx,NULL,NULL);
+}
+
/******************************************************************
* Proxy wrappers
fprintf(stderr,"Logging to L&B Proxy at socket %s\n",
context->p_lbproxy_store_sock? context->p_lbproxy_store_sock: socket_path);
#endif
+ memset(&conn, 0, sizeof(conn));
conn.sock = socket(PF_UNIX, SOCK_STREAM, 0);
if (conn.sock < 0) {
edg_wll_SetError(context,answer = errno,"socket() error");
/* query LBProxyServer for sequence code if not user-suplied */
if (!code) {
- edg_wll_QuerySequenceCode(context, job, &code_loc);
+ edg_wll_QuerySequenceCodeProxy(context, job, &code_loc);
goto err;
}
else