/* strip white-space characters from attributes */
for (i = 0; i < qj->__sizeattributes; i++)
- glite_jpis_trim_soap(soap, &qj->attributes[i]);
+ glite_jpis_trim(qj->attributes[i]);
for (i = 0; i < qj->__sizeconditions; i++)
- glite_jpis_trim_soap(soap, &GLITE_SECURITY_GSOAP_LIST_GET(qj->conditions, i)->attr);
+ glite_jpis_trim(GLITE_SECURITY_GSOAP_LIST_GET(qj->conditions, i)->attr);
return 0;
}
#define WHITE_SPACE_SET "\n\r \t"
-void glite_jpis_trim_soap(struct soap *soap, char **soap_str) {
+void glite_jpis_trim(char *str) {
size_t pos, len;
- char *s;
- if (!*soap_str) return;
+ if (!str) return;
- pos = strspn(*soap_str, WHITE_SPACE_SET);
- len = strcspn(*soap_str + pos, WHITE_SPACE_SET);
- s = soap_malloc(soap, len + 1);
- memcpy(s, *soap_str + pos, len);
- s[len] = '\0';
-
- soap_dealloc(soap, *soap_str);
- *soap_str = s;
+ pos = strspn(str, WHITE_SPACE_SET);
+ len = strcspn(str + pos, WHITE_SPACE_SET);
+ if (pos) memmove(str, str + pos, len);
+ str[len] = '\0';
}
#include <glite/jp/types.h>
#include <glite/jp/context.h>
-void glite_jpis_trim_soap(struct soap *soap, char **soap_str);
+void glite_jpis_trim(char *str);
int glite_jpis_stack_error_source(glite_jp_context_t ctx, int code, const char *func, int line, const char *desc, ...);
avs[i].name = ctx->conf->attrs[iname];
iname++;
} while (strcasecmp(avs[i].name, GLITE_JP_ATTR_JOBID) == 0 || strcasecmp(avs[i].name, GLITE_JP_ATTR_OWNER) == 0);
+ glite_jpis_trim(token);
avs[i].value = token;
avs[i].timestamp = time(NULL);
-// printf(stderr, "\t %d: %s = '%s'\n", i, avs[i].name, avs[i].value);
+ avs[i].origin = GLITE_JP_ATTR_ORIG_FILE;
+// printf("\t %d: %s = '%s'\n", i, avs[i].name, avs[i].value);
i++;
token = strtok_r(NULL, FEEDING_SEPARATORS, &lasts);